Does Open Watcom support the MS COFF object file output?
No just OMF i think.
I remember that they have a special name decoration system in object files.
__cdecl foo
__stdcall foo@0
__watcall foo_
EDIT 20100811: Open Watcom C 32 without CRT library.
use -s switch and link with objectfile OWCNoCrt.obj.
; Open Watcom C 32 NoCrt startup code OWCNoCrt
; use WinMainCRTStartup as new stating point like MS linker do
; compile this with wasm -bt=nt -3r -ms OWCNorCrt.asm
.386p
.model flat, stdcall
extrn WinMainCRTStartup : near
public wstart_
.code
wstart_:
jmp WinMainCRTStartup
end wstart_
Here is Vortex code ported to wasm:
; Open Watcom C 32 NoCrt startup code OWCCrt0Gui
; compile this with wasm -bt=nt -3r -ms OWCCrt0Gui.asm
; wlib OWCCrt0Gui OWCCrt0Gui
; Based on Vortex crt0gui.asm
.386p
.model flat, stdcall
extrn ExitProcess@4 : near
extrn GetCommandLineA@0 : near
extrn GetModuleHandleA@4 : near
; extrn WinMainCRTStartup : near
extrn WinMain@16 : near
public wstart_
SW_SHOWDEFAULT equ 10
NULL equ 0
.data?
hInstance DWORD ?
.code
wstart_:
; jmp WinMainCRTStartup
push 0
call GetModuleHandleA@4
mov hInstance,eax
call GetCommandLineA@0
cmp byte PTR [eax],34 ;check for leading quote
jne skipfile
@@: ;look for the second quote
inc eax
mov cl,byte PTR [eax]
or cl,cl
jz finish
cmp cl,34
jne @b
jmp skipspace ;look for space chars
repeat1:
inc eax
skipfile: ;skip file name
mov cl,byte PTR [eax]
or cl,cl
jz finish
cmp cl,32
jne repeat1
dec eax
skipspace: ;skip space chars
inc eax
mov cl,byte PTR [eax]
cmp cl,32
je skipspace
finish:
push SW_SHOWDEFAULT
push eax
push NULL
push hInstance
call WinMain@16
push eax
call ExitProcess@4
end wstart_