Assembler Questions CMP and WZ
Christof Eb.
Posts: 1,225
Hi specialistes,
still I am wondering, why some code did not work.
The idea was, that some code should be done, if a changement at a triggerline occurs.
mov intrig, ina ' changement in trigger level?
and intrig, trigmask ' only one bit in trigmask is set
cmp intrig, oldtrig wz
mov oldtrig, intrig ' rescue trigger level
if_nz jmp #notrig
trigger
.....
notrig
....
Questions:
1. Is it true, that a zero flag is stored and not changed until the next ... WZ ?
2. Is it true, that cmp will set the zero flag, only if "intrig" and "oldtrig" are the same? (I had the impression, that it seemed to give zero, if one of the operands was zero?)
3. Is it true, that the cmp will not change intrig?
Thanks for some input!
Christof
still I am wondering, why some code did not work.
The idea was, that some code should be done, if a changement at a triggerline occurs.
mov intrig, ina ' changement in trigger level?
and intrig, trigmask ' only one bit in trigmask is set
cmp intrig, oldtrig wz
mov oldtrig, intrig ' rescue trigger level
if_nz jmp #notrig
trigger
.....
notrig
....
Questions:
1. Is it true, that a zero flag is stored and not changed until the next ... WZ ?
2. Is it true, that cmp will set the zero flag, only if "intrig" and "oldtrig" are the same? (I had the impression, that it seemed to give zero, if one of the operands was zero?)
3. Is it true, that the cmp will not change intrig?
Thanks for some input!
Christof
Comments
Hoewever I wonder why you call the label NOTRIG where it jumps to when a trigger condition (NZ) is detected??
http://forums.parallax.com/showpost.php?p=0
Andy
yes, I will try your debugger. An hope then to be less blind....
Christof