Are the I and J registers special in DCPU-16?

2k Views Asked by At

DCPU-16 includes 8 general registers named A, B, C, X, Y, Z, I and J. It's a bit of a programmer "trope" to use I and J for loop counters. In DCPU-16, are I and J specialized registers, that should only be used in loops - or do they all end up the same colour in the end?

2

There are 2 best solutions below

1
On BEST ANSWER

Everything points out to the DCPU-16's eight main registers being "general purpose": while they are 'intended' for a certain use, programmers can use them as they will. The x86 has a similar architecture for its general registers.

The only special purpose registers on DCPU-16 are SP, PC and O.

Edit: The DCPU 1.3 specification introduces a single instruction (MVI) that adds 1 to both I and J after executing, with the intention of being used as a fast memory copy. Notch has expressed disliking this, so it might be eventually dropped, but now I and J are a bit special.

0
On

I'm sure conventions will emerge but the instruction set is completely orthogonal with respect to the registers A, B, C, X, Y, Z, I and J so there is no difference between them inherent in the DCPU-16.