Shop OBEX P1 Docs P2 Docs Learn Events
write instructions — Parallax Forums

write instructions

lostcauzlostcauz Posts: 36
edited 2007-02-10 07:13 in Propeller 1
I've finally found the time to start playing with this chip and I'm really excited about it. After reviewing the assembler instructions I keep confusing myself with the write instructions. They seem backward compared to all the other instructions. Everything else appears to be 'normal' for me as (instruction-destination,source) but the writes are writing the destination to the source?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-10 07:13
    Yes, they do seem backwards. It's an artifact of the relationship between a cog and main (hub) memory. It's like an I/O instruction in other computers. The "source" operand always contains the "I/O address" and the "destination" field always contains the address in the processor's (cog's) memory used for the "I/O" operation. In this case, the I/O controller is the Hub and the I/O device is the Hub (main) memory.

    The other thing is that, if the Hub address is in the source field, you can use the immediate operand mode to access the first 512 bytes of Hub memory more easily for both reading and writing.
Sign In or Register to comment.