[Coco] Mod10 Suggestions

Glen Hewlett glen.hewlett at sympatico.ca
Sat Feb 18 07:51:37 EST 2017


Hi William,

The tip about Y taking more space and cycles is a great one.  I had always thought the registers were all the same and I always preferred using X & Y.  It will be X,U and Y in that order from now on when I program.

Cheers,
Glen

> On Feb 18, 2017, at 12:52 AM, William Astle <lost at l-w.ca> wrote:


In case you're wondering, the typical priority order for using the index registers is:

X
U
Y

Don't let the "user stack pointer" name for "U" make you think you shouldn't use U as an index register. There is nothing magical about U that will cause it to suddenly be used as a stack without your direct intervention as the programmer.

The reason for the listed ordering is as follows. All operations on X have a single byte opcode. LEAU, LDU and STU have single byte opcodes. All operations on Y except LEAY have double byte opcodes. There is no difference in size or speed when using any of the four pointer registers (S is also a pointer register) in an indexed operand.


More information about the Coco mailing list