Now the good news is: Yes, this snippet assembles with both assembler families, provided you set the useML flag correctly:
option casemap:none
useML=0
ife useML
.x64 ; create 64 bit code; ML64 chokes
.model flat, stdcall ; 32 bit memory model (??????)
endif
ExitProcess PROTO :DWORD
includelib \masm64\lib\kernel32.lib
.code
start proc
sub rsp, 28h
mov rcx, 12345h
call ExitProcess
start endp
end
The bad news is that all members of the Watcom family produce this linker error:
fatal error LNK1107: invalid or corrupt file: cannot read at 0xC1
Any clue why this happens, and how it can be avoided?
P.S.: If I use -win64 for JWasm, I get LINK : error LNK2001: unresolved external symbol start
Empty64.obj : error LNK2019: unresolved external symbol _ExitProcess@8 referenced in function _start@0
ML64 is tolerant, it just issues an ugly warning:MASM : warning A4018:invalid command-line option : -win64