[resolved] PHSx read-modify-write
kuroneko
Posts: 3,623
From that I gatherThe Propeller Manual said...
Note that in Propeller Assembly, the PHSA and PHSB registers cannot be used in a read-modify-write operation in the destination field of an instruction. Instead, separate read, modify, and write operations (instructions) must be performed.
mov phsa, #8 mov reg, phsa ' read add reg, #4 ' modify mov phsa, reg ' write wrlong phsa, somewhere
is the way to go, phsa will be 12. So far so good. However ...
mov phsa, #8 add phsa, #4 ' read-modify-write wrlong phsa, somewhere
gives me the very same result (12).
So where does the cannot be used bit come into it? Does it only apply when used concurrently with an active counter? I'm using the wrong example in active code and it works so I'm slightly confused.
Any help is appreciated.
Post Edited (kuroneko) : 6/4/2009 1:02:26 PM GMT
Comments
So, if you have the mov PHSA, #8 and then a lot of counts in between and then do the add PHSA, #4 it will still be 12.
Currently I'm trying to find an explanation as well - not knowing it for sure.
http://forums.parallax.com/showthread.php?p=742749
There was another thread too, I'll see if I can find it
tubular