Rabbit 3000 Microprocessor
User's Manual
PREV NEXT INDEX



19. Rabbit Instructions

Summary

Load Immediate Data
8-bit Indexed Load and Store
16-bit Indexed Loads and Stores
16-bit Load and Store 20-bit Address
Register to Register Moves
Exchange Instructions
Stack Manipulation Instructions
16-bit Arithmetic and Logical Ops
8-bit Arithmetic and Logical Ops
8-bit Bit Set, Reset and Test
8-bit Increment and Decrement
8-bit Fast A register Operations
8-bit Shifts and Rotates
Instruction Prefixes
Block Move Instructions
Control Instructions - Jumps and Calls
Miscellaneous Instructions
Privileged Instructions
Instructions in Alphabetical Order With Binary Encoding

Spreadsheet Conventions

ALTD ("A" Column) Symbol Key

IOI and IOE ("I" Column) Symbol Key

Flag Register Key

1 The L/V (logical/overflow) flag serves a dual purpose--L/V is set to 1 for logical operations if any of the four most significant bits of the result are 1, and L/V is reset to 0 if all four of the most significant bits of the result are 0.

Symbols
1 Logical zero if all four of the most significant bits of the result are 0.

2 Logical one if any of the four most significant bits of the result are 1.


19.1 Load Immediate Data

19.2 Load & Store to Immediate Address

19.3 8-bit Indexed Load and Store

19.4 16-bit Indexed Loads and Stores

19.5 16-bit Load and Store 20-bit Address

Note that the LDP instructions wrap around on a 64K page boundary. Since the LDP instruction operates on two-byte values, the second byte will wrap around and be written at the start of the page if you try to read or write across a page boundary. Thus, if you fetch or store at address 0xn,0xFFFF, you will get the bytes located at 0xn,0xFFFF and 0xn,0x0000 instead of 0xn,0xFFFFand 0x(n+1),0x0000 as you might expect. Therefore, do not use LDP at any physical address ending in 0xFFFF.

19.6 Register to Register Moves

19.7 Exchange Instructions


19.8 Stack Manipulation Instructions

19.9 16-bit Arithmetic and Logical Ops

19.10 8-bit Arithmetic and Logical Ops

19.11 8-bit Bit Set, Reset and Test

19.12 8-bit Increment and Decrement

19.13 8-bit Fast A register Operations

19.14 8-bit Shifts and Rotates


19.15 Instruction Prefixes

19.16 Block Move Instructions

If any of the block move instructions are prefixed by an I/O prefix, the destination will be in the specified I/O space. Add 1 clock for each iteration for the prefix if the prefix is IOI (internal I/O). If the prefix is IOE, add 2 clocks plus the number of I/O wait states enabled. The V flag is set when BC transitions from 1 to 0. If the V flag is not set another step is performed for the repeating versions of the instructions. Interrupts can occur between different repeats, but not within an iteration equivalent to LDD or LDI. Return from the interrupt is to the first byte of the instruction which is the I/O prefix byte if there is one.

19.17 Control Instructions - Jumps and Calls

19.18 Miscellaneous Instructions

19.19 Privileged Instructions

The privileged instructions are described in this section. Privilege means that an interrupt cannot take place between the privileged instruction and the following instruction.

The three instructions below are privileged.

The instructions to load the stack are privileged so that they can be followed by an instruction to load the stack segment (SSEG) register without the danger of an interrupt taking place with and incorrect association between the stack pointer and the stack segment register. For example,

The following instructions are privileged.

The instructions to modify the IP register are privileged so that they can be followed by a return instructions that is guaranteed to execute before another interrupt takes place. This avoids the possibility of an ever-growing stack.

The instruction reti can be used to set both the return address and the IP in a single instruction. If preceded by a LD XPC, a complete jump or call to a computed address can be done with no possible interrupt.

The instruction LD XPC,A is privileged so that it can be followed by other code setting interrupt priority or program counter without an intervening interrupt.

The instruction bit B,(HL) is privileged to make it possible to implement a semaphore without disabling interrupts. The following sequence is used. A bit is a semaphore, and the first task to set the bit owns the semaphore and has a right to manipulate the resources associated with the semaphore.

The SET instruction has no effect on the flags. Since no interrupt takes place after the BIT instruction, if the flag is zero that means that the semaphore was not set when tested by the bit instruction and that the set instruction has set the semaphore. If an interrupt was allowed between the BIT and set instructions, another routine could set the semaphore and two routines could think that they both owned the semaphore.


Rabbit Semiconductor
http://www.rabbitsemiconductor.com
Voice: (530) 757-8400
FAX: (530) 757-8402
sales@rabbitsemiconductor.com
PREV NEXT INDEX