Skip to content

Instantly share code, notes, and snippets.

Created September 17, 2017 10:11
Show Gist options
  • Save anonymous/e09daaee1632245a5ecef1105d8591fb to your computer and use it in GitHub Desktop.
Save anonymous/e09daaee1632245a5ecef1105d8591fb to your computer and use it in GitHub Desktop.
Commented Z80 Hello World
autoexec
org 32768
print_test:
ld b,96
ld a," " ; 32 is the ASCII code for space
loop2:
rst 16 ; Output A to current stream
add a,2
cp b ; Keep looping until A=96
jr nz,loop2
print_text:
ld hl,text2 ; Set pointer to start of text
ld b,20 ; Set up loop counter, 20 characters to print
print_loop:
ld a,(hl) ; Get character from pointer
rst 16 ; Print character
inc hl ; Move to next character
djnz loop3
ret
text2: dm "Howsaboutis, then!!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment