TCPU/examples/conditional_jump.tasm

33 lines
350 B
TASM

/*
Example of behavior change depending on some condition
*/
.main:
movc ax 1
movc bx 2
gt ax bx
jnz @true
jz @false
.true:
const8 true.msg "true\n"
movc rbx @true.msg
movc ecx #true.msg
jmp @print
.false
const8 false.msg "false\n"
movc rbx @false.msg
movc ecx #false.msg
jmp @print
.print:
movc al 1
movc ah 1
sys
jmp @end
.end:
movc ax 0
exit