DragonIFUImpl.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Curry, August 1, 1984 5:42:25 pm PDT
DIRECTORY
AMBridge,
AMMiniModel,
AMTypes,
Dragon,
DragonIFU,
DragOpsCross,
IO,
Rope;
DragonIFUImpl: CEDAR PROGRAM
IMPORTS AMBridge, AMMiniModel, AMTypes, IO, Rope
EXPORTS DragonIFU =
BEGIN
IsRdCmd: PUBLIC PROC[cmnd: Dragon.PBusCommands] RETURNS[BOOL] = {
RETURN[ SELECT cmnd FROM
FetchFPAlu => TRUE,
FetchFPMult => TRUE,
Fetch   => TRUE,
FetchHold => TRUE,
IOFetch  => TRUE,
IOFetchHold => TRUE,
ENDCASE  => FALSE]};
IsWtCmd: PUBLIC PROC[cmnd: Dragon.PBusCommands] RETURNS[BOOL] = {
RETURN[ SELECT cmnd FROM
StoreFP  => TRUE,
Store   => TRUE,
StoreHold  => TRUE,
IOStore  => TRUE,
IOStoreHold => TRUE,
ENDCASE  => FALSE]};
IsFPCmd: PUBLIC PROC[cmnd: Dragon.PBusCommands] RETURNS[BOOL] = {
RETURN[ SELECT cmnd FROM
StoreFP  => TRUE,
FetchFPAlu => TRUE,
FetchFPMult => TRUE,
ENDCASE  => FALSE]};
PRtoByte: PUBLIC PROC[pr: DragOpsCross.ProcessorRegister] RETURNS [byte: Dragon.HexByte]={
byte ← LOOPHOLE[pr]};
BytetoPR: PUBLIC PROC[byte: Dragon.HexByte] RETURNS [pr: DragOpsCross.ProcessorRegister]={
pr ← LOOPHOLE[byte]};
GenDragOpTable: PUBLIC PROC RETURNS[name: DragonIFU.DragOpTable] = TRUSTED {
iFace: AMTypes.Type = AMMiniModel.AcquireIRType["DragOpsCross.bcd"];
instX: NAT    ← AMTypes.NameToIndex[iFace, "Inst"];
eVal: AMTypes.TV  ← AMTypes.IndexToDefaultInitialValue[iFace, instX];
eType: AMTypes.Type ← AMTypes.UnderType[AMTypes.TVToType[eVal]];
name      ← NEW[DragonIFU.DragOpTableArray ← ALL[NIL]];
FOR each: AMTypes.TV ← AMTypes.First[eType], AMTypes.Next[each] WHILE each # NIL DO
card: CARDINAL ← AMBridge.TVToCardinal[each];
dhb: Dragon.HexByte ← card MOD 256;
IF dhb # card THEN ERROR;
name[dhb] ← NIL;
name[dhb] ← AMTypes.TVToName[each ! AMTypes.Error => CONTINUE];
IF name[dhb] = NIL THEN name[dhb] ← IO.PutFR["dxop%02h", [cardinal[dhb]]];
name[dhb] ← Rope.Substr[name[dhb],1];
ENDLOOP;
};
END.