PBusCacheProg3P.mesa
Copyright Ó 1987, 1988 by Xerox Corporation. All rights reserved.
Created by Jean Gastinel, May 21, 1988 6:20:57 pm PDT
Jean Gastinel June 2, 1988 2:23:57 pm PDT
DIRECTORY
Atom; 
PBusCacheProg3: CEDAR PROGRAM
IMPORTS Atom
EXPORTS
~ BEGIN
C: PROC [c: CARD] RETURNS [rc: REF ANY] = {rc ← NEW[CARD ← c]};
Atom.PutProp[$PBusEmul, $PKList, LIST[
LIST[$ClearFlag, $PBusWriteDone],
LIST[$Wait, C[2]],
LIST[$WaitSync, $MemReady],
LIST[$Wait, C[100]], -- wait for the DBus and the memory controller to be intialized
Testing for OwnerShip
LIST[$SetByteSelect,C[0FH]],   -- Word selection
LIST[$IOWrite,C[9H],C[01234567H]],     --AID register
LIST[$IOReadAndCheck,C[9H],C[01234567H]],  
LIST[$SetMode,C[1]],    -- test in User mode
    
LIST[$SetByteSelect,C[0FH]],   -- Word selection
LIST[$ReadAndCheck,C[00112289H],C[01234567H]],
LIST[$Write,C[00112288H],C[89ABCDEFH]],  -- Now I'm owner 
LIST[$SetFlag, $PBusWriteDone],
LIST[$SetMode,C[0]],    -- test in Kernel mode
$LoopWait,
LIST[$IOReadAndCheck,C[9H],C[01234567H]],  
LIST[$SkipIfTrue, $DynReadDone],
LIST[$Jump, $LoopWait],
LIST[$SetMode,C[1]],    -- test in User mode
LIST[$Write,C[0011228AH],C[0AABBCCDDH]],  -- WriteSingle gen
Terminate Simul
LIST[$SetMode,C[0]],    -- test in Kernel mode
LIST[$IOReadAndCheck,C[9H],C[01234567H]],  
            
$StopSimul,
$Nop,
LIST[$Jump, $Nop]
]];
END.