Created
May 11, 2018 17:05
-
-
Save mikkokotila/a052db8aa00de9fd7a414da51aa17e1d to your computer and use it in GitHub Desktop.
x86 Hello World
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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