There must be a better way. Please redeem my soul.
tword_t registers[13] = {0};
tword_t *R1 = registers;
tword_t *R2 = registers + 1;
tword_t *R3 = registers + 2;
tword_t *R4 = registers + 3;
tword_t *R5 = registers + 4;
tword_t *R6 = registers + 5;
tword_t *R7 = registers + 6;
tword_t *R8 = registers + 7;
tword_t *R9 = registers + 8;
tword_t *R10 = registers + 9;
tword_t *R11 = registers + 10;
tword_t *R12 = registers + 11;
tword_t *R13 = registers + 12;
My small dum-dum bad no good brain can’t come up with anything better than a for/while loop and that’s obviously useless here.
I need them to be sequential, hence the array to force the addresses and pointers instead of regular old values – I know that
tword_t R1 = 0;
tword_t R2 = 0;
...
would most likely give them neighbouring addresses, but I’d rather not leave it to chance and the compiler’s whims.
Also just in case someone points this out: yes, those +1, +2… are OK, the compiler multiplies it by the type’s size. I found out when I tried to do +8, +16… and it didn’t work.
7