<< Previous | Next >>

LD pd,ps+IY     Load     Rabbit 4000/5000 Instruction

Opcode
Instruction
Operation
-- LD pd,ps+IY pd = ps + IY
6D 05 LD PW,PW+IY PW = PW + IY
6D 15 LD PW,PX+IY PW = PX + IY
6D 25 LD PW,PY+IY PW = PY + IY
6D 35 LD PW,PZ+IY PW = PZ + IY
6D 45 LD PX,PW+IY PX = PW + IY
6D 55 LD PX,PX+IY PX = PX + IY
6D 65 LD PX,PY+IY PX = PY + IY
6D 75 LD PX,PZ+IY PX = PZ + IY
6D 85 LD PY,PW+IY PY = PW + IY
6D 95 LD PY,PX+IY PY = PX + IY
6D A5 LD PY,PY+IY PY = PY + IY
6D B5 LD PY,PZ+IY PY = PZ + IY
6D C5 LD PZ,PW+IY PZ = PW + IX
6D D5 LD PZ,PX+IY PZ = PX + IX
6D E5 LD PZ,PY+IY PZ = PY + IX
6D F5 LD PZ,PZ+IY PZ = PZ + IX

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 4000
4
n/a
n/a
Rabbit 5000
4
4
2

Flags ALTD IOI/IOE
S
Z
L/V
C
F
R
SP
S
D
-
-
-
-
·

Description

Loads pd (any of the 32-bit registers PW, PX, PY or PZ) with the sum of ps (any of PW, PX, PY or PZ) and IY. These instructions cannot be used for general 32-bit arithmetic because the addition depends on the upper two bytes of ps. If the upper two bytes are all ones, then it is 16-bit addition. The following example illustrates this point:


ld PW,0xFFFFFFFF
ld PW,PW+IY            ;yields PW=0xFFFF0000 if IY=1

ld PW,0x7FFFFFFF
ld PW,PW+IY            ;yields PW=0x80000000 if IY=1

Rabbit Instructions << Previous | Next >> rabbit.com