PCProg.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Created by Jean Gastinel, May 6, 1988 9:01:05 pm PDT
This module change the Atom which contains the program to send the Data
DIRECTORY
Atom, BitOps; 
PCProg: CEDAR PROGRAM
IMPORTS Atom, BitOps
EXPORTS
~ BEGIN
Service Types
QWord: TYPE = ARRAY [0 .. 2) OF CARD;
Service Procs
Q: PROC [c: QWord] RETURNS [rc: REF ANY] = {rc ← NEW[QWord ← c]};
C: PROC [c: CARD] RETURNS [rc: REF ANY] = {rc ← NEW[CARDLOOPHOLE[c]]};
B: PROC [c: CARDINAL] RETURNS [rc: REF ANY] = {rc ← NEW[CARDINAL ← c]};
AdDBus: PROC [bd,hyb,Int,ci,pth: CARDINAL 𡤀] RETURNS [ad: CARDINAL 𡤀] ~ {
Address in the DBus is :
<BoardNum:4><HybridNum:4><InterfaceNum:3><ChipNum:2><PathNum:3>
<ChipNum>=0 is for BIC
ad ← BitOps.WShift[bd,12]+BitOps.WShift[hyb,8];
ad ← ad+BitOps.WShift[Int,5]+BitOps.WShift[ci,3]+pth;
};
IdCte: PROC [t,v:CARDINAL] RETURNS [id:CARDINAL] ~ {
The structure of the Identificator is "0101 cccc ccrr rrrr"
cccccc is the Type, rrrrrr is the Version
id ← 5000H + BitOps.WShift[t,6] + v;
};
Here Start The Program
Atom.PutProp[$PCEmul, $PKList, LIST[
LIST[$ClearFlag, $DBusReady],
$Init,
$Reset,
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:0,ci:1,pth:0]]], -- ID path of Display
LIST[$ReadDBusAndCheck,C[IdCte[t:8,v:1]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:1,ci:1,pth:0]]], -- ID path of Map-Cache
LIST[$ReadDBusAndCheck,C[IdCte[t:9,v:1]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:2,ci:1,pth:0]]], -- ID path of Cache
LIST[$ReadDBusAndCheck,C[IdCte[t:5,v:1]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:3,ci:1,pth:0]]], -- ID path of IOB
LIST[$SetFlag, $DBusReady],
LIST[$ReadDBusAndCheck,C[IdCte[t:7,v:1]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:0,ci:0,pth:0]]], -- ID path of BIC0
LIST[$ReadDBusAndCheck,C[IdCte[t:2,v:0]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:1,ci:0,pth:0]]], -- ID path of BIC1
LIST[$ReadDBusAndCheck,C[IdCte[t:2,v:1]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:2,ci:0,pth:0]]], -- ID path of BIC2
LIST[$ReadDBusAndCheck,C[IdCte[t:2,v:2]],B[16]],   
LIST[$SendDBusAddress, B[AdDBus[bd:1,hyb:2,Int:3,ci:0,pth:0]]], -- ID path of BIC3
LIST[$ReadDBusAndCheck,C[IdCte[t:2,v:3]],B[16]],   
$Nop,
LIST[$Jump, $Nop]
]];
END.