參考網站:
https://www.plantation-productions.com/Webster/
https://www.plantation-productions.com/Webster/Win32Asm/win32API.html
經典的Hello, world!程式框架總是能夠讓人細心品味一款程式語言的美好,司徒就使用一個簡單的Message對話盒來展現Hello, world!框架
main.hla
program main; #include("w.hhf") begin main; w.MessageBox(0, "Hello, world!", "main", w.MB_OK); end main;
Line 1:程式名稱,program、begin、end的名稱都必須一致,HLA語言其實是跟Pascal語言很相似的
Line 3:Header檔案
Line 5~7:主程式部份
Line 6:顯示Message對話盒
Makefile
export WINEPREFIX=/home/user/.wine_x86 TARGET=main MYWINE=box86 wine all: ${MYWINE} hlaparse.exe -WIN32 -level=high -v -test ${TARGET}.hla ${MYWINE} polink.exe @${TARGET}.link hlalib.lib ${TARGET}.obj /OUT:${TARGET}.exe run: ${MYWINE} ${TARGET}.exe clean: rm -rf ${TARGET}.exe ${TARGET}.obj ${TARGET}.link
編譯、執行
$ make $ make run