mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-26 22:34:06 -06:00
vault backup: 2022-08-01 10:30:55
This commit is contained in:
parent
40faca8a96
commit
3b1037236f
@ -54,7 +54,7 @@ message:
|
|||||||
.byte "HELLO WORLD", 0
|
.byte "HELLO WORLD", 0
|
||||||
|
|
||||||
START:
|
START:
|
||||||
ldy #message ; load
|
ldy #message ; load "message", into the y register
|
||||||
bsr puts ; branch to the "puts" subroutine
|
bsr puts ; branch to the "puts" subroutine
|
||||||
rts ; return
|
rts ; return
|
||||||
|
|
||||||
@ -67,14 +67,14 @@ PUTS:
|
|||||||
pshs a,x,y ; save a, x, and y ; store the contents of the a, x, and y registers so they are not overwritten
|
pshs a,x,y ; save a, x, and y ; store the contents of the a, x, and y registers so they are not overwritten
|
||||||
ldx #screen ; start of screen ; load the hex value of the memory location of the screen ($0400) into the x register
|
ldx #screen ; start of screen ; load the hex value of the memory location of the screen ($0400) into the x register
|
||||||
more:
|
more:
|
||||||
lda 0,y+ ; current char -> A ; load
|
lda 0,y+ ; current char -> A ; load the contents of the Y register into the A register and increment Y by one
|
||||||
cmpa #$00 ; was it a zero?
|
cmpa #$00 ; was it a zero? ; if the character loaded into A was a zero set the equal flag
|
||||||
beq done ; if it was 0 then return
|
beq done ; if it was 0 then return ; if the equal flag is set, branch to the "done" subroutine
|
||||||
sta 0,x+ ; write
|
sta 0,x+ ; write ; otherwise, store the contents of the A register into memory at the location (hex value) defined in the X register, and increment the hex value stored in the X register
|
||||||
bra more ; repeat
|
bra more ; repeat ; branch to the "more" subroutine as there are more character to write
|
||||||
done:
|
done:
|
||||||
puls a,x,y ; restore a, x, y
|
puls a,x,y ; restore a, x, y ; re load the stored values of the a, x, and y registers that were saved earlier
|
||||||
rts ; return from this routine
|
rts ; return from this routine
|
||||||
```
|
```
|
||||||
|
|
||||||
# Hello World
|
# Hello World
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user