<> <> <> DIRECTORY Rope, IO, FS, List, TamarinLisp; TamarinLispImpl: CEDAR PROGRAM IMPORTS List, IO, FS EXPORTS TamarinLisp = BEGIN OPEN TamarinLisp; LORA: TYPE = List.LORA; constList: LORA _ NIL; dpCcList: LORA _ NIL; specRegConstList: LORA _ NIL; uCodeList: LORA _ NIL; <<>> GetTamarinConstants: PUBLIC PROC RETURNS[res: LORA] = { res _ List.Reverse[constList] }; GetDpCondCodes: PUBLIC PROC RETURNS[res: LORA] = { res _ List.Reverse[dpCcList] }; GetSpecRegConstants: PUBLIC PROC RETURNS[res: LORA] = { res _ List.Reverse[specRegConstList] }; GetUCodeContents: PUBLIC PROC RETURNS[res: LORA] = { res _ List.Reverse[uCodeList] }; TamConstant: PUBLIC PROC [atm: ATOM, val: INT] = { const: TamConst _ NEW[ TamConstRec]; const^ _ [atm, val]; constList _ CONS[ const, constList] }; DpCCode: PUBLIC PROC [index: NAT, d1, d2, nD1, nD, d1XorD2: Rope.ROPE] = { const: DpCondCode _ NEW[ DpCondCodeRec]; const^ _ [index, d1, d2, nD1, nD, d1XorD2]; dpCcList _ CONS[ const, dpCcList] }; SpecRegConst: PUBLIC PROC [wh, index: NAT, val: Rope.ROPE] = { const: SpecRegConstant _ NEW[ SpecRegConstRec]; const^ _ [index, val]; specRegConstList _ CONS[ const, specRegConstList] }; AddUCode: PUBLIC PROC [aAddr, bAddr: NAT, aeMI, aoMI, beMI, boMI: Rope.ROPE] = { const: UCodeWord _ NEW[ UCodeWordRec]; const^ _ [0, aAddr, bAddr, aeMI, aoMI, beMI, boMI]; uCodeList _ CONS[ const, uCodeList] }; GetUCode: PROC = { stream: IO.STREAM; aindex, bindex: NAT; aeMI, aoMI, beMI, boMI: Rope.ROPE; stream _ FS.StreamOpen["/Phylum/CTamarin/TamarinRoseSim/TamUCode"]; <> FOR i: NAT _ 0, i + 1 WHILE i < 128 DO aindex _ IO.GetInt[stream]; aeMI _ IO.GetTokenRope[stream].token; aoMI _ IO.GetTokenRope[stream].token; bindex _ IO.GetInt[stream]; beMI _ IO.GetTokenRope[stream].token; boMI _ IO.GetTokenRope[stream].token; AddUCode[aindex, bindex, aeMI, aoMI, beMI, boMI]; ENDLOOP; IO.Close[stream]; }; GetUCode[]; END.