User Tools

Site Tools


base:print_stringchain

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

base:print_stringchain [2017-08-10 17:34] (current)
abujok created
Line 1: Line 1:
 +====== Print Stringchain ======
 +
 +Prints a stored textchain on a C64 (like $AB1E).
 +
 +<​code>​
 +
 +BSOUT  = $ffd2 ; print value in accu on screen
 +
 +TXTOUT_LB = $22 ; pointer for text lb address (unused memory on zeropage)
 +TXTOUT_HB = $23 ; pointer for text hb address (unused memory on zeropage)
 +
 +
 +        LDA #<txt2 ; HB address of text
 + sta TXTOUT_HB ; store on HB Text pointer
 + LDY #>txt2 ; LB address of text
 + sta TXTOUT_LB ; store on HB Text pointer
 + jsr TXTOUT ​     ; print 'HELLO WORLD.'​
 +        rts             ; bye
 +
 +
 +;​**************************
 +
 +;​**************************
 +TXTOUT ldy #$00        ; set index to zero
 +t0 lda (TXTOUT_LB),​y ; get char
 + beq end ; Text end?
 + jsr BSOUT ; print char
 + iny ; index next char
 + jmp t0 ; loop
 +end rts ; bye
 +
 +
 +txt0 byte "HELLO WORLD.",​$0d,​0
 +
 +</​code>​
  
base/print_stringchain.txt ยท Last modified: 2017-08-10 17:34 by abujok