add some comments for jimmy <3

This commit is contained in:
2019-04-04 18:00:32 +11:00
parent 1d53530544
commit f92b2a52a8

View File

@@ -4,18 +4,18 @@
sei ; no interrupts pls sei ; no interrupts pls
ldx #$00 ; Screen colours ldx #$00 ; screen colours
stx bdcol stx bdcol
ldx #$08 ldx #$08
stx bgcol stx bgcol
jsr $e544 ; clear screen jsr $e544 ; clear screen
lda #> message ; print message lda #> message ; push the location of the text
pha pha ; to display onto the stack
lda #< message lda #< message
pha pha
jsr print_string jsr print_string ; call the actual print subroutine
pla pla
pla pla
@@ -27,7 +27,7 @@
;stx ch1_ctl ;stx ch1_ctl
.loop .loop
inc bdcol inc bdcol ; flashing gobbledygook garbage (scat)
lda inputb ; Scans the keyboard buffer lda inputb ; Scans the keyboard buffer
cmp #$EF ; If user presses Space ($ef) then quit cmp #$EF ; If user presses Space ($ef) then quit
@@ -39,18 +39,20 @@
rts rts
print_string: print_string:
tsx tsx ; load the stack pointer
inx ; traverse upwards to our arguments
inx inx
inx inx
inx lda stack, x ; copy the arguments on the stack
lda stack, x sta PSL + 1 ; on top of the instruction that
sta PSL + 1 inx ; needs to point to the text
inx
lda stack, x lda stack, x
sta PSL + 2 sta PSL + 2
ldx #$00 ldx #$00
PSL lda message, x
PSL lda $0000, x ; this instruction's operand is
; modified by the code above
cmp #$0 ; return on null terminator cmp #$0 ; return on null terminator
beq + beq +
sta screen + rowlen, x sta screen + rowlen, x