1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-16 21:07:56 +00:00
kickc/src/test/ref/ternary-1.asm
jespergravgaard 1836a9bd92 Finally eliminated copy visitor!
Refactored CallPhiParameters to modify the current control flow graph.
2020-03-07 22:38:40 +01:00

27 lines
385 B
NASM

// Tests the ternary operator
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
main: {
.label SCREEN = $400
ldx #0
__b1:
// i<5?'a':'b'
cpx #5
bcc __b2
lda #'b'
jmp __b3
__b2:
// i<5?'a':'b'
lda #'a'
__b3:
// SCREEN[i] = i<5?'a':'b'
sta SCREEN,x
// for( byte i: 0..9)
inx
cpx #$a
bne __b1
// }
rts
}