Created
December 27, 2015 16:01
-
-
Save dgellow/78278aca7108e2038e32 to your computer and use it in GitHub Desktop.
C64 hello world. Assemble with `dasm`. https://twitter.com/dgellow/status/681142655213027328
This file contains hidden or 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
processor 6502 ; define processor family for dasm | |
org $C000 ; memory location for our code | |
clear = $e544 ; clear screen | |
drawchar = $ffd2 ; draw value in regA | |
main: | |
jsr clear | |
jsr drawmsg | |
return: | |
rts | |
msg: | |
.byte "HELLO YOU#" | |
rts | |
drawmsg: | |
ldx #0 ; regX keeps msg index | |
jsr drawmsghelper | |
rts | |
drawmsghelper: | |
lda msg,x | |
cmp #35 ; test regA with char '#' | |
beq return | |
jsr drawchar | |
inx | |
jmp drawmsghelper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment