FOR p:
CARDINAL
IN [0..passes)
DO
R/W zero
LogViewer.PutRope["Checking first word of memory...\n"];
XBus.MemWrite[first, 0];
IF (data ← XBus.MemRead[first])#0 THEN ReportError[first, data, 0];
XBus.MemWrite[first, 0FFFFh];
IF (data ← XBus.MemRead[first])#0FFFFh THEN ReportError[first, data, 0FFFFh];
LogViewer.PutRope["Checking last word of memory...\n"];
XBus.MemWrite[last, 0];
IF (data ← XBus.MemRead[last])#0 THEN ReportError[last, data, 0];
XBus.MemWrite[last, 0FFFFh];
IF (data ← XBus.MemRead[last])#0FFFFh THEN ReportError[last, data, 0FFFFh];
left shift a one data bit
LogViewer.PutRope["Checking data bits...\n"];
w ← 1;
FOR i:
NAT
IN [0..dataSize)
DO
XBus.MemWrite[LOOPHOLE[LONG[2*i]], w];
w ← Basics.BITSHIFT[w, 1];
ENDLOOP;
w ← 1;
FOR i:
NAT
IN [0..dataSize)
DO
add ← LOOPHOLE[LONG[2*i]];
IF (data ← XBus.MemRead[add])#w THEN ReportError[add, data, w];
w ← Basics.BITSHIFT[w, 1];
ENDLOOP;
left shift a zero data bit
w ← 0FFFEh;
FOR i:
NAT
IN [0..dataSize)
DO
XBus.MemWrite[LOOPHOLE[LONG[2*i]], w];
w ← Basics.BITSHIFT[w, 1]+1;
ENDLOOP;
w ← 0FFFEh;
FOR i:
NAT
IN [0..dataSize)
DO
add ← LOOPHOLE[LONG[2*i]];
IF (data ← XBus.MemRead[add])#w THEN ReportError[add, data, w];
w ← Basics.BITSHIFT[w, 1]+1;
ENDLOOP;
left shift a one address bit (even addresses only)
LogViewer.PutRope["Checking address bits...\n"];
lc ← 2;
FOR i:
NAT
IN [0..addSize)
DO
XBus.MemWrite[LOOPHOLE[lc], i];
lc ← Basics.DoubleShiftLeft[LOOPHOLE[lc], 1].lc;
ENDLOOP;
lc ← 2;
FOR i:
NAT
IN [0..addSize)
DO
add ← LOOPHOLE[lc];
IF (data ← XBus.MemRead[add])#i THEN ReportError[add, data, i];
lc ← Basics.DoubleShiftLeft[LOOPHOLE[lc], 1].lc;
ENDLOOP;
left shift a zero address bit (even addresses only)
lc ← 0FFFFFCh;
FOR i:
NAT
IN [0..addSize)
DO
XBus.MemWrite[LOOPHOLE[lc], i];
lc ← Basics.DoubleShiftLeft[LOOPHOLE[lc], 1].lc+2;
ENDLOOP;
lc ← 0FFFFFCh;
FOR i:
NAT
IN [0..addSize)
DO
add ← LOOPHOLE[lc];
IF (data ← XBus.MemRead[add])#i THEN ReportError[add, data, i];
lc ← Basics.DoubleShiftLeft[LOOPHOLE[lc], 1].lc+2;
ENDLOOP;
LogViewer.PutRope["Exchange test, increasing addresses...\n"];
FOR i:
LONG
POINTER ← first, i+2
WHILE i#last
DO
XBus.MemWrite[i, 0];
ENDLOOP;
FOR i:
LONG
POINTER ← first, i+2
WHILE i#last
DO
IF (data ← XBus.MemRead[i])#0 THEN ReportError[i, data, 0];
XBus.MemWrite[i, 0FFFFh];
ENDLOOP;
FOR i:
LONG
POINTER ← first, i+2
WHILE i#last
DO
IF (data ← XBus.MemRead[i])#0FFFFh THEN ReportError[i, data, 0FFFFh];
ENDLOOP;
LogViewer.PutRope["Exchange test, decreasing addresses...\n"];
FOR i:
LONG
POINTER ← last, i-2
WHILE i#first
DO
XBus.MemWrite[i, 0];
ENDLOOP;
FOR i:
LONG
POINTER ← last, i-2
WHILE i#first
DO
IF (data ← XBus.MemRead[i])#0 THEN ReportError[i, data, 0];
XBus.MemWrite[i, 0FFFFh];
ENDLOOP;
FOR i:
LONG
POINTER ← last, i-2
WHILE i#first
DO
IF (data ← XBus.MemRead[i])#0FFFFh THEN ReportError[i, data, 0FFFFh];
ENDLOOP;
IF passes>1 THEN LogViewer.PutF["End pass %g\n", IO.int[p]];
ENDLOOP;