in JWASM v2.06e the listing file generated with /Sg enabled is corrupted for dot-directive lines (eg .if, .while, .repeat, etc).
It seems the generated code overlays the source comment area of the dot-directive line, after the first comment character.
As an example (small file compiled wit /Sg /Sn /Fl ):
JWasm v2.06e, Jul 22 2011
test.asm
00000000 _TEXT segment byte public 'CODE'
00000000 TabComplete proc near
00000000 .repeat ;d00000000 s)
00000000 * @C0002:
00000000 E315 jcxz @F ;jmp= user entry empty, append '*.*'
00000002 .repeat ;s00000002 '
00000002 * @C0005:
00000002 4E dec si ;al= preceding char
00000003 8A04 mov al,[si]
00000005 .break .if al == ':' ;b00000005 3C3A 00005 *00000007 740E 00007 * jz @C0006
00000009 .break .if al == '\' ;b00000009 3C5C 00009 *0000000B 740A 0000B * jz @C0006
0000000D .if al == '.' ;i0000000D 3C2E ound,
0000000D 0000000F 7504
0000000F * jnz @C0007
00000011 42 inc dx ;discard leading '*.' portion
00000012 42 inc dx
00000013 .break
00000013 EB02 * jmp @C0006
00000015 .endif
00000015 * @C0007:
00000015 .untilcxz ;c00000015 main
000000100000015 E2EB 004:
00000015 00000017 0005
00000017 * @C0006:
00000017 @@:
00000017 .until 1 ;e00000017 reaks)
0000000000017 C0001:
00000017 * @C0003:
00000017 59 pop cx ;restore remaining mask buffer space
00000018 8BF2 mov si,dx ;si= ASCIIZ wildcard string to append
0000001A .repeat ;a0000001A A * @C0009:
0000001A AC lodsb
0000001B AA stosb
0000001C .until al == 0
0000001C * @C0008:
0000001C 3C00 * cmp al , 0
0000001E 75FA * jnz @C0009
00000020 * @C000A:
00000020 TabComplete endp
00000020 test.asm: 32 lines, 2 passes, 0 ms, 0 warnings, 0 errors
end
The original source file is:
_TEXT segment byte public 'CODE'
TabComplete proc near
.repeat ;dummy block (to support breaks)
jcxz @F ;jmp= user entry empty, append '*.*'
.repeat ;scan for '.' before ':' or '\'
dec si ;al= preceding char
mov al,[si]
.break .if al == ':' ;break= ':', append '*.*'
.break .if al == '\' ;break= '\', append '*.*'
.if al == '.' ;if filename separator ('.') found,
inc dx ;discard leading '*.' portion
inc dx
.break
.endif
.untilcxz ;continue scanning if chars remain
@@:
.until 1 ;end dummy block (to support breaks)
pop cx ;restore remaining mask buffer space
mov si,dx ;si= ASCIIZ wildcard string to append
.repeat ;append wildcard mask
lodsb
stosb
.until al == 0
TabComplete endp
@CurSeg ends
end
Confirmed.
the -Sg listing is messed up if a line containes both a comment and a directive that generates source lines ( invoke, hll directives, ... )
Fixed in v2.07.