1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00
kickc/src/test/ref/noop-cast-elimination.asm

40 lines
545 B
NASM
Raw Normal View History

2019-05-30 15:55:53 +00:00
// Test elimination of noop-casts (signed byte to byte)
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
main: {
.label screen = $400
.label sw = 2
lda #<$1234
sta.z sw
2019-05-30 15:55:53 +00:00
lda #>$1234
sta.z sw+1
2019-05-30 15:55:53 +00:00
ldx #0
__b1:
2019-05-30 15:55:53 +00:00
txa
sta.z $fe
2019-05-30 15:55:53 +00:00
ora #$7f
bmi !+
lda #0
!:
sta.z $ff
2019-05-30 15:55:53 +00:00
clc
lda.z sw
adc.z $fe
sta.z sw
lda.z sw+1
adc.z $ff
sta.z sw+1
2019-05-30 15:55:53 +00:00
txa
asl
tay
lda.z sw
2019-05-30 15:55:53 +00:00
sta screen,y
lda.z sw+1
2019-05-30 15:55:53 +00:00
sta screen+1,y
inx
cpx #$b
bne __b1
2019-05-30 15:55:53 +00:00
rts
}