Assembly If/Else statement
Hello,
I was trying to think of how to do an If/Then statement in assembly and came up with the seemingly crude way of doing it. Although it does work fine, I wanted to know if there is a better way.
Any thoughts?
Thanks,
Marcus
I was trying to think of how to do an If/Then statement in assembly and came up with the seemingly crude way of doing it. Although it does work fine, I wanted to know if there is a better way.
mov t0, mode
shr t0, #1 wc ' If Mode & $01 == $01
if_nc jmp #skip
shl tPat, #1 wc ' Then shift tPat right 1,
if_nc xor outa, pinMask ' and Toggle Output if tPat & $01 == zero.
skip ' Else do nothing.
Any thoughts?
Thanks,
Marcus

Comments
test mode, #1 wz if_nz shl tPat, #1 wc if_a xor outa, pinMaskAh ha, I though the test instruction might be needed somewhere. And I'm still wrapping my head around all the if_x conditions. That worked perfectly.
Thanks!
-Marcus