outa, outb etc. safe to use as registers?
pullmoll
Posts: 817
Is it safe to use outa[noparse][[/noparse]31..0], outb[noparse][[/noparse]31..0], ctra[noparse][[/noparse]8..0], ctrb[noparse][[/noparse]8..0], frqa[noparse][[/noparse]31..0], frqb[noparse][[/noparse]31..0], phsa[noparse][[/noparse]31..0], phsb[noparse][[/noparse]31..0], vscl[noparse][[/noparse]31..0] as storage for registers when a cog does not use I/O (i.e. dira/dirb remain 0) and no timers or video? I tried it and it seems to work, while I don't know if this may have unwanted side effects.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Comments
I'll be interested to see what the knowledgable folks say about this.
-Phil
You can even use INA as a shadow register for some special purposes. You can use it as destination register. For example:
mov ina, ina
and ina, #$ff
wrbyte ina, pos_in_hub
PS: I should move to a timezone where everybody is sleeping when I answer posts here ;o))
That's why I wrote ctra[noparse][[/noparse]8..0] and ctrb[noparse][[/noparse]8..0]. I'm using these two to keep values that don't reach into the counter mode bits 30..26, but just the APIN and the unused bits 8..6.
What I wanted to know was if doing this, and writing the FRQx and PHSx registers does anything if the counters are off?
I'm really out of cog space this time as you probably guessed
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 4/9/2010 3:49:43 PM GMT
-Phil
Actually write the state of pin 0-7 into hub memory ?
Or will ina in the dest position use the ina shadow register and not the actual state of the pins ?
Bean