another assembly question
Owen
Posts: 100
I'm having trouble executing code in assembly based on whether a variable is less than 0. can anyone explain to me
how this be written in assembly:
if variable < 0
execute code
sorry if this is too basic but I wasn't able to understand how to do this from the manual.
Thanks,
Owen
how this be written in assembly:
if variable < 0
execute code
sorry if this is too basic but I wasn't able to understand how to do this from the manual.
Thanks,
Owen
Comments
cmp t2,t3 wc
if_c jmp #os
' rest of code (negative part) goes here
os ' code for positive result
The trick, as I have understood it, is to remember to write the right flag - and then check it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Anyhow, you got it from Mike. Trust him.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔