BlockOps.mesa
Copyright © 1987 by Xerox Corporation. All rights reserved.
Willie-Sue, January 18, 1988 1:09:58 pm PST
BEGIN
LookupRecord:
TYPE =
MACHINE
DEPENDENT
RECORD[
src: LONG POINTER TO CARDINAL,
dst: LONG POINTER TO CARDINAL,
table: LONG POINTER TO CARDINAL,
srcSkip: CARDINAL,
dstSkip: CARDINAL,
count: CARDINAL
];
aTBLLOOKUP: PrincOps.alpha = 244B;
aBlkOp: PrincOps.alpha = 245B;
TableLookup:
PROC[ptr:
LONG
POINTER
TO LookupRecord] =
TRUSTED MACHINE CODE { PrincOps.zMISC, aTBLLOOKUP };
FOR k: CARDINAL IN [0..TArgs.count) DO
tArgs.dst[k*tArgs.dstSkip] ← tArgs.table[tArgs.src[k*tArgs.srcSkip]];
ENDLOOP;
BltOp: TYPE = MACHINE DEPENDENT { logAdd(0), logSubtract(1), and(2), or(3), xor(4), lastVal(LAST[CARDINAL]) };
OpBltRecord:
TYPE =
MACHINE
DEPENDENT
RECORD[
srcA: LONG POINTER TO CARDINAL,
srcB: LONG POINTER TO CARDINAL,
dst: LONG POINTER TO CARDINAL,
count: CARDINAL,
delta: CARDINAL,
op: BltOp
];
OpBlt:
PROC[ptr:
LONG
POINTER
TO OpBltRecord] =
TRUSTED MACHINE CODE { PrincOps.zMISC, aBlkOp };
FOR k: CARDINAL IN [0..oArgs.count) DO
dst[k*oArgs.delta] ← oArgs.op[a: oArgs.srcA[k*oArgs.delta], b: oArgs.srcB[k*oArgs.delta]];
ENDLOOP;