
CS5954AM
ADVANCE
INFORMATION
Document #: 38-08025 Rev. **
Page 29 of 44
8.4
General-purpose Registers
The general-purpose registers can be used to store intermediate results, and to pass parameters to and return them from
subroutine calls.
8.5
General-purpose/Address Registers
In addition to acting as general-purpose registers, registers R8-R14 can also serve as pointer registers. Instructions can access
RAM locations by referring to any of these registers. In normal operation, register R15 is reserved for use as a stack pointer.
8.6
REGBANK Register (0xC002: R/W)
Registers R0..R15 are mapped into RAM via the REGBANK register. The REGBANK register is loaded with a base address, of
which the 11 Most Significant Bits (MSBs) are used. A Read from or Write to one of the registers will generate a RAM address by:
• Shifting the four Least Significant Bits (LSBs) of the register number left by 1.
• OR-ing the shifted bits of the register number with the upper 11 bits of the REGBANK register.
• Forcing the LSB to 0.
For example, if the REGBANK register is left at its default value of 100 hex, a read of register R14 would read address 11C hex.[26]
8.7
Flags Register (0xC000: Read-only)
The CS5954AM Processor uses these flags.[27]
Z
Zero: instruction execution resulted in a result of 0.
C
Carry/Borrow: Arithmetic instruction resulted in a carry (for addition) or a borrow (for subtraction).
O
Overflow: Arithmetic result was either larger than the destination operand size (for addition) or smaller
than the destination operand should allow for subtraction.
SSign: Set if MS result bit is “1.”
I
Global Interrupts: Enabled if “1.”
8.8
Instruction Format
To understand addressing modes supported by the CS5954AM Processor, one must know how the instruction format is defined.
In general, the instructions include four bits for the instruction opcode, six bits for the source operand, and six bits for the
destination operand.
Some instructions, especially single operand-operator and program control instructions, will not adhere strictly to this format. They
will be discussed in detail in turn.
Notes:
26. Regardless of the value loaded into the REGBANK register, bits 0..4 will be ignored.
27. Flag behavior for each instruction will be described in the following section.
Register
Hex Value
Binary Value
REGBANK
0100
0
000
000
100
0x
x
x
x
x
R14
000E << 1 = 001C
x
xxx
xxx
xxx
0
1
1
1
0
0
RAM Location
011C
0
000
000
100
011
100
FLAG
bit:
15
14
13
12
11
10
9876
543210
000
0
0
00000
0
I
S
O
C
Z
Instr
bit:
15
14
13
12
11
10
98
765
432
10
opcode
source
destination