c64cart-helloworld/helloworld.asm

43 lines
974 B
NASM
Raw Permalink Normal View History

2022-07-25 00:34:51 +00:00
KERNAL_CLEAR_SCREEN = $e544 ; KERNAL ROM routine.
VICSCN = $0400 ; VIC-II Screen Video Matrix, 1024 (int).
* = $8000
.word coldstart ; coldstart vector
.word warmstart ; warmstart vector
.byte $C3,$C2,$CD,$38,$30 ; "CBM8O". Autostart string
coldstart
sei
stx $d016
jsr $fda3 ;Prepare IRQ
jsr $fd50 ;Init memory. Rewrite this routine to speed up boot process.
jsr $fd15 ;Init I/O
jsr $ff5b ;Init video
cli
warmstart
; Insert your code here
jsr KERNAL_CLEAR_SCREEN
; read string by byte into vram until null byte
ldx #0
loop
lda my_string,x
cmp #$00
beq bail
sta VICSCN,x
inx
jmp loop
bail
; pretty colors
inc $d020
jmp *-3
2022-07-25 00:38:17 +00:00
; macro to convert ASCII text here to native screen codes
2022-07-25 00:34:51 +00:00
.enc "screen"
my_string .null "HELLO WORLD!"
.enc "none"
* = $9fff ; fill up to 8k or cartconv will fail
.byte 0