Track tests

This commit is contained in:
n loewen 2023-08-01 15:51:59 +01:00
parent c06b59d057
commit 29b6097585
3 changed files with 44 additions and 0 deletions

11
test-programs/chp.asm Normal file
View File

@ -0,0 +1,11 @@
;; test CHP instruction
ADD 8 ; Acc = 8
CHP 0 ; shouldn't hop (CF = 0)
ADD 1 ; Acc = 9
ADD 8 ; Acc = 1 and CF = 1
CHP 0 ; hop! (CF = 1)
END
SUB 1 ; Acc = 0
CFC 0 ; CF = 0
END

View File

@ -0,0 +1,23 @@
;; Fill display with $FF
LDA $00
STO $21 ; Pixel index
; store the $FF that we'll use to fill the screen
LDA $FF
STO $22
@copy-to-display
LDA ($22) ; A = mem[$22] = $FF
STO ($21) ; mem[mem[$21]] = A = $FF
; increment pixel index
LDA ($21)
ADD $01
STO $21
; if CF is set, then the display is full and we're done
CHP
JMP @copy-to-display
END

View File

@ -0,0 +1,10 @@
;; test jumping to a label
ADD 15
ADD 10 ; should set CF
JMP @end
ADD 1
ADD 2
ADD 3
@end
END