CMP is PASM question
jmspaggi
Posts: 629
Hi,
I'm trying to compare a value with 2. So I'm goind:
My problem is that whatever Temp value is, it's always jumping.
First loop, Temp value is 3, so it's correct. 2nd loop, it's 2, and
3rd loop it's 1. But it's always jumping. I think I'm doing something
wrong with the way I'm using CMP. Can someone please correct me?
Thanks,
JM
I'm trying to compare a value with 2. So I'm goind:
rdbyte Temp, TopAddr cmp Temp, #2 IF_A jmp #Above
My problem is that whatever Temp value is, it's always jumping.
First loop, Temp value is 3, so it's correct. 2nd loop, it's 2, and
3rd loop it's 1. But it's always jumping. I think I'm doing something
wrong with the way I'm using CMP. Can someone please correct me?
Thanks,
JM
Comments
For a conditional to work correctly, the instruction that might set the condition must specify the wc and/or wz effect.
Presumably, niether Carry nor Zero flags have been set and that causes if_a to execute. if_a is same as if_nc_and_nz.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
Thanks all for your prompt replies!
There is still some reflex I need to develop [noparse];)[/noparse]
I will continue to debug to find my other issues.
JM