IRegAddr.rose
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by: McCreight, May 2, 1984 4:42:22 pm PDT
Last edited by: Curry, August 21, 1984 12:40:08 pm PDT
Last Edited by: Twilliams, August 28, 1984 9:36:15 am PDT
Directory DragonMicroPLA;
Imports Atom, BitOps, Dragon, DragonIFU;
IALRegAddr: CELL [
SAB    <INT[7],
OpBA    <INT[8], -- become valid in Ph0B
AlphaBA   <INT[8],
BetaBA   <INT[8],
ASum0B   <EnumType["DragonMicroPLA.ABRegSum0"], -- computed in Ph0B
ASum1B   <EnumType["DragonMicroPLA.ABRegSum1"],
Lev0AaddrBA >INT[8],
LSum0A   <EnumType["DragonMicroPLA.LSource0"], -- computed in Ph1A
LSum1A   <EnumType["DragonMicroPLA.LSource1"],
DeltaSPlus2A  <INT[2],
XBus    <INT[32],
LAB    =INT[7],
PhA    <BOOL,
PhB    <BOOL
]
State
xBusPos: [0..32),
sBA, lBA: Dragon.HexByte,
addBus0, sum: Dragon.HexByte,
addBus1: [-128..256)
EvalSimple
IF PhB THEN
BEGIN
sBA ← SAB;
lBA ← LAB;
addBus0 ← SELECT ASum0B FROM
s  => SAB,
l  => LAB,
cBase => DragonIFU.PRtoByte[euConstant],
aBase => DragonIFU.PRtoByte[euAux],
iRef => DragonIFU.PRtoByte[ifuXBus]+4,
zero => 0,
ENDCASE => ERROR;
addBus1 ← SELECT ASum1B FROM
op47  => OpBA MOD 16,
alpha  => AlphaBA,
alpha03 => AlphaBA/16,
alpha47 => AlphaBA MOD 16,
beta  => BetaBA,
beta03  => BetaBA/16,
beta47  => BetaBA MOD 16,
minus4 => -4,
minus3 => -3,
minus2 => -2,
minus1 => -1,
zero  => 0,
one  => 1,
two  => 2,
three  => 3,
ENDCASE => ERROR;
END;
IF PhA THEN
BEGIN
addBus0 ← SELECT LSum0A FROM
s   => sBA,
l   => lBA,
xBus  => BitOps.ECFD[XBus, 32, xBusPos, 7],
zero  => 0,
ENDCASE => ERROR;
addBus1 ← SELECT LSum1A FROM
alpha  => AlphaBA,
zero  => 0,
one  => 1,
ENDCASE => ERROR;
END;
sum ← (addBus0+addBus1+256) MOD 256;
IF PhB THEN
Lev0AaddrBA ← SELECT ASum0B FROM
s, l => sum MOD 128,
ENDCASE => sum;
IF PhA THEN LAB ← sum MOD 128;
Initializer
xBusPos ← NARROW[
NARROW[initData, Atom.PropList].GetPropFromList[$xBusPos],
REF INT]^;
ENDCELL;
IBSRegAddr: CELL [
LAB    <INT[7],
OpBA    <INT[8], -- become valid in Ph0B
AlphaBA   <INT[8],
BetaBA   <INT[8],
BSum0B   <EnumType["DragonMicroPLA.ABRegSum0"], -- computed in Ph0B
BSum1B   <EnumType["DragonMicroPLA.ABRegSum1"],
Lev0BaddrBA >INT[8],
SSum0A   <EnumType["DragonMicroPLA.SSource0"], -- computed in Ph1A
SSum1A   <EnumType["DragonMicroPLA.SSource1"],
DeltaSPlus2A  <INT[2],
XBus    <INT[32],
SAB    =INT[7],
PhA    <BOOL,
PhB    <BOOL
]
State
xBusPos: [0..32),
sBA, lBA: Dragon.HexByte,
addBus0, sum: Dragon.HexByte,
addBus1: [-128..256)
EvalSimple
IF PhB THEN
BEGIN
sBA ← SAB;
lBA ← LAB;
addBus0 ← SELECT BSum0B FROM
s  => SAB,
l  => LAB,
cBase => DragonIFU.PRtoByte[euConstant],
aBase => DragonIFU.PRtoByte[euAux],
iRef => DragonIFU.PRtoByte[ifuXBus]+4,
zero => 0,
ENDCASE => ERROR;
addBus1 ← SELECT BSum1B FROM
op47  => OpBA MOD 16,
alpha  => AlphaBA,
alpha03 => AlphaBA/16,
alpha47 => AlphaBA MOD 16,
beta  => BetaBA,
beta03  => BetaBA/16,
beta47  => BetaBA MOD 16,
minus4 => -4,
minus3 => -3,
minus2 => -2,
minus1 => -1,
zero  => 0,
one  => 1,
two  => 2,
three  => 3,
ENDCASE => ERROR;
END;
IF PhA THEN
BEGIN
addBus0 ← SELECT SSum0A FROM
s   => sBA,
l   => lBA,
xBus  => BitOps.ECFD[XBus, 32, xBusPos, 7],
zero  => 0,
ENDCASE => ERROR;
addBus1 ← SELECT SSum1A FROM
alpha  => AlphaBA,
deltaS  => DeltaSPlus2A-2,
zero  => 0,
one  => 1,
ENDCASE => ERROR;
END;
sum ← (addBus0+addBus1+256) MOD 256;
IF PhB THEN
Lev0BaddrBA ← SELECT BSum0B FROM
s, l => sum MOD 128,
ENDCASE => sum;
IF PhA THEN SAB ← sum MOD 128;
Initializer
xBusPos ← NARROW[
NARROW[initData, Atom.PropList].GetPropFromList[$xBusPos],
REF INT]^;
ENDCELL;
ICRegAddr: CELL [
SAB     <INT[7],
LAB     <INT[7],
OpBA     <INT[8], -- become valid in Ph0B
AlphaBA    <INT[8],
BetaBA    <INT[8],
CSum0A    <EnumType["DragonMicroPLA.CRegSum0"], -- computed in Ph1A
CSum1A    <EnumType["DragonMicroPLA.CRegSum1"],
Lev0CaddrA   >INT[8],
XBus     =INT[32],
ReadSLimitA   <BOOL,
SetSLimitA   <BOOL,
EStkOverflowBA >BOOL,
PhA     <BOOL,
PhB     <BOOL
]
State
sBA, lBA: Dragon.HexByte,
sLimitAB, sLimitBA: Dragon.HexByte,
addBus0, sum: Dragon.HexByte,
addBus1: [-128..256)
EvalSimple
IF PhB THEN
BEGIN
sBA ← SAB;
lBA ← LAB;
sLimitBA ← sLimitAB;
addBus0 ← SAB;
addBus1 ← 127-sLimitAB; -- that is, NOT sLimitAB
END;
IF PhA THEN
BEGIN
Dragon.Assert[ NOT (ReadSLimitA AND SetSLimitA) ];
IF ReadSLimitA THEN XBus ← BitOps.ICID[sLimitBA, XBus, 32, 32-7, 7];
sLimitAB ← IF SetSLimitA THEN BitOps.ECFD[XBus, 32, 32-7, 7] ELSE sLimitBA;
addBus0 ← SELECT CSum0A FROM
s  => sBA,
l  => lBA,
cBase => DragonIFU.PRtoByte[euConstant],
aBase => DragonIFU.PRtoByte[euAux],
iRef => DragonIFU.PRtoByte[ifuXBus]+4,
zero => 0,
ENDCASE => ERROR;
addBus1 ← SELECT CSum1A FROM
op47  => OpBA MOD 16,
alpha  => AlphaBA,
alpha03 => AlphaBA/16,
alpha47 => AlphaBA MOD 16,
beta  => BetaBA,
beta03  => BetaBA/16,
beta47  => BetaBA MOD 16,
minus4 => -4,
minus3 => -3,
minus2 => -2,
minus1 => -1,
zero  => 0,
one  => 1,
two  => 2,
three  => 3,
ENDCASE => ERROR;
END;
sum ← (addBus0+addBus1+256) MOD 256;
IF PhB THEN EStkOverflowBA ← (sum MOD 128) IN [0..15);
Change this 15 back to 16 when Russ changes his 17 to 16
IF PhA THEN
Lev0CaddrA ← SELECT CSum0A FROM
s, l => sum MOD 128,
ENDCASE => sum;
ENDCELL