Have you checked opattr with a literal string and -Zg switch? I've tested that with hjwasm and ml and they seem to produce the same macro output via echo.
That's right, same output for the literal string. Not for the rest, though, and unfortunately it doesn't like this:
ife opattr SQWORD
SQWORD equ QWORD ; to make signed qwords available in MASM 6.15
endif
Same for SQWORD equ <QWORD> (both are OK for ML). Note that SQWORD is available in ML 8.0 but not earlier; meaning -Zg refers apparently to ML 6.15 (not 6.14, because then no MasmBasic code would assemble)
*** Assemble using hjwasm64 /c /coff -Zg /Fo "Opax" ***
HJWasm v2.13, Feb 1 2016, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
\masm32\MasmBasic\MasmBasic.inc(411) : Error A2209: Syntax error: equ QWORD
\masm32\MasmBasic\MasmBasic.inc(411): Included by
Tmp_File.asm(1): Main line code
*** using MasmBasic version 01.02.2016 ***
UNKNOWN=0
0 is type 0 with size 4294967295
## "dword ptr [ebx]" in line 16 is a valid argument ##
Tmp_File.asm(17) : Error A2065: Constant expected
opax(1)[Tmp_File.asm]: Macro called from
Tmp_File.asm(17): Main line code
## sorry, "-dword ptr [ebx]" in line 17 is NOT a valid argument ##
## sorry, ""HJWasm is a perfect MASM clone"" in line 18 is NOT a valid argument ##
## sorry, "HJWasm is a perfect MASM clone" in line 19 is NOT a valid argument ##
Tmp_File.asm: 20 lines, 1 passes, 172 ms, 0 warnings, 2 errors
*** Assembly Error ***
SQWORD being a reserved word cannot be redefined (hence the error). While this is not MASM 6.15 compatible it is MASM 8 compatible which exhibits exactly the same behaviour, the IFE will skip due to SQWORD being defined, and if you try to force the equ the assembly will error.
I've changed it to use switch -Zne instead of -Zg (seems more appropriate) and to work around the fact that i cannot (without immense effort) remove sqword as a reserved word based on a switch, i've specifically excluded SQWORD from the parser change to 0 when using -Zne , so SQWORD will still return 36 and the IFE block will bypass.
This means the source will assemble and be correct, but it's not ML 6.x compatible as that would opattr to 0 AND SQWORD wouldn't exist as a reserved word...
That said.. there is a limit to how much of this sort of "backwards" compatibility we can apply ..
I think the intention of JWASM being completely masm compatible was noble, but it seems a lot of things have never been 100% masm compatible.. I would hope to achieve 98% compatible :) and keep it at that.. especially for 32bit as I don't forsee any changes in that area.. it's not where things are moving.. My only concerns would be things which work in JWASM but no longer in HJWASM, those should rightly work as before without very good reason for changing.
I've uploaded these changes to the site and git. JJ give that a try and see if that allows your block to assemble now.