Addressing Modes
In SIC/XE there are several addressing modes available for format 3/4 instructions. They're controlled by several bit flags on the instructions. The below table is found in Appendix A of System Software: An Introduction to Systems Programming.
Notes
4: Format 4 instruction
D: Direct-addressing instruction
A: Assembler selects either program-counter relative or base-relative mode
S: Compatible with instruction format for standard SIC machine
Addressing type | Flag bits | Assembly notation | Calculation of target address (TA) | Operand | Notes |
|---|---|---|---|---|---|
Simple |
|
| disp | (TA) | D |
|
| addr | (TA) | 4 D | |
|
| (PC) + disp | (TA) | A | |
|
| (B) + disp | (TA) | A | |
|
| disp + (X) | (TA) | D | |
|
| addr + (X) | (TA) | 4 D | |
|
| (PC) + disp + (X) | (TA) | A | |
|
| (B) + disp + (X) | (TA) | A | |
|
| b/p/e/disp | (TA) | D S | |
|
| b/p/e/disp + (X) | (TA) | D S | |
Indirect |
|
| disp | ((TA)) | D |
|
| addr | ((TA)) | 4 D | |
|
| (PC) + disp | ((TA)) | A | |
|
| (B) + disp | ((TA)) | A | |
Immediate |
|
| disp | TA | D |
|
| addr | TA | 4 D | |
|
| (PC) + disp | TA | A | |
|
| (B) + disp | TA | A |
Combinations not in this table are considered invalid.
Simple
In simple modes, the operand is the value located at the target address.
Direct mode
In direct addressing mode, the operand is calculated by retrieving the value stored at what the target address points to. Direct addressing is used when n and i are both 1.
SIC mode
All opcodes in SIC (and SIC/XE) end in 00 for the last two bits, which happen to be the n and i bits. Because of this, any programs assembled for SIC will have instructions matching the last two lines for simple addressing when ran on SIC/XE. So when n and i are both 0, SIC mode is used. In this mode, the b, p, and e bits are treated as the first 3 bits of the 15-bit address that SIC programs use.
opcode | n | i | x | address | |
|---|---|---|---|---|---|
Bits | 0-5 | 6 | 7 | 8 | 9-23 |
Length | 6 | 1 | 1 | 1 | 15 |
always 0 | always 0 | The |
Indirect
Indirect addressing is used when n is 1 and i is 0. In assembly this is specified by prefixing the operand with @. In indirect addressing, the operand is calculated by looking up the value located at the target address and using the value retrieved to do another lookup. The value found after the second lookup is the operand.
Immediate
Immediate addressing uses the target address as the operand. Immediate mode is used by prefixing the operand with #.
Base and program-counter relative
Base and program-counter relative are specified by the b and p bits respectively.
Base relative
Base relative is specified by the b bit. The disp field is limited to values of 0 ≤ disp ≤ 4095.
Program-counter relative
Program counter relative is specified by the p bit. The disp field is limited to values of -2048 ≤ disp ≤ 2047.