[development record] a way to compile and output Hello World

Time:2021-1-13

It needs the support of irvine32.inc, and the download method is shown below

 1 INCLUDE Irvine32.inc
 2 .data
 3 endl EQU <0dh,0ah>
 4 message LABEL BYTE
 5     BYTE 048H,045H,04cH,04cH,04fH,020H,057H,04fH,052H,04cH,044H,endl
 6 messageSize DWORD ($-message)
 7 consoleHandle HANDLE 0
 8 bytesWritten  DWORD ?
 9 .code
10 main PROC
11     INVOKE GetStdHandle, STD_OUTPUT_HANDLE
12     mov consoleHandle,eax 
13     INVOKE WriteConsole,
14       consoleHandle,
15       ADDR message,
16       messageSize,
17       ADDR bytesWritten,
18       0
19     INVOKE ExitProcess,0
20 main ENDP
21 END main

 

Note that this is just a simple trick (not really), but the use of ASCII to represent the string.

Irvine32.inc download address:

https://github.com/Eazybright/Irvine32