參考資訊:
https://github.com/ObjAsm
https://objasm.x10host.com/index.htm
main.asm
%include @Environ(OBJASM_PATH)\Code\Macros\Model.inc SysSetup OOP, WIN32, ANSI_STRING MakeObjects Primer .const Object MyApp, , Primer RedefineMethod Init ObjectEnd .code Method MyApp.Init, uses esi SetObject esi invoke MessageBox, NULL, $OfsCStr("Hello, world!"), $OfsCStr("main"), MB_OK MethodEnd start proc SysInit OCall $ObjTmpl(MyApp)::MyApp.Init OCall $ObjTmpl(MyApp)::MyApp.Done SysDone invoke ExitProcess, 0 start endp end
Makefile
export WINEPREFIX=/home/user/.wine_amd64 TARGET=main MYWINE=box86 wine OBJASM=/home/user/.wine_amd64/drive_c/ObjAsm all: ${MYWINE} ${OBJASM}/Build/Tools/Assembler/uasm32.exe @c:/ObjAsm/Build/Options/OPT_ASM_RLS_32.txt ${TARGET}.asm ${MYWINE} ${OBJASM}/Build/Tools/Linker/link.exe @c:/ObjAsm/Build/Options/OPT_LNK_RLS_32.txt ${TARGET}.obj run: ${MYWINE} ${TARGET}.exe clean: rm -rf ${TARGET}.exe ${TARGET}.obj
編譯、執行
$ make $ make run