Hi Habran,
I recently came across another bug in HJWasm to do with macro parsing. Create a new file test.asm as follows:
tempvar TEXTEQU <MyProc PROC param1:DWORD,>
MyMacro MACRO
tempvar
EXITM
ENDM
.CODE
MyMacro
ret
MyProc ENDP
END
With ml64.exe this assembles fine. However, with HJWasm, the following error occurs:
JWasm v2.11, Oct 20 2013, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
x.asm(10) : Error A2209: Syntax error: EXITM
MyMacro(2)[x.asm]: Macro called from
x.asm(10): Main line code
x.asm: 16 lines, 1 passes, 0 ms, 0 warnings, 1 errors
The problem appears to be that the output stream and the macro parsing stream and being merged, hence the EXITM is being
appended to the PROC declaration with the comma at the end even though they are technically two different processing streams.
Here is the listing file from ml64.exe
= MyProc PROC param1:DWORD tempvar TEXTEQU <MyProc PROC param1:DWORD,>
,
MyMacro MACRO
tempvar
EXITM
ENDM
00000000 .CODE
MyMacro
00000000 1 tempvar
ret
00000006 MyProc ENDP
END
This does indeed produce a real function as the following output from dumpbin.exe shows:
File Type: COFF OBJECT
MyProc:
0000000000000000: 55 push rbp
0000000000000001: 48 8B EC mov rbp,rsp
0000000000000004: C9 leave
0000000000000005: C3 ret
Here is the listing from HJWasm:
= MyProc PROC param1:DWORD, tempvar TEXTEQU <MyProc PROC param1:DWORD,>
MyMacro MACRO
> tempvar
> EXITM
> ENDM
.CODE
MyMacro
00000000 1 MyProc PROC param1:DWORD,EXITM
Error A2209: Syntax error: EXITM
00000000 ret
00000001 MyProc ENDP
END
Would appreciate it if you could take a look. Thanks in advance.