Skip to content

Instantly share code, notes, and snippets.

@vmxdev
Last active June 23, 2022 15:49
Show Gist options
  • Save vmxdev/38420c3eb12dc3cfe954503b7dd4681f to your computer and use it in GitHub Desktop.
Save vmxdev/38420c3eb12dc3cfe954503b7dd4681f to your computer and use it in GitHub Desktop.
8086 16-bit helloworld.com
; nasm hello.asm -fbin -o hello.com
; to run in DosBox: dosbox hello.com
org 100h
section .text
start:
mov ax, 13h
int 10h
mov ax, 0xa000
mov es, ax
xor di, di
cld
xor bl, bl
next_line:
mov cx, 0
next_point:
mov [es:di], cl
inc di
inc cx
cmp cx, 320
jne next_point
inc bl
cmp bl, 200
jne next_line
; print greeting
mov dx, msg ;'$'-terminated string
mov ah, 09h ; write string to standard output from DS:DX
int 0x21 ; call dos services
int 20h
section .data
; program data
msg db 'Hello #chlor'
crlf db 0x0d, 0x0a
endstr db '$'
section .bss
; uninitialized data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment