Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mikkokotila/a052db8aa00de9fd7a414da51aa17e1d to your computer and use it in GitHub Desktop.
Save mikkokotila/a052db8aa00de9fd7a414da51aa17e1d to your computer and use it in GitHub Desktop.
x86 Hello World
org 0x100 ; .com files always start 256 bytes into the segment
; int 21h is going to want...
mov dx, msg ; the address of or message in dx
mov ah, 9 ; ah=9 - "print string" sub-function
int 0x21 ; call dos services
mov dl, 0x0d ; put CR into dl
mov ah, 2 ; ah=2 - "print character" sub-function
int 0x21 ; call dos services
mov dl, 0x0a ; put LF into dl
mov ah, 2 ; ah=2 - "print character" sub-function
int 0x21 ; call dos services
mov ah, 0x4c ; "terminate program" sub-function
int 0x21 ; call dos services
msg db 'Hello again, World!$' ; $-terminated message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment