Shop OBEX P1 Docs P2 Docs Learn Events
Assembler Questions CMP and WZ — Parallax Forums

Assembler Questions CMP and WZ

Christof Eb.Christof Eb. Posts: 1,161
edited 2008-02-04 11:05 in Propeller 1
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

Comments

Sign In or Register to comment.