undar-lang/test/if-hardcoded.tal

28 lines
600 B
Tal

|100
LIT2r 0000 main POP2r BRK
@const_str_0 78 20 69 73 20 31 30 00
@const_str_1 78 20 69 73 20 32 30 00
@const_str_2 78 20 69 73 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c 73 65 00
@main ( -- )
OVR2r LIT2r 0002 SUB2r
#0014 STH2kr STA2
STH2kr LDA2 #000a EQU2 #03 JCN !{ ;const_str_0 str/<println> !&if_end.0 }
STH2kr LDA2 #0014 EQU2 #03 JCN !{ ;const_str_1 str/<println> !&if_end.0 }
;const_str_2 str/<println>
&if_end.0
&return
POP2r JMP2r
@str/<print> ( str* -- )
LDAk DUP ?{ POP POP2 JMP2r }
#18 DEO
INC2 !/<print>
@str/<println> ( str* -- )
str/<print> #0a #18 DEO