Register Declarations
LocalRegIndex: TYPE = [0..15];
AuxRegIndex: TYPE = [0..15];
ConstIndex: TYPE = [0..11];
SrcStackIndex: TYPE = [0..15]; -- 12..15 only are valid
DstStackIndex: TYPE = [0..15]; -- 12..15 only are valid
RegSpec:
TYPE =
RECORD[
SELECT kind: *
FROM
reg => [reg: LocalRegIndex],
aux => [aux: AuxRegIndex],
const => [const: ConstIndex],
srcStack => [stack: SrcStackIndex],
dstStack => [stack: DstStackIndex],
ENDCASE];
LocalRegSpec: TYPE = RegSpec[reg];
AuxRegSpec: TYPE = RegSpec[aux];
ConstSpec: TYPE = RegSpec[const];
SrcStackSpec: TYPE = RegSpec[srcStack];
DstStackSpec: TYPE = RegSpec[dstStack];
reg0: LocalRegSpec = [reg[0]];
reg1: LocalRegSpec = [reg[1]];
reg2: LocalRegSpec = [reg[2]];
reg3: LocalRegSpec = [reg[3]];
reg4: LocalRegSpec = [reg[4]];
reg5: LocalRegSpec = [reg[5]];
reg6: LocalRegSpec = [reg[6]];
reg7: LocalRegSpec = [reg[7]];
reg8: LocalRegSpec = [reg[8]];
reg9: LocalRegSpec = [reg[9]];
reg10: LocalRegSpec = [reg[10]];
reg11: LocalRegSpec = [reg[11]];
reg12: LocalRegSpec = [reg[12]];
reg13: LocalRegSpec = [reg[13]];
reg14: LocalRegSpec = [reg[14]];
reg15: LocalRegSpec = [reg[15]];
global: AuxRegSpec = [aux[0]]; -- base of global frame table
hook: AuxRegSpec = [aux[1]]; -- addr of eldest frame saved to memory (per process)
free: AuxRegSpec = [aux[2]]; -- free frame slot addr (per processor)
base: AuxRegSpec = [aux[3]]; -- base of frame slots (per processor)
process: AuxRegSpec = [aux[4]]; -- addr of current process object (per process)
processor: AuxRegSpec = [aux[5]]; -- addr of current processor block
noTS: AuxRegSpec = [aux[6]]; -- # 0 => trace and sweep collection prohibited
aux7: AuxRegSpec = [aux[7]];
aux8: AuxRegSpec = [aux[8]];
aux9: AuxRegSpec = [aux[9]];
aux10: AuxRegSpec = [aux[10]];
aux11: AuxRegSpec = [aux[11]];
aux12: AuxRegSpec = [aux[12]];
aux13: AuxRegSpec = [aux[13]];
temp: AuxRegSpec = [aux[14]]; -- just used for stack save/restore
nregs: AuxRegSpec = [aux[15]]; -- just used for stack save/restore
The first 7 constants are slightly special, since they have 1 byte load instructions
const0: ConstSpec = [const[0]]; -- constant 0
const1: ConstSpec = [const[1]]; -- constant 1
const2: ConstSpec = [const[2]]; -- constant 2
const3: ConstSpec = [const[3]]; -- constant 3
const4: ConstSpec = [const[4]]; -- constant 4
constN2: ConstSpec = [const[5]]; -- constant - 2
constN1: ConstSpec = [const[6]]; -- constant - 1
constU7: ConstSpec = [const[7]]; -- unspecified right now
The remaining 4 constants can be loaded in 3 byte instructions
constNI: ConstSpec = [const[8]]; -- constant FIRST[INT]
constNSI: ConstSpec = [const[9]]; -- constant 100000B
constU10: ConstSpec = [const[10]]; -- unspecified right now
constU11: ConstSpec = [const[11]]; -- unspecified right now
stack options for sources (RRformInst & RJBformInst)
topSrc: SrcStackSpec = [srcStack[12]];
belowSrc: SrcStackSpec = [srcStack[13]];
popSrc: SrcStackSpec = [srcStack[14]];
belowSrcPop: SrcStackSpec = [srcStack[15]];
stack options for destinations (RRformInst)
topDst: DstStackSpec = [dstStack[12]];
belowDst: DstStackSpec = [dstStack[13]];
pushDst: DstStackSpec = [dstStack[15]];
ShortRegSpec:
TYPE =
MACHINE
DEPENDENT {
Must be consistent with DragOpsCross.ShortRegRJB for numbers, but should be consistent with HandCoding.RegSpec for names.
const0(0), -- constant 0
const1(1), -- constant 1
topSrc(2), -- [S]
popSrc(3)}; -- [S]-