PutChar:
PUBLIC
SAFE
PROC [char:
CHAR] =
TRUSTED {
ENABLE UNWIND => NULL;
c: WORD ← LOOPHOLE[char];
timeOutCnt: CARDINAL ← 0;
IF Diablo.Fault[] THEN ERROR Error["Diablo has a fault."];
UNTIL Diablo.Ready[]
DO
timeOutCnt ← timeOutCnt + 1;
IF timeOutCnt = LAST [CARDINAL] THEN ERROR Error["Diablo failed to become ready."];
ENDLOOP;
WritePrinter[c]; -- set up the data
WritePrinter[PrincOpsUtils.BITOR[c, Strobe]]; -- strobe the data
WritePrinter[c]; -- clear the strobe
};