SIC has 5 registers (listed as mnemonic (number)):
A (0): Accumulator (used for arithmetic operations)X (1): Index (used for storing and calculating addresses)L (2): Linkage (used for jumping to memory addresses and return values)PC (8): Program Counter (used for holding the address of the next instruction)SW (9): Status Word (holds various data, e.g. flags)Each register has its own special purpose and all 5 registers are 24 bits in size (3 words).
A registerThe A register is used when doing integer arithmetic operations, where its value is modified (added to, subtracted from, etc.) with the value from the address, specified in the instruction.
The result is always stored back into register A.
X registerThe X register is used for storing an offset, which is used when indexed addressing is enabled (explained below).
L registerThe L register is used for storing the return address when going into a subroutine.
PC registerThe PC register is used for storing the next instruction’s address, so that the microprocessor knows where to find the instruction to execute.
The address stored in the register is implicitly (automatically) incremented after executing each instruction.
The value of the PC register doesn’t normally need to be set manually, so SIC doesn’t offer a separate instruction for it.
SW registerThe SW register is split into multiple meaningful sections, each holding useful information:
0: Mode
mode = 0, then SIC is in user modemode = 1, then SIC is in supervising mode1: State
state = 0, then SIC is in a running statestate = 1, then SIC is in an idle state2 to 5: PID (the process ID)6 and 7: CC (Condition Code - set by the compare operation and used in conditional jumps)8 to 11: Interrupt mask12 to 15: Unused16 to 23: Interrupt Code (Interrupt Service Routine)| Bit | 0 | 1 | 2-5 | 6-7 | 8-11 | 12-15 | 16-23 |
|---|---|---|---|---|---|---|---|
| Length | 1 bit | 1 bit | 4 bits | 2 bits | 4 bits | 4 bits | 8 bits |
| Purpose | Mode | State | PID | CC | Interrupt mask | Unused | Interrupt Code |
SIC supports only a single instruction format (24-bit):
x bit)| Bit | 0-7 | 8 | 9-23 |
|---|---|---|---|
| Length | 8 bits | 1 bit | 15 bits |
| Purpose | Opcode | Indexing flag | Address |
The microprocessor has to know where to get the value to use in an operation. It can find the memory address of that value (the target address or TA) from the address bits, but by combining the addressing bits with the indexing bit value, it can do this in two ways:
x = 0, then the TA equals the address directly (direct addressing mode)x = 1, then the TA equals the address plus the value of the X register (indexed addressing mode)x bit |
Target address | Addressing mode |
|---|---|---|
| 0 | TA = address |
Direct |
| 1 | TA = address + (X) |
Indexed |
(X)means the value in registerX.