EndianDebug.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Hal Murray, January 28, 1986 1:36:05 am PST
DIRECTORY
AMBridge USING [TVToLC],
AMTypes USING [IndexToTV, TV],
Endian USING [CardFromF, FWORD],
IO USING [PutF],
PrintTV USING [RegisterRefPrintProc, RegisterTVPrintProc, RefPrintProc, TVPrintProc];
EndianDebug:
CEDAR
PROGRAM
IMPORTS AMBridge, AMTypes, Endian, IO, PrintTV = {
PrintRefFWord: PrintTV.RefPrintProc = {
[ref: REF READONLY ANY, data: REF ANY, stream: STREAM, depth: INT ← 4, width: INT ← 32, verbose: BOOL ← FALSE] RETURNS [useOld: BOOL ← FALSE]
foo: REF READONLY Endian.FWORD ← NARROW[ref];
IO.PutF[stream, "%G", [cardinal[Endian.CardFromF[foo^]]] ];
};
PrintTVFWord: PrintTV.TVPrintProc =
TRUSTED {
[tv: TV, data: REF ANY, stream: STREAM, depth: INT ← 4, width: INT ← 32, verbose: BOOL ← FALSE] RETURNS [useOld: BOOL ← FALSE]
foo: Endian.FWORD;
highTV: AMTypes.TV ← AMTypes.IndexToTV[tv, 1];
lowTV: AMTypes.TV ← AMTypes.IndexToTV[tv, 2];
foo.high ← AMBridge.TVToLC[highTV];
foo.low ← AMBridge.TVToLC[lowTV];
IO.PutF[stream, "%G", [cardinal[Endian.CardFromF[foo]]] ];
};
PrintTV.RegisterRefPrintProc[CODE[Endian.FWORD], PrintRefFWord];
PrintTV.RegisterTVPrintProc[CODE[Endian.FWORD], PrintTVFWord];