358
Rabbit 5000 Microprocessor User’s Manual
30.3.5 System/User Mode Instructions
Seven instructions exist primarily to support the System/User Mode, and are listed in
Table 30-3. Note that
IDET
shares the value of
LD E,E
in the opcode table, and will
always perform that operation (but will have special behavior when the System/User
Mode is enabled and the processor is in System Mode). In addition, if the ALTD prefix
appears before the instruction,
LD E’,E
is always executed and the special behavior does
not occur.
The processor keeps a one-byte stack (called the SU register) that is analogous to the IP
register that keeps track of the interrupt priority. Every time
SETUSR
is executed (to enter
the User Mode), or an interrupt occurs, or
SYSCALL
or
RST
is executed (to enter System
Mode), the current mode is pushed onto the SU register. When a
SURES
is executed, the
previous mode is popped off the SU register.
Table 30-3. System/User Mode Instructions
Instruction
Bytes
clk A I S Z V C
Operation
Priv
SETUSR
2
4
-
-
-
-
- SU = {SU[5:0], 0x01}
Yes
PUSH SU
2
9
-
-
-
-
- (SP-1) = SU; SP = SP - 1
Yes
POP SU
2
7
-
-
-
-
- SU = (SP); SP = SP + 1
Yes
SURES
2
4
-
-
-
-
- SU = {SU[1:0], SU[7:2]}
Yes
IDET
1
2
-
-
-
-
-
Performs
LD E,E
, but if
(EDMF && SU[0]) then the System
Violation interrupt flag is set; if ALTD
appears before it always does
LD E’,E
No
RDMODE
2
4
-
-
-
- * CF = SU[0]
Yes
SYSCALL
2
10
-
-
-
-
-
SP = SP - 2; PC = {R,v} where
v = SYSCALL offset
No
SCALL
2
15
-
-
-
-
-
(SP-1) = PCH; (SP-2) = PCL; (SP-3) = SU;
SP = SP - 3; PC = {IIR, 01100000};
SU = {SU[5:0], 00}
No
SRET
2
12
-
-
-
-
-
SU = (SP); PCL = (SP+1); PCH = (SP+2);
SP = SP+3
No
SETUSRP mn
4
15
-
-
-
-
-
SU = {SU[7:2], 01}, (SP-1) = m;
(SP-2) = n; SP = SP-2
No
SETSYSP mn
4
12
-
-
-
-
-
SU = {SU[1:0], SU[7:2]}; tmpl = (SP);
tmph = (SP+1); SP = SP+2;
if {tmp ! = mn} System Violation
No
Summary of Contents for Rabbit 5000
Page 1: ...Rabbit 5000 Microprocessor User s Manual 019 0168_E...
Page 11: ...Table of Contents Appendix B Rabbit 5000 Errata 401 B 1 Errata 401 Index 405...
Page 12: ...Rabbit 5000 Microprocessor User s Manual...
Page 20: ...20 Rabbit 5000 Microprocessor User s Manual...
Page 36: ...36 Rabbit 5000 Microprocessor User s Manual...
Page 56: ...56 Rabbit 5000 Microprocessor User s Manual...
Page 92: ...92 Rabbit 5000 Microprocessor User s Manual...
Page 104: ...104 Rabbit 5000 Microprocessor User s Manual...
Page 122: ...122 Rabbit 4000 Microprocessor User s Manual...
Page 142: ...142 Rabbit 5000 Microprocessor User s Manual...
Page 214: ...214 Rabbit 5000 Microprocessor User s Manual...
Page 228: ...228 Rabbit 5000 Microprocessor User s Manual...
Page 280: ...280 Rabbit 5000 Microprocessor User s Manual...
Page 298: ...298 Rabbit 5000 Microprocessor User s Manual...
Page 306: ...306 Rabbit 5000 Microprocessor User s Manual...
Page 314: ...314 Rabbit 5000 Microprocessor User s Manual...
Page 368: ...368 Rabbit 5000 Microprocessor User s Manual...
Page 388: ...388 Rabbit 5000 Microprocessor User s Manual...
Page 396: ...396 Rabbit 5000 Microprocessor User s Manual...
Page 404: ...404 Rabbit 5000 Microprocessor User s Manual...