GitHub_collection_hello-world/a/Assembler MASM Win32.asm

36 lines
619 B
NASM
Raw Normal View History

2016-06-13 21:59:48 +02:00
; ---------------------------------------------
; Hello World for Win32 Intel x86 Assembly
;
; by fruel (https://github.com/fruel)
; 13 June 2016
; ---------------------------------------------
.386
.model flat,stdcall
.stack 4096
EXTRN ExitProcess@4 : PROC
EXTRN GetStdHandle@4 : PROC
EXTRN WriteConsoleA@20 : PROC
.data
2021-05-07 20:33:04 -05:00
msg BYTE "Hello World",0
2016-06-13 21:59:48 +02:00
bytesWritten DWORD ?
.code
main PROC
2021-05-08 09:57:36 -05:00
push -11
2016-06-13 21:59:48 +02:00
call GetStdHandle@4
2021-05-08 09:57:36 -05:00
push 0
push OFFSET bytesWritten
push LENGTHOF msg - 1
push OFFSET msg
push eax
2016-06-13 21:59:48 +02:00
call WriteConsoleA@20
2021-05-08 09:57:36 -05:00
push 0
2016-06-13 21:59:48 +02:00
call ExitProcess@4
main ENDP
END main