mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
vault backup: 2022-07-28 11:24:22
This commit is contained in:
parent
d4dc73583b
commit
052534e53d
@ -64,3 +64,54 @@ beq somewhere
|
|||||||
|
|
||||||
## 6809.uk text screen
|
## 6809.uk text screen
|
||||||

|

|
||||||
|
|
||||||
|
write h to top left
|
||||||
|
```
|
||||||
|
lda #'H'
|
||||||
|
sta $0400
|
||||||
|
```
|
||||||
|
|
||||||
|
add an 'e' beside that
|
||||||
|
```
|
||||||
|
lda #'E'
|
||||||
|
sta $0401
|
||||||
|
```
|
||||||
|
|
||||||
|
## print routine
|
||||||
|

|
||||||
|
|
||||||
|
- pass the address of the string in Y
|
||||||
|
- "address" - the index into the memory array the hold the first character of the string
|
||||||
|
- use $00 to end the string
|
||||||
|
|
||||||
|
## algorithm
|
||||||
|
- print a string
|
||||||
|
- Load a character from memory\[Y]
|
||||||
|
- Move on to the next character (Y++)
|
||||||
|
- Compare the character to $00 If equal exit this routine
|
||||||
|
- Write the character to the screen
|
||||||
|
- Move on to the next screen location
|
||||||
|
- GOTO start
|
||||||
|
|
||||||
|
PUTS()
|
||||||
|
|
||||||
|
```
|
||||||
|
;
|
||||||
|
;
|
||||||
|
Routine: PUTS
|
||||||
|
; Pass the address of the string in Y
|
||||||
|
;
|
||||||
|
PUTS:
|
||||||
|
ldx #$0400 ; start of screen
|
||||||
|
more:
|
||||||
|
lda 0,y ; current char -> A (load y into a)
|
||||||
|
leay 1,y ; increment y
|
||||||
|
cmpa #$00 ; was it a zero?
|
||||||
|
beq done ; if it was 0 then return
|
||||||
|
sta 0,x ; write (store a in x)
|
||||||
|
leax 1,x ; increment x
|
||||||
|
bra more ; repeat
|
||||||
|
done:
|
||||||
|
rts ; return from this routine
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user