PCDynProg.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Created by Jean Gastinel, November 26, 1987 8:33:50 pm PST
This module change the Atom which contains the program to send the Data
DIRECTORY
Atom, BitOps; 
PCDynProg: 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[
$Init,
$Reset,
$Nop,
LIST[$Jump,$Nop],
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:0]]], -- ID path of DynInt
$Nop,
LIST[$Jump,$Nop],
LIST[$ReadDBusAndCheck,C[IdCte[t:11,v:1]],B[16]],
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]]], -- path 1 of DynInt
LIST[$ReadDBusAndCheck,C[0],B[4]],   
LIST[$ReadDBusAndCheck,C[0],B[32]],   
LIST[$ReadDBusAndCheck,C[0],B[32]],   
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]]], -- path 4 of DynInt
LIST[$ReadDBusAndCheck,C[0],B[4]],   
LIST[$ReadDBusAndCheck,C[0],B[32]],   
LIST[$ReadDBusAndCheck,C[11111111H],B[32]],   
LIST[$ReadDBusAndCheck,C[0],B[4]],   
LIST[$ReadDBusAndCheck,C[0],B[32]],   
LIST[$ReadDBusAndCheck,C[22222222H],B[32]],
LIST[$ReadDBusAndCheck,C[0],B[4]],   
LIST[$ReadDBusAndCheck,C[0],B[32]],   
LIST[$ReadDBusAndCheck,C[33333333H],B[32]],
LIST[$ReadDBusAndCheck,C[0],B[4]],   
LIST[$ReadDBusAndCheck,C[0],B[32]],   
LIST[$ReadDBusAndCheck,C[44444444H],B[32]],
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]]], -- path 1 of DynInt
LIST[$SendDBusData,C[0],B[4]],
LIST[$SendDBusData,C[01234567H],B[32]],
LIST[$SendDBusData,C[89ABCDEFH],B[32]],
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:4]]], -- path 1 of DynInt
LIST[$SendDBusData,C[1],B[4]],
LIST[$SendDBusData,C[12345678H],B[32]],
LIST[$SendDBusData,C[9ABCDEF0H],B[32]],
LIST[$SendDBusData,C[2],B[4]],
LIST[$SendDBusData,C[23456789H],B[32]],
LIST[$SendDBusData,C[0BCDEF01H],B[32]],
LIST[$SendDBusData,C[3],B[4]],
LIST[$SendDBusData,C[3456789AH],B[32]],
LIST[$SendDBusData,C[0CDEF012H],B[32]],
LIST[$SendDBusData,C[4],B[4]],
LIST[$SendDBusData,C[456789ABH],B[32]],
LIST[$SendDBusData,C[0DEF0123H],B[32]],
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:1]]], -- path 1 of DynInt
LIST[$ReadDBusAndCheck,C[0],B[4]],
LIST[$ReadDBusAndCheck,C[01234567H],B[32]],
LIST[$ReadDBusAndCheck,C[89ABCDEFH],B[32]],
LIST[$SendDBusAddress, B[AdDBus[bd:0,hyb:0,Int:0,ci:0,pth:4]]], -- path 4 of DynInt
LIST[$ReadDBusAndCheck,C[1],B[4]],
LIST[$ReadDBusAndCheck,C[12345678H],B[32]],
LIST[$ReadDBusAndCheck,C[9ABCDEF0H],B[32]],
LIST[$ReadDBusAndCheck,C[2],B[4]],
LIST[$ReadDBusAndCheck,C[23456789H],B[32]],
LIST[$ReadDBusAndCheck,C[0BCDEF01H],B[32]],
LIST[$ReadDBusAndCheck,C[3],B[4]],
LIST[$ReadDBusAndCheck,C[3456789AH],B[32]],
LIST[$ReadDBusAndCheck,C[0CDEF012H],B[32]],
LIST[$ReadDBusAndCheck,C[4],B[4]],
LIST[$ReadDBusAndCheck,C[456789ABH],B[32]],
LIST[$ReadDBusAndCheck,C[0DEF0123H],B[32]],  
]];
END.