Created
October 14, 2022 11:57
-
-
Save bplaat/aba1ce978ca4db0573189cab0a11cc27 to your computer and use it in GitHub Desktop.
Commander X16 - Hello World program
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
| ; Commander X16 - Hello World program | |
| ; acme -f cbm --cpu 65c02 -o hello.prg hello.asm && x16emu -prg hello.prg -run | |
| CHROUT=$FFD2 | |
| *=$0801 | |
| !byte $0B, $08, $01, $00, $9E, $32, $30, $36, $31, $00, $00, $00 | |
| start: | |
| ; Clear screen | |
| lda #$93 | |
| jsr CHROUT | |
| ; Print strings | |
| ldx #<message1 | |
| ldy #>message1 | |
| jsr print_string | |
| ldx #<message2 | |
| ldy #>message2 | |
| jsr print_string | |
| rts | |
| print_string: | |
| stx .repeat + 1 | |
| sty .repeat + 2 | |
| ldx #0 | |
| .repeat: | |
| lda $ffff, x | |
| beq .done | |
| jsr CHROUT | |
| inx | |
| jmp .repeat | |
| .done: | |
| rts | |
| message1 !pet "hello world!", 13, 0 | |
| message2 !pet "hello x16!", 13, 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment