From 3b1037236f85b3d6fb4ad66fba80b5f6a6953de6 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Mon, 1 Aug 2022 10:30:55 +1200 Subject: [PATCH] vault backup: 2022-08-01 10:30:55 --- content/notes/6809.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/notes/6809.md b/content/notes/6809.md index 0e099a459..d9917defb 100644 --- a/content/notes/6809.md +++ b/content/notes/6809.md @@ -54,7 +54,7 @@ message: .byte "HELLO WORLD", 0 START: - ldy #message ; load + ldy #message ; load "message", into the y register bsr puts ; branch to the "puts" subroutine 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 ldx #screen ; start of screen ; load the hex value of the memory location of the screen ($0400) into the x register more: - lda 0,y+ ; current char -> A ; load - cmpa #$00 ; was it a zero? - beq done ; if it was 0 then return - sta 0,x+ ; write - bra more ; repeat + 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? ; if the character loaded into A was a zero set the equal flag + beq done ; if it was 0 then return ; if the equal flag is set, branch to the "done" subroutine + 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 ; branch to the "more" subroutine as there are more character to write done: - puls a,x,y ; restore a, x, y - rts ; return from this routine + 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 ``` # Hello World