Friday, March 06, 2020

ASM: Hello world using MessageBox in Windows assembly

MessageBox 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\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.data
HelloWorld db "Hello World!", 0
.code
start:
invoke MessageBox, NULL, addr HelloWorld, addr HelloWorld, MB_OK
invoke ExitProcess, 0
end start
view raw hellow.asm hosted with ❤ by GitHub

Pre-requisite:

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

To link:
\masm32\bin\Link /SUBSYSTEM:WINDOWS hellow.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 ...