From ee1e8991084cbc29fe3cc606f6157b563f6d6459 Mon Sep 17 00:00:00 2001 From: n loewen Date: Wed, 23 Aug 2023 21:22:16 +0100 Subject: [PATCH] (tests) fill-display - Fix typo / Change constant names to increase clarity and make it easier to update if the flag IDs change again --- test-programs/fill-display.asm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test-programs/fill-display.asm b/test-programs/fill-display.asm index 316eeee..1c28218 100644 --- a/test-programs/fill-display.asm +++ b/test-programs/fill-display.asm @@ -1,25 +1,26 @@ ;; Fill display with $FF ; updated for 5x5 display -#*px $24 -#fill $25 +#Zero 1 +#px_ptr $F0 +#fill $F1 ; Initialize variables... LDA $00 ; (Address for the first px on the display) -STO .*px ; Pointer to current px +STO #px_ptr ; Pointer to current px LDA $FF ; ($FF is 'on', $00 is 'off') STO #fill ; Stash value to fill with @paint LDA (#fill) ; (A = mem[fill] = $FF) - STO (#*px) ; Paint pixel (mem[mem[*px]] = A = $FF) + STO (#px_ptr); Paint pixel (mem[mem[*px]] = A = $FF) -LDA (#*px) ; Increment pixel pointer... +LDA (#px_ptr) ; Increment pixel pointer... ADD $01 -STO #*px +STO #px_ptr -LDA (#*px) ; Test whether to loop or not... +LDA (#px_ptr) ; Test whether to loop or not... SUB $19 ; if *px - $19 == 0, we've reached the end -FHP 2 ; (Zero flag is #2) +FHP #Zero JMP @paint END \ No newline at end of file