SPLat Logo

Index register instructions

NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

Index register instructions

The index register allows you to select inputs, outputs, RAM and NVEM dynamically. This is especially useful if you are writing a program that will work identically on several "channels", say if you are making a 4-channel timer or lighting controller.

From December 2005 (dialect 16) the index register I is supplemented by the J register. J is available inside MultiTrack tasks and makes programming of multichannel functions incredibly easy. Addressing via J is call jndexing.

This section contains instructions that can reference the index register I. Some of the instructions directly manipulate I. Others use the index register as an offset on the I/O, RAM or NVEM address in the instruction. When you are using the index register as an offset, you must add the letter 'i' in front of the instruction key word to get this indexed mode. For example, Recall becomes iRecall. Before being added to the base address I is multiplied by a constant. That constant is derived from the type of memory access. For example, in floating point instructions ifStore, ifRecallW and ifRecallQ, the index register is multiplied by 4, so it can be used to index into an array. For simple byte access instructions like iRecall it is multiplied by 1.

From dialect 16 every memory reference and I/O instruction can be indexed using the IasJ: precode.

In indexed semaphore instructions, the index register is added to the base address argument (not the bit number). With jndexed addressing (using J) it is the opposite: the bit number gets offset.

Those instructions that allow indexing have an asterisk in their topic title. The asterisk is placed after the instruction argument that gets indexed.

Those instructions that allow jndexing from dialect 16 have a plus sign in their topic title. The plus sign is placed after the instruction argument that gets jndexed.

From dialect 23 some instructions use automatic indexing.

When the instruction is executed the index register is automatically incremented.See the relevant instruction description to find the amount the index register is incremented by.

Automatic indexing instructions have a hash in their topic title. The hash is placed after the instruction argument that gets indexed.