You just need a register with a known value. I find it common to have a constant zero register (for WRxxxx), but it works with any constant register you already have, you just need to change between MUXC and MUXNC depending on the LSB and overall parity.
MUXNC zero, #1 nr,wz ' invert C flag
...
zero long 0
(I want to say there's a smarter way that I'm forgetting...)
I have a constant called IncDest (value 512) that is used frequently - needles to say why... It happens to have the LSB = 0. So this did the trick (your "wz" must have been a typo):
MUXNC IncDest, #1 nr,wc
Thanks a lot for your idea, works as charm! This is a good trick up the sleeve, should be added to the propeller 1 tricks and traps !
Comments
You just need a register with a known value. I find it common to have a constant zero register (for WRxxxx), but it works with any constant register you already have, you just need to change between MUXC and MUXNC depending on the LSB and overall parity.
(I want to say there's a smarter way that I'm forgetting...)
Thank you Wuerfel,
I have a constant called IncDest (value 512) that is used frequently - needles to say why...
It happens to have the LSB = 0. So this did the trick (your "wz" must have been a typo):
MUXNC IncDest, #1 nr,wc
Thanks a lot for your idea, works as charm! This is a good trick up the sleeve, should be added to the propeller 1 tricks and traps !
Cheers,
Christian