English
Language : 

GMS30C2116 Datasheet, PDF (90/322 Pages) Hynix Semiconductor – USERS MANUAL
3-26
CHAPTER 3
3.17 Index Move Instructions
The source operand is placed shifted left by 0, 1, 2 or 3 bit positions in the destination
register, corresponding to a multiplication by 1, 2, 4 or 8. At XM1..XM4, a trap to Range
Error occurs if the source operand is higher than the immediate operand lim (upper bound).
All condition flags remain unchanged. All operands and the result are interpreted as
unsigned integers.
The SR must not be denoted as a source or as a destination, nor the PC as a destination
operand; these notations are reserved for future expansion. When the PC is denoted as a
source operand, a trap to Range Error occurs if PC ≥ lim.
X-code Format Notation
Operation
0 RRlim
XM1 Rd, Rs, lim
Rd := Rs ∗ 1;
if Rs > lim then
trap ⇒ Range Error;
1 RRlim
XM2 Rd, Rs, lim
Rd := Rs ∗ 2;
if Rs > lim then
trap ⇒ Range Error;
2 RRlim
XM4 Rd, Rs, lim
Rd := Rs ∗ 4;
if Rs > lim then
trap ⇒ Range Error;
3 RRlim
XM8 Rd, Rs, lim
Rd := Rs ∗ 8;
if Rs > lim then
trap ⇒ Range Error;
4 RRlim
XX1 Rd, Rs, 0
Rd := Rs ∗ 1; -- Move without flag change
5 RRlim
XX2 Rd, Rs, 0
Rd := Rs ∗ 2;
6 RRlim
XX4 Rd, Rs, 0
Rd := Rs ∗ 4;
7 RRlim
XX8 Rd, Rs, 0
Rd := Rs ∗ 8;
Note: The Index Move instructions move an index value scaled (multiplied by 1, 2, 4 or 8).
XM1..XM4 check also the unscaled value for an upper bound, optionally also excluding
zero. If the lower bound is not zero or one, it may be mapped to zero by subtracting it from
the index value before applying an Index Move instruction.
Register
L0 : $456
L1 : $123
Instruction
XM2
XM2
XX2
L0, L1, 124
L0, L1, 122
L0, L1, 0
; L0 = $246
; Integer Range Error in Task at Address XXXXXXXX
; L0 = $246