Code: Select all
_LCD_strout:
ldy #0
LCD_strout_nextchar:
lda (R0),y
beq LCD_strout_return
jsr _LCD_chrout ; sends the character in .A to the LCD
iny
jmp LCD_strout_nextchar
LCD_strout_return:
rts
Code: Select all
R0 = $80
R0L = $80
R0H = $81
.org $8000
message: .asciiz "Hello, world"
Code: Select all
lda #<message
sta R0L
lda #>message
sta R0H
jsr _LCD_strout
So I'd like to do something like this:
Code: Select all
STACK = $0
STACKL = $0
STACKH = $1
reset:
ldx #$FF
txs ; Hardware stack -> $01FF
dex ; Data stack -> $00FE
; (later on)
lda #<message
sta STACKL,x
lda #>message
sta STACKH,x
dex
dex
jsr _LCD_strout
Code: Select all
_LCD_strout: ; Stack version
ldy #0
inx
inx
LCD_strout_nextchar:
lda (STACK,x),y ; what really goes here?
beq LCD_strout_return
jsr _LCD_chrout ; sends the character in .A to the LCD
iny
jmp LCD_strout_nextchar
LCD_strout_return:
rts