View Full Version : write instructions

02-10-2007, 02:08 PM
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?

Mike Green
02-10-2007, 02:13 PM
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.