Thursday, March 05, 2020

ASM: Hello world in Windows assembly

Hello world in Windows assembly using MASM

.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
HelloWorld db "Hello World!", 0
.code
start:
invoke StdOut, addr HelloWorld
invoke ExitProcess, 0
end start
view raw hello.asm hosted with ❤ by GitHub


Pre-requisite:



To assemble:
\masm32\bin\ml /c /Zd /coff hello.asm

To link:
\masm32\bin\Link /SUBSYSTEM:CONSOLE hello.obj

Reference(s):
This is shamelessly using contents from Windows Assembly Programming Tutorial  by JEFF HUANG (huang6@uiuc.edu)
x86 Disassembly - link

No comments:

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...