|
|
|
|
|
by lscharen
1463 days ago
|
|
For more 16-bit 65816 context -- other than for space-savings, these instructions are never used when performance is needed due to the low effective throughput of 7 cycles per byte. A basic unrolled loop using 16-bit instructions is 20 - 30% faster and specialized graphics routines that are able to use the stack can approach 3 cycles per byte using the PEA and PEI instructions. |
|
One neat trick (I remember reading about from Alan Cox I believe) if you have control over the hardware is to memory map I/O devices like serial input / output such that incrementing addresses starting at a given address all point to the same physical device/register. E.g. allocate 256 contiguous bytes in your memory map to point to the same thing. This way you can do bulk I/O transfers to/from memory using MVP/MVN instead of "get a byte, put a byte" instruction by instruction.