2019-05-30 15:55:53 +00:00
|
|
|
// Tests subtracting bytes from signed words
|
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
|
|
|
main: {
|
|
|
|
.label screen = $400
|
|
|
|
.label w1 = 2
|
|
|
|
ldx #0
|
|
|
|
lda #<$4d2
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z w1
|
2019-05-30 15:55:53 +00:00
|
|
|
lda #>$4d2
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z w1+1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-08-07 19:00:19 +00:00
|
|
|
lda.z w1
|
2019-05-30 15:55:53 +00:00
|
|
|
sec
|
|
|
|
sbc #$29
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z w1
|
|
|
|
lda.z w1+1
|
2019-05-30 15:55:53 +00:00
|
|
|
sbc #>$29
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z w1+1
|
2019-05-30 15:55:53 +00:00
|
|
|
txa
|
|
|
|
asl
|
|
|
|
tay
|
2019-08-07 19:00:19 +00:00
|
|
|
lda.z w1
|
2019-05-30 15:55:53 +00:00
|
|
|
sta screen,y
|
2019-08-07 19:00:19 +00:00
|
|
|
lda.z w1+1
|
2019-05-30 15:55:53 +00:00
|
|
|
sta screen+1,y
|
|
|
|
inx
|
|
|
|
cpx #$b
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b1
|
2019-05-30 15:55:53 +00:00
|
|
|
rts
|
|
|
|
}
|