Upload hello world template

This commit is contained in:
RuiFPB committed 2026-09-28 17:07:08 +01:00
commit a8caf9db75
7 files changed
+196

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
.import serial_setup
.import serial_print_char
.segment "ZEROPAGE"
; Zero-page variables ($0000 - $00ff)
.segment "BSS"
; RAM variables ($0100 - $7fff)
.segment "CODE"
; Actual program code ($c000 - $fff9)
reset: ; Program starts here
jsr serial_setup
ldx #0
hello_world_loop:
lda str_hello_world,x ; get char
beq hello_world_end ; IF char is 0, done
jsr serial_print_char ; send char to console
inx ; increment x (next char)
jmp hello_world_loop
hello_world_end:
jmp hello_world_end
irq: ; IRQ Handler
rti ; Do nothing
nmi: ; NMI handler
rti ; Do nothing
str_hello_world:
.asciiz "Hello, World!"
.segment "VECTORS"
; NMI, RESET and IRQ vectors
.word nmi
.word reset
.word irq