3.1.2 Register Direct Addressing

Register Direct Addressing is used to access the contents of the 16 Working registers (W0:W15). The Register Direct Addressing mode is fully orthogonal, which allows any Working register to be specified for any instruction that uses Register Direct Addressing, and it supports byte, word, and long word accesses. Instructions which employ Register Direct Addressing use the contents of the specified Working register as data to execute the instruction; therefore, this addressing mode is useful only when data already resides in the Working register core. Sample instructions which utilize Register Direct Addressing are shown in Register Direct Addressing.

Another feature of Register Direct Addressing is that it provides the ability for dynamic flow control. Since variants of the REPEAT instruction support Register Direct Addressing, flexible looping constructs may be generated using these instructions.

Note: Instructions that must use Register Direct Addressing use the symbols Wb, Wn, Wns and Wnd in the summary tables of Instruction Set Overview. Commonly, Register Direct Addressing may also be used when Register Indirect Addressing may be used. Instructions that use Register Indirect Addressing use the symbols Wd and Ws in the summary tables of Instruction Set Overview.

Register Direct Addressing

EXCH		W2, W3			; Exchange W2 and W3

Before Instruction:

W2 = 0x00003499
W3 = 0x0000003D

After Instruction:

W2 = 0x0000003D
W3 = 0x00003499
IOR.l		#0x44, W0		; Inclusive-OR 0x44 and W0

Before Instruction:

W0 = 0x12349C2E

After Instruction:

W0 = 0x12349C6E
SL		W6, W7, W8	   ; Shift left W6 by W7, and store to W8

Before Instruction:

W6 = 0x0000000C
W7 = 0x00000008
W8 = 0x12345678

After Instruction:

W6 = 0x0000000C
W7 = 0x00000008
W8 = 0x00000C00