RWTest:
PROC [baseAddr, dval:
LONG
CARDINAL] ~ {
LRI0ok: Label = GenLabel[];
LRI13ok: Label = GenLabel[];
RRIok: Label = GenLabel[];
ReadBackBad: Label = GenLabel[];
ReadBackBad1: Label = GenLabel[];
ReadBackBad2: Label = GenLabel[];
dvalx: LONG CARDINAL ← dval;
ReserveSpace[baseAddr, baseAddr + 42];
FOR I:
CARDINAL
IN [0..16)
DO
drLIQB[CardToWord[baseAddr + LONG[I]]];
ENDLOOP;
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg0, 0];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg1, 1];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg2, 2];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg3, 3];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg4, 4];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg5, 5];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg6, 6];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg7, 7];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg8, 8];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg9, 9];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg10, 10];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg11, 11];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg12, 12];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg13, 13];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg14, 14];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1; drSRIn[reg15, 15];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drLIQB[CardToWord[baseAddr + 16]];
drWB[16]; --baseAddr + 32
drLIQB[CardToWord[baseAddr + 17]];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drWSB[17]; --baseAddr + 34
drLIQB[CardToWord[baseAddr + 18]];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drPSB[18]; --baseAddr + 36
drDIS[];
dvalx ← dval;
drLRIn[reg0, 0]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJEBJ[popSrc, belowSrcPop, UseLabel8B[LRI0ok]]; SetLabel[ReadBackBad]; Pause[]; SetLabel[LRI0ok];
drLRIn[reg1, 1]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg2, 2]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg3, 3]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg4, 4]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg5, 5]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg6, 6]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg7, 7]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg8, 8]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg9, 9]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg10, 10]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg11, 11]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg12, 12]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad]];
drLRIn[reg13, 13]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJEBJ[popSrc, belowSrcPop, UseLabel8B[LRI13ok]]; SetLabel[ReadBackBad1]; Pause[]; SetLabel[LRI13ok];
drLRIn[reg14, 14]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
drLRIn[reg15, 15]; drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
drLIQB[CardToWord[baseAddr + 16]];
drRB[16]; --baseAddr + 32
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
drLIQB[CardToWord[baseAddr + 17]]; drLIB[17];
drQRX[pushAtop, belowSrc];
drLIQB[CardToWord[dvalx]];
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
drRRX[belowDst, popSrc, belowSrc];
drLIQB[CardToWord[dvalx]]; dvalx ← dvalx + 1;
drLIQB[CardToWord[baseAddr + 18]];
drRSB[18]; --baseAddr + 36
drLIQB[CardToWord[dvalx]];
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
drLIB[18];
drRX[]; --baseAddr + 36 again
drLIQB[CardToWord[dvalx]];
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
drLIQB[CardToWord[baseAddr + 18]];
drROR[aux0, popSrc, topSrc];
drLGF[18]; --baseAddr + 36 again
drLIQB[CardToWord[dvalx]];
drRJNEB[popSrc, belowSrcPop, UseLabel8B[ReadBackBad1]];
Here we want reg0 + 38 = baseAddr + 38 to be the address and reg1 to hold the data being written.
drLIQB[CardToWord[baseAddr]];
drSRn[reg0];
drWRI[reg1, reg0, 38];
Here we want aux2 + 20 = baseAddr + 40 to be the address and reg3 to hold the data being written.
drLIQB[CardToWord[baseAddr + 20]];
drROR[aux2, popSrc, topSrc];
drWAI[reg3, aux2, 20];
Here we want reg0 + 38 to be the address and reg15 to receive the data being read.
drRRI[reg15, reg0, 38];
drLRn[reg15];
drRJEBJ[popSrc, reg1, UseLabel8B[RRIok]]; SetLabel[ReadBackBad2]; Pause[]; SetLabel[RRIok];
Here aux2 + 20 = baseAddr + 40 is the address and reg4 receives the data being read.
drRAI[reg4, aux2, 20];
drLRn[reg4];
drRJNEB[popSrc, reg3, UseLabel8B[ReadBackBad2]];
};