kernel.mcFebruary 1, 1980 9:20 PM%1TITLE[KERNEL];IM[ILC,0];TOP LEVEL;* February 1, 1980 9:20 PMrestartDiagnostic:BEGIN:goto[im0];afterKernel1:goto[beginKernel2];afterKernel2:goto[beginKernel3];afterKernel3: goto[beginKernel4];afterKernel4:T_R0;* R0 SHOULD HAVE ZERO IN ITBRANCH[.+2,ALU=0];ERROR;T_(R1)-1;* R1 SHOULD HAVE ONE IN IT.BRANCH[.+2,ALU=0];ERROR;T_R1;T_T+(RM1);* RM1 SHOULD HAVE -1 IN IT;BRANCH[.+2,ALU=0];ERROR;T_100000C;T_T#(RHIGH1);* RHIGH1 SHOULD HAVE 100000BBRANCH[.+2, ALU=0];ERROR;T_R10;* R10 SHOULD HAVE 125252BBRANCH[.+2, ALU<0];ERROR;T_R01;DBLBRANCH[.+1, .+2, ALU<0];ERROR;* R01 SHOULD HAVE 52525B IN ITT_NOT(R01);T_T#(R10);* R01 SHOULD EQUAL NOT(R10);BRANCH[.+2,ALU=0];ERROR;* NOTE THIS IS NOT A COMPLETELY ACCURATE* TEST FOR CONTENTS OF R10, R01!goto[done];* CODE for midas debuggingtop level;set[dbgTbls,100];l1: branch[l1],at[dbgTbls,0];l2:noop,at[dbgTbls,1];branch[l2],at[dbgTbls,2];l3:noop,at[dbgTbls,3];noop,at[dbgTbls,4];branch[l3],at[dbgTbls,5];l4:noop,at[dbgTbls,6];noop,at[dbgTbls,7];noop,at[dbgTbls,10];branch[l4],at[dbgTbls,11];l5:noop,at[dbgTbls,12];noop,at[dbgTbls,13];noop,at[dbgTbls,14];noop,at[dbgTbls,15];branch[l5],at[dbgTbls,16];l6:noop,at[dbgTbls,17];noop,at[dbgTbls,20];noop,at[dbgTbls,21];noop,at[dbgTbls,22];noop,at[dbgTbls,23];branch[l6],at[dbgTbls,24];gp(`;N bAq a _ ^ ]Kp \q1Z Yp 1XUq Wp 1Uq Tp S_q R"p 1Oq'1Ni1M,1J1Is1H61E1D} 1C@1B1? 1>J 1= 1;19T'181614^13 11'1/h 1.* 1,1+'( *r1)4 '1& %| $>pq  #pq1' 1!  pq1' 1H' 1  pq1' 1' 1R'1  pq1'1'1\'1'1  pq1'1f'1)'1 '1 '1 p  "]Mkernel.mcFebruary 1, 1980 9:20 PM%2END;gp(`;N bAq( bkernel1.mcMay 18, 1981 11:08 AM%1* INSERT[D1ALU.MC];* TITLE[PROG1];* INSERT[PREAMBLE.MC];%May 18, 1981 11:08 AMChange "bypass" to save and restore values in RBase 0. Need this because of a change in versionsof d1lang. diagnostic now uses "standard" d1lang.May 8, 1979 11:40 AMAdd RoddByPass tests at enbd of xorBypassMarch 26, 1979 10:58 AMAdd overflow testMarch 10, 1979 6:43 PMAdd test of branch conditions when reschedule is ON.January 18, 1979 5:23 PMRemove checkTaskNum, a temporary kludge that caused reschedTest to fail during task circulation.January 9, 1979 10:44 AMadd reschedTest%%CONTENTSTESTDESCRIPTION(singlestep)Chec RM to T, T to RM movementaluEQ0check the fast branch codealuLT0check the fast branch coderEvencheck the fast branch coderGE0check the fast branch codereschedTestcheck the reschedule/noreschedule fast branchesxorNoBypasstest XOR alu opbypasstest bypass decision logicxorBypasstest XOR alu op, ALLOW BYPASS; R odd bypass test here, too.(alu ops)Test various alu operations (A+1, A+B, A-1,A-B)CarryTest carry fast branch(resched+branches)test effect of resched upon fast branches.freezeBCtestTest Freeze BC function (emulator only)overflowTestTest the overflow fast branch function% bgp );N bAq a _ ^ ]K1\a Z2 Y1XU) W1U T1S_4 Q1PW` N1MO L IHY E Cc   B%  @  ?  >m  =/  / ;   :  9w ; 89 / 6  5 * 4  ( 3C  & 2 /hDR8kernel1.mcMay 18, 1981 11:08 AM%2* September 15, 1978 10:18 AM%SINGLE STEP THIS CODE:A AND B MULTIPLEXORSThe point is to determine if it is possible to move data values thruthe alu into different registers.%top level;kernel1:IM0:T_RM1;*TEST ALL ONES, ALL ZEROS, ALTER. 01, 10NOOP;* USE NOOP TO AVOID BYPASS LOGICIM2:RSCR_T;NOOP;IM4:T_R0;* TEST 0NOOP;IM6:RSCR _ T;NOOP;* NOW MOVE IT THRU A MUXIM14:T_A_RM1;* TEST ALL ONESNOOP;IM16:RSCR _A_ T;NOOP;IM20:T_A_R0;* TEST ALL ZEROSNOOP;IM22:RSCR_ A_T;* CHECK B MUX THRU FF FIELD: SINGLE STEP THIS CODEIM23:T_B0;* check that FF,0 worksIM24:T_77400C;IM25:T_B15;* check that 0,FF worksIM26:T_376C; bgp );N bAq ^ ]+\wD [:! Y V Up T3+(R+ QPz O=+M LK I  F+EQ D B A+@[ ? <2 :'+ 8 7+ 6o 2:5kernel1.mcMay 18, 1981 11:08 AM%3* September 15, 1978 10:19 AM%END SINGLE STEPPING !!!GIVEN SIMPLE A AND B PATHS, VALIDATE:RESULT=0RESULT<0R>=0R EVENCNT=0&+1%%TEST ALU=0 BY CHECKING EVERY BIT IN THE WORD: GET CONSTANTS FROMFF AND CHECK THEM FOR =0. USE BYPASS LOGIC!!These tests assume that there is no difference between amux source and bmux source for fast branches.ACTUALLY, the initial set of tests will check amuxsources too!T contains the value received.%aluEQ0FF:t_B0;skpUnless[ALU=0],rscr_(A_t);* check it thru Amuxerror;* Thinks bit0 is zeroskpUnless[ALU=0];error;* Thinks bit0 is zerot_B1;skpUnless[ALU=0],rscr_(A_t);* check it thru AmuxaluEq0FFB1:error;* Thinks bit1 is zeroskpUnless[ALU=0];error;* Thinks bit1 is zeronoop;*here for placement.t_B2;skpUnless[ALU=0],rscr_(A_t);* check it thru AmuxaluEq0FFB2:error;* Thinks bit2 is zeroskpUnless[ALU=0];error;* Thinks bit2 is zerot_B3;skpUnless[ALU=0],rscr_(A_t);* check it thru Amuxerror;* Thinks bit3 is zeroskpUnless[ALU=0];error;* Thinks bit3 is zerot_B4;skpUnless[ALU=0], rscr_(A_t);* check it thru AmuxaluEq0FFB4:error;* Thinks bit4 is zeroskpUnless[ALU=0];error;* Thinks bit4 is zerot_B5;skpUnless[ALU=0], rscr_(A_t);* check it thru Amuxerror;* Thinks bit5 is zeroskpUnless[ALU=0];error;* Thinks bit5 is zeronoop;* here for placement.t_B6;skpUnless[ALU=0], rscr_(A_t);* check it thru AmuxaluEq0FFB6:error;* Thinks bit6 is zeroskpUnless[ALU=0];error;* Thinks bit6 is zero bgp );N bAq `0^[:%YXWVDU S PzA O=, Le K2 JG G F EQpqDB+A+@[?+<x;e+ :'p q8+76o+3x+x2x1y+ 0;p q.+-,+*x(+'+&O%+"!Y+ p q+c+x+m+0+wx+x:x+ p q + D + D](Skernel1.mcMay 18, 1981 11:08 AM%4t_B7;skpUnless[ALU=0], rscr_(A_t);* check it thru Amuxerror;* Thinks bit7 is zeroskpUnless[ALU=0];error;* Thinks bit7 is zerot_B8;skpUnless[ALU=0], rscr_(A_t);* check it thru AmuxaluEq0FFB8:error;* Thinks bit8 is zeroskpUnless[ALU=0];error;* Thinks bit8 is zerot_B9;skpUnless[ALU=0], rscr_(A_t);* check it thru Amuxerror;* Thinks bit9 is zeroskpUnless[ALU=0];error;* Thinks bit9 is zeronoop;* here for placement.t_B10;skpUnless[ALU=0], rscr_(A_t);* check it thru AmuxaluEq0FFB10:error;* Thinks bit10 is zeroskpUnless[ALU=0];error;* Thinks bit10 is zerot_B11;skpUnless[ALU=0], rscr_(A_t);* check it thru Amuxerror;* Thinks bit11 is zeroskpUnless[ALU=0];error;* Thinks bit11 is zerot_B12;skpUnless[ALU=0], rscr_(A_t);* check it thru AmuxaluEq0FFB12:error;* Thinks bit12 is zeroskpUnless[ALU=0];error;* Thinks bit12 is zerot_B13;skpUnless[ALU=0], rscr_(A_t);* check it thru Amuxerror;* Thinks bit13 is zeroskpUnless[ALU=0];error;* Thinks bit13 is zeronoop;* here for placement.t_B14;skpUnless[ALU=0], rscr_(A_t);* check it thru AmuxaluEq0FFB14:error;* Thinks bit14 is zerorscr_(A_t);* check it thru AmuxskpUnless[ALU=0];error;* Thinks bit14 is zerot_B15;skpUnless[ALU=0], rscr_(A_t);* check it thru Amuxerror;* Thinks bit15 is zeroskpUnless[ALU=0];error;* Thinks bit15 is zero% TEST ALU=0 BY PASSAGE THRU RM AND PASSAGE THRU TFor all the alu=0 tests, an error implies the wrong branch was taken.The known values in RM are used to test the branchAVOID BYPASS LOGIC!% bgp );Naq_+^+]K\+YXU+ Wp qU+TS_+PxO+Ni+M,K+Is+H6F+ Ep qD}+C@B+?x>J+= +;:+8x6+ 5p q4^+3 1+/hx.*+,++*r+'x+x&x%|+ $>p q#+! + H+x+R++  1fE)2  p 2%]Wkernel1.mcMay 18, 1981 11:08 AM%5aluEq0RT:t_r0;skpif[alu=0];error;* Thinks r0 is zerorscr_t;skpif[alu=0],t_r1;error;skpUnless[alu=0];error;* Thinks r1 is zerorscr_t;skpUnless[alu=0],t_rm1;error;aluEq0RTM1:skpUnless[alu=0];error;* Thinks rm1 is zerorscr_t;skpUnless[alu=0],t_r1;error;skpUnless[alu=0];error;* Thinks r1 is zerorscr_t;skpUnless[alu=0],t_r01;error;aluEq0RT01:skpUnless[alu=0];error;* Thinks r01 is zerorscr_t;skpUnless[alu=0],t_r10;error;skpUnless[alu=0];error;* Thinks r10 is zerorscr_t;skpUnless[alu=0],t_rhigh1;error;skpUnless[alu=0];error;* Thinks rhigh1 is zerorscr_t;skpUnless[alu=0];error; bgp );N bAqa_ ^+]K\ZXUW+UTS_ Pp qONi+M,KJH6F+ED}C@ @p q?>J+= ;:86+54^3 0/h+.*,+b )/]>kernel1.mcMay 18, 1981 11:08 AM%6% TEST RESULT <0For all the alu<0 tests, an error implies the wrong branch was taken.The known values in RM are used to test the branchAVOID BYPASS LOGIC%aluLT0RT:t_rhigh1;skpif[alu<0];error;* Thinks rhigh1 >=0rscr_t;skpif[alu<0];error;* Thinks T (=RIGH1) >=0t_r10;skpif[alu<0];aluLT0RT10:error;* Thinks r10 >= 0rscr_t;skpif[alu<0];error;* Thinks T (=r10) >=0t_r1;skpUnless[alu<0];aluLT0RT1:error;* Thinks r1<0rscr_t;skpUnless[alu<0];error;* Thinks T (=r1) >=0t_r01;skpUnless[alu<0];aluLT0RT01:error;* Thinks r10 >= 0rscr_t;skpUnless[alu<0];error;* Thinks T (=r10) >=0* TEST FOR RESULT EVENrEven:skpif[r even], t_r0;error;* thinks r0 oddskpUnless[r even], t_r1;error;* Thinks r1 EVENskpif[r even], t_rhigh1;error;* Thinks rhigh1 ODDskpUnless[r even], t_r01;error;* Thinks r01 EVENskpif[r even], t_r10;error;* Thinks r10 ODDrGE0:skpif[r >=0],t_r1;error;* Thinks r1 <0skpif[r>=0],t_r01;error;* Thinks r01 <0skpif[r>=0],t_r0;error;* Thinks r0 <0skpUnless[r>=0],t_rm1; bgp );N aq _]KE\2Y XU WpqUT S_+R"P O+M,K Jp qIs+H6F E+C@B @pq?+ >J= ;+9T8 6p q5+4^3 1+ , *rpq)4'+%|$>+! + +R+ pq\+ f+  +  3 2%]kernel1.mcMay 18, 1981 11:08 AM%7error;* Thinks RM1>=0skpUnless[r>=0],t_rhigh1;* Thinks rhigh1 >=0error; bgp );NbAq+_+^j \T, 'kernel1.mcMay 18, 1981 11:08 AM%8* January 9, 1979 10:42 AM%reschedTestSet and clear resched; see if we can branch on its value.%reschedTest:call[checkTaskNum], t_t-t;skpif[ALU=0];branch[afterResched];noreschedule[];skpif[reschedule'];reschedErr1:* we just cleared resched, yeterror;* branch condition thinks it is set.reschedule[];skpif[reschedule];reschedErr2:* we just set resched, yet theerror;* branch condition doesn't realize it.noreschedule[];afterResched: bgp );N bAq a_p ^q9 ]K \p ZqY XUUT S_p +qR"+$O Ni M,p +qK+&J Isp  H9qikernel1.mcMay 18, 1981 11:08 AM%9% September 15, 1978 10:56 AM TEST XOR USING ALU=0. USE NOOP TO AVOID BYPASS.Generally, T _ RSCR_ someFFconstant;T _ T#(RSCR)IF T is non zero, there was an error: one bits in T indicatethe problem.%xorNoBypass:t_(rscr)_B0;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B0 xor (RSCR) ) NE 0t_(rscr)_B1;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B1 xor (RSCR) ) NE 0xorNoBypassB2:t_(rscr)_B2;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B2 xor (RSCR) ) NE 0t_(rscr)_B3;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B3 xor (RSCR) ) NE 0t_(rscr)_B4;noop; t_t#(rscr);skpif[alu=0];xorNoBypassB4:error;* (T _ B4 xor (RSCR) ) NE 0t_(rscr)_B5;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B5 xor (RSCR) ) NE 0xorNoBypassB6:t_(rscr)_B6;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B6 xor (RSCR) ) NE 0t_(rscr)_B7;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B7 xor (RSCR) ) NE 0xorNoBypassB8:t_(rscr)_B8;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B8 xor (RSCR) ) NE 0t_(rscr)_B9;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B9 xor (RSCR) ) NE 0xorNoBypassB10:t_(rscr)_B10;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B8 xor (RSCR) ) NE 0 bgp );N bAq a _0]K$\ Z<Y XU Up qT S_R" P+Ni M,K J+ H6p qF ED} C@+@ ?>J = +: 9T8 6p q5+3 10 /h+ ,p q+ *r)4 '+%| $># !+ Hp q  R+ \ + fp q)    p+v 2 ]kernel1.mcMay 18, 1981 11:08 AM%10t_(rscr)_B11;noop; t_t#(rscr);skpif[alu=0];error;* (T _ B10 xor (RSCR) ) NE 0t_(rscr)_B12;noop;t_t#(rscr);skpif[alu=0];xorNoBypassB12:error;* (T _ B12 xor (RSCR) ) NE 0t_(rscr)_B13;noop;t_t#(rscr);skpif[alu=0];error;* (T _ B13 xor (RSCR) ) NE 0xorNoBypassB14:t_(rscr)_B14;noop;t_t#(rscr);skpif[alu=0];error;* (T _ B14 xor (RSCR) ) NE 0t_(rscr)_B15;noop;t_t#(rscr);skpif[alu=0];error;* (T _ B15 xor (RSCR) ) NE 0 bgp );NbAq a_ ^+\ ZY XUp qW+T S_R" P+ Nip qM, KJ Is+F ED} C@+ A2&,rkernel1.mcMay 18, 1981 11:08 AM%11* May 18, 1981 11:12 AM% bypassThis code checks the decision portion of the bypass circuitry. There are at least two differentissues associated with bypass: 1) should a bypass be done, and 2) do the bypass data paths work. Thistest addresses point 1.%rvrel[rmx10, 10];bypass:RBASE _ 0s;q_ rmx0;t_rmx0_cm1;* this is the old, stable versionrmx0_t-t;* this is the new versiont_rmx0;* should use bypassed version of rmx0skpif[alu=0], rmx0_q;* RESTORE rmx0 here.bypassErr0:* bypass associated w/ rm addr 0 doesn'terror;* seem to workq_ rmx1;t_rmx1_cm1;* this is the old, stable versionrmx1_t-t;* this is the new versiont_rmx1;* should use bypassed version of rmx1skpif[alu=0], rmx1_q;* RESTORE rmx1 here.bypassErr1:* bypass associated w/ rm addr 1 doesn'terror;* seem to workq_ rmx2;t_rmx2_cm1;* this is the old, stable versionrmx2_t-t;* this is the new versiont_rmx2;* should use bypassed version of rmx2skpif[alu=0], rmx2_q;* RESTORE rmx2 here.bypassErr2:* bypass associated w/ rm addr 2 doesn'terror;* seem to workq_ rmx4;t_rmx4_cm1;* this is the old, stable versionrmx4_t-t;* this is the new versiont_rmx4;* should use bypassed version of rmx4skpif[alu=0], rmx4_q;* RESTORE rmx4 here.bypassErr4:* bypass associated w/ rm addr 4 doesn'terror;* seem to workq_ rmx10;t_rmx10_cm1;* this is the old, stable versionrmx10_t-t;* this is the new versiont_rmx10;* should use bypassed version of rmx10skpif[alu=0], rmx10_q;* RESTORE rmx10 here.bypassErr10:* bypass associated w/ rm addr 10 doesn'terror;* seem to work%This section of the test works by changing Rbase.%RBASE _ 2s;t_rmx0_cm1;* this is the old, stable versionrmx0_t-t;* this is the new versiont_rmx0;* should use bypassed version of rmx0skpif[alu=0];bypassErr20:* bypass associated w/ rm addr 20 doesn'terror;* seem to workRBASE _ 4s;t_rmx0_cm1;* this is the old, stable versionrmx0_t-t;* this is the new versiont_rmx0;* should use bypassed version of rmx0skpif[alu=0];bypassErr40:* bypass associated w/ rm addr 40 doesn'terror;* seem to workRBASE _ 10s;t_rmx0_cm1;* this is the old, stable versionrmx0_t-t;* this is the new versiont_rmx0;* should use bypassed version of rmx0skpif[alu=0]; bgp );N bAq ap_q_ ^e ]K \ Z YpXUq WU +!T+S_+%R"+ Pp +q(O+ M,K +!J+Is+%H6+ Fp +q(E+ C@B +!@+?+%>J+ = p +q(;+ 9T8 +!6+5+%4^+ 3 p +q(1+ /h.* +!, +++&*r+ )4p +q)'+ &%|1 $># ! +! +H+% p +q)+   +!+\+% p +q)+ )  +! + p+% 3  D]lkernel1.mcMay 18, 1981 11:08 AM%12bypassErr100:* bypass associated w/ rm addr 100 doesn'terror;* seem to workRBASE _ rbase[defaultRegion]; bgp );N bA +q*a+ ^ ](+!  H  + R  p q+   f+   p 3p q 2 ]kernel1.mcMay 18, 1981 11:08 AM%14error;* (T _ B10 xor (RSCR) ) NE 0t_(rscr)_B11;t_t#(rscr);skpif[ALU=0];error;* (T _ B11 xor (RSCR) ) NE 0t_(rscr)_B12;t_t#(rscr);skpif[ALU=0];xorBypassB12:error;* (T _ B12 xor (RSCR) ) NE 0t_(rscr)_B13;t_t#(rscr);skpif[ALU=0];error;* (T _ B13 xor (RSCR) ) NE 0t_(rscr)_B14;t_t#(rscr);skpif[ALU=0];xorBypassB14:error;* (T _ B14 xor (RSCR) ) NE 0t_(rscr)_B15;t_t#(rscr);skpif[ALU=0];error;* (T _ B15 xor (RSCR) ) NE 0rscr _ t-t;rscr _ 1c;skpif[R ODD], rscr;RoddByPassErr0:* fast branch r odd bypass doesn't workerror;* Rscr has 1 in itrscr _ t-t;skpUnless[R ODD], rscr;RoddByPassErr1:* fast branch r odd bypass doesn't work.error;* rscr has zero in it. bgp );NbAq+_ ^ ]K \+Y XU W Up qT+R" P O Ni+K J Is H6p qF+D} C@ B @+=v <8 : 9p+q'8+6 4 3p+q(2L+ 0:7kernel1.mcMay 18, 1981 11:08 AM%15* August 30, 1977 6:29 PM%TEST ALU ADDITION AND SUBTRACTION:A+1A+BA-1 A-B%Aplus1:t_(r0)+1;* 1=t_r0+1t_(r1)#t;skpif[alu=0];error;Aplus1b:t_(rm1)+1;* 0=t_rm1+1skpif[alu=0];error;Aplus1c:rscr_CM2;t_(rscr)+1;t_t#(rm1);* (T=-1)=-2+1skpif[alu=0];error;Aplus1d:rscr_5C;t_(rscr)+1;rscr_6C;t_t#(rscr);* (T=6)=5+1skpif[alu=0];error;AplusB:t_r0;t_t+(r0);* 0=0+0skpif[alu=0];error;AplusBb:t_r1;t_t+(r0);t_t#(r1);* 1=1+0skpif[alu=0];error;AplusBc:t_r0;t_t+(r1);t_t#(r1);* 1=0+1skpif[alu=0];error;AplusBd:t_rm1;t_t+(r0);t_t#(rm1);* -1=-1+0skpif[alu=0];error;AplusBe:t_rm1;t_t+(rm1);rscr_177776C;t_t#(rscr);* -2=-1+-1skpif[alu=0];error;AplusBf:t_rm1;t_t+(r1);* 0=-1+1skpif[alu=0];error; bgp );N bAq a_"^ ]K ZpqY+ XUW U S_pqR" + P O M,pqKJ Is + H6 F D}pqC@B @? + >J =  :pq9T8+6 5 3 pq10/h+.* , *rpq)4'&+%| $> !pq H +  pq \  +   )pq  + p  3 (]kernel1.mcMay 18, 1981 11:08 AM%16AplusBg:t_r1;t_t+(rm1);* 0=1+-1skpif[alu=0];error;AplusBh:t_r01;t_t+(r10);t_t#(rm1);* -1=52525+125252skpif[alu=0];error;AplusBi:t_r10;t_t+(r01);t_t#(rm1);* -1=125252+52525skpif[alu=0];error;AplusBj:t_rhigh1;t_t+(rhigh1);*0=100000+100000skpif[alu=0];error;AplusBk:t_rhigh1;t_t+(rm1);rscr_77777C;t_t#(rscr);* 77777=100000+177777skpif[alu=0];error;AplusBl:t_rm1;t_t+(rhigh1);rscr_77777C;t_t#(rscr);* 77777=177777+100000skpif[alu=0];error;* August 9, 1977 12:30 PM%TEST A-1%Aminus1:rscr_r0;Aminus1L:* CHECK A-1 IN A LOOP FOR ALL 16 BIT VALUES.t_(rscr)-1;t_t+1;t_t#(rscr);* t_ (rscr-1+1) xor rscrskpif[alu=0];error;rscr_(rscr)+1;* rscr IS LOOP CTRLdblBranch[.+1,Aminus1L,ALU=0]; bgp );N aq_^ +]K \ YpqXUW U +T S_ PpqONi M, +K J H6pqFE +D} C@ @pq?>J = ; +: 9T 6pq54^ 3 1 +0 /h .* ,+ *r 'pq& %|pq+,$> #! + H + m=yLkernel1.mcMay 18, 1981 11:08 AM%17*%TEST A-B%aMinusB:t_r0;t_t-(r1);* T _ 0 -1t_t#(rm1);skpif[alu=0];error;* T SHOULD HAVE BEEN -1aMinusBb:t_r0;t_t-(rm1);* t_0 - (-1)t_t#(r1);skpif[alu=0];error;* T SHOULD HAVE BEEN 1aMinusBc:t_r0;t_t-(rhigh1);* t_ 0 - (100000)t_t#(rhigh1);skpif[alu=0];error;* T SHOULD HAVE BEEN 100000aMinusBd:t_100C;t_t-(r1);* t _ 100 -1rscr_77C;t_t#(rscr);skpif[alu=0];error;* T SHOULD HAVE BEEN 77aMinusBe:t_rscr_17C;t_t-(rscr);* t _ 17 - 17t_t#(r0);skpif[alu=0];error;* T SHOULD HAVE BEEN 0aMinusBf:t_rscr_177C;t_t-(rscr);* t _ 177 - 177t_t#(r0);skpif[alu=0];error;* T SHOULD HAVE BEEN 0aMinusBg:t_rscr_377C;t_t-(rscr);* t _ 377 - 377t_t#(r0);skpif[alu=0];error;* T SHOULD HAVE BEEN 0aMinusBh:t_rscr_400C;t_t-(rscr);* t _ 400 - 400t_t#(r0);skpif[alu=0];error;* T SHOULD HAVE BEEN 0aMinusBi:t_rscr_777C;t_t-(rscr);* t _ 777 - 777t_t#(r0);skpif[alu=0];error;* T SHOULD HAVE BEEN 0aMinusBj:t_rscr_1777C;t_t-(rscr);* t _ 1777 - 1777t_t#(r0); bgp );N bAq a_ ^ ]Kpq\Z+ Y XU W+ TpqS_R" + PO Ni+ KpqJIs +H6 F E+ C@pqB@+ ?>J = ;+ 9Tpq8 6 + 54^ 3 + 0pq/h .* +,+ *r+ 'pq& %| +$># !+ Hpq  +R + pq\  + f+ pq  p + 3 2 ]*kernel1.mcMay 18, 1981 11:08 AM%18skpif[alu=0];error;* T SHOULD HAVE BEEN 0 bgp );NbAq a+L ](. !kernel1.mcMay 18, 1981 11:08 AM%19* January 18, 1979 5:24 PM%TEST FAST BRANCH CONDITION: CARRYFIRST TEST WHEN WE KNOW THERE IS NO CARRY, THEN TRY TOGENERATE A CARRY AND BRANCH ON IT. NOTE: THIS CODE DEPENDS UPONTHE ALU FUNCTIONS PLUS AND MINUS WORKING.%carryNo:t_(r0)+(r0);skpUnless[carry];error;* r0 + r0 SHOULD NOT CAUSE CARRYcarryNob:t_rm1;t_t+(r0);skpUnless[carry];error;* rm1 + r0 SHOULD NOT CAUSE CARRYcarryNoc:t_r10;t_t+(r01);skpUnless[carry];error;* r10 + r01 SHOULD NOT CAUSE CARRYcarryNod:t_77777C;t_t+(r0);skpUnless[carry];error;* 77777C + r0 SHOULD NOT CAUSE CARRYcarryNoe:t_r0;t_t+(r1);skpUnless[carry];error;* r0 + r1 SHOULD NOT CAUSE CARRYcarryNof:t_r01;t_t-(r10);skpUnless[carry];error;* r01 - r10 SHOULD NOT CAUSE CARRYcarryNog:t_r0;t_t-(r10);skpUnless[carry];error;* r0 + r10 SHOULD NOT CAUSE CARRY* NOW TRY SOMETHINGS THAT SHOULD GENERATE A CARRYcarryYes:t_rm1;t_t-(r1);skpif[carry];error;* -1 -(+1) SHOULD CAUSE CARRYcarryYesb:t_rm1;t_t+(rhigh1);skpif[carry];error;* -1 + 100000 SHOULD CAUSE CARRYcarryYesc:t_rm1;t_t+(r1);skpif[carry];error;* -1 + 1 SHOULD CAUSE CARRYcarryYesd:t_rhigh1;t_t-(r01); bgp );N bAq a_!]K6\?Z) Y XUpqW UT+ R"pqPONiM,+! JpqIsH6 FE+" C@pqB@?>J+$ ;pq:9T86+ 4^pq3 1 0/h+" ,pq+*r )4'+! %|1 #pq! H  + pqR  + pqf )+ pq p 3 ` 8(]kernel1.mcMay 18, 1981 11:08 AM%20skpif[carry];error;* 100000 - r01 SHOULD CAUSE CARRYcarryYese:t_rhigh1;t_t+(rhigh1);skpif[carry];error;* 100000 + 100000 SHOULD CAUSE CARRY* NOW COMPLICATE THINGS INTERLEAVING ALU OPS W/ TESTScarryOps:t_r0;t_t-(r1);* t_0-1skpUnless[carry],t_t+(rm1);* t_-1+-1error;* 0-1 SHOULD NOT CAUSE CARRYcarryOpsb:skpif[carry], t_t+(rhigh1);* T _ -2+100000error;* -1+-1 SHOULD CAUSE CARRYcarryOpsc:skpif[carry],t_t+(rhigh1);* t_ 77776 + 100000error;* -2 + 100000 SHOULD CAUSE CARRYcarryOpsd:skpUnless[carry];error;* 77776 + 100000 SHOULD NOT CAUSE CARRYcarryOpse:t_rm1;t_t-(r1);* t_ -1-(+1)skpif[carry],t_t-(r01);* t_ -2 -r01error;* -1-1 SHOULD CAUSE CARRYcarryOpsf:skpif[carry];error;* 177776 - 52525 SHOULD CAUSE CARRYreschedule; bgp );NbAq a+! ^pq]K\ Z Y+$ W5 TpqS_R"+P+O+ M,pqK+J+ H6pqF+E+ C@pqB@+' >Jpq= ;+ :+ 9T+ 6pq5 4^+#3  1:,6Kkernel1.mcMay 18, 1981 11:08 AM%21* March 10, 1979 6:42 PM* test the branch conditions when reschedule is ONt_r0;t_t-(r1);* t_0-1skpUnless[carry],t_t+(rm1);* t_-1+-1error;* 0-1 SHOULD NOT CAUSE CARRYcarryOpsRb:skpif[carry], t_t+(rhigh1);* T _ -2+100000error;* -1+-1 SHOULD CAUSE CARRYcarryOpsRc:skpif[carry],t_t+(rhigh1);* t_ 77776 + 100000error;* -2 + 100000 SHOULD CAUSE CARRYcarryOpsRd:skpUnless[carry];error;* 77776 + 100000 SHOULD NOT CAUSE CARRYcarryOpsRe:t_rm1;t_t-(r1);* t_ -1-(+1)skpif[carry],t_t-(r01);* t_ -2 -r01error;* -1-1 SHOULD CAUSE CARRYcarryOpsRf:skpif[carry];error;* 177776 - 52525 SHOULD CAUSE CARRYt_r0;skpif[ALU=0];rescheq0br:error;t_r1;skpif[ALU#0];reschne0br:error;skpif[r even], B_r0;reschevenbr:error;skpif[r odd], B_r1;reschoddbr:error;t_rhigh1;skpif[alu<0];reschlt0br:error;t_r0;skpif[alu>=0];reschge0br:error;noreschedule; bgp );N bAq a2_^+]K+\+ Zp qY+XU+ Up qT+S_+ Pp qONi+' Kp qJIs+ H6+ F+ D}p qC@ B+#?>J = p q;:9T 8p q65 4^p q3 1 0p q/h.*, +p q*r)4' &p q%|! V %:,Hkernel1.mcMay 18, 1981 11:08 AM%22* September 15, 1978 11:38 AM%TEST FREEZEBC FUNCTIONGenerate the two different branch conditions and freeze them. Force thecarry to be explicitly different, see if the frozen branch is still there.Unfreeze and make sure the expected results happen.%freezeBCtest:t_rm1;t_t+(r1);* t_ 0 _ -1+1 (SHOULD CAUSE carry)skpif[carry],t_t+(r1),freezeBC;* FREEZE[carry=1]error;* carry WAS FROZEN. CONTINUE THAT WAY (carry_1, RESULt_0)freezeBC1a:skpif[alu=0],freezeBC;* ( result was ZERO)error;t_(rm1)+(rm1),freezeBC;* Would normally CAUSE RESULT <0skpif[alu>=0],freezeBC;* ( result was ZERO)error;freezeBC1b:t_(r1)+(r1),freezeBC;* t_ 0+1 (carry Would NORMALLY BE ZERO)skpif[carry],freezeBC;error;t_tAND(rm1),freezeBC;* t_1 and -1 (TEST IT A FEW MORE TIMES)skpif[carry],freezeBC;error;* carry SHOULD HAVE BEEN 1freezeBC1c:t_t+(r0),freezeBC;* t_1+0skpif[carry],freezeBC;error;* carry SHOULD HAVE BEEN 1* ALLOW A NEW alu RESULT CONDITION, KEEP carry THE SAME(carry=1, RESULT=77777)freezeBC2a:t_rm1,freezeBC;t_t+(rhigh1);* carry_1, RESULt_77777t_(r0)+(r0),freezeBC;skpif[alu#0],freezeBC;* result was 77777error;freezeBC2b:t_t+(r0),freezeBC;* Would normally ZERO carryskpif[carry],freezeBC;* carry SHOULD BE ONEerror;freezeBC2c:t_rm1,freezeBC;t_t+(r0),freezeBC;skpif[alu>=0],freezeBC;* result was 77777error;* FORCE carry_0, RESULt_0t_r0,freezeBC;t_t+(r0);* t_0+0 (SHOULD CAUSE carry_0, RESULt_0)t_(rhigh1)+(rhigh1),freezeBC;* Would NORMALLY CAUSE carry_1freezeBC3a:skpUnless[carry],freezeBC;* FREEZE IT AT ZEROerror;* EXPECTED 0 carry GOT 1 carryt_(r1)+(r1),freezeBC;skpif[alu=0],freezeBC;* test it again just to seeerror;freezeBC3b:t_(rm1)+(rm1),freezeBC; bgp );N bAq a_ ]KG \J Z3 XU Wp q1U1T"1S_$1R" O9 Nip q1M,1K1Is!1H61F D}p q1C@'1B1@1>J'1= 1;' 9Tp q181615' 3 N 1p q101/h 1.*1,1+ )4p q1'1&1%| #p q1!1 1H1  1R 1(1"  \p q1" 1'1f1)1  pp q1 3 4g]kernel1.mcMay 18, 1981 11:08 AM%23skpif[alu>=0],freezeBC;* test it again just to seeerror;* FORCE carry_0, RESULT _ -1t_(rm1)+(rm1);t_t+(r1);* -2+1 ==> carry_0, RESULt_-1freezeBC4a:t_t+(r1),freezeBC;* -1+1 Would normally CAUSE carry_1skpUnless[carry],freezeBC;error;freezeBC4b:t_(r1)+(r1),freezeBC;*Would normally CAUSE alu>=0skpUnless[alu>=0],freezeBC;error;freezeBC4c:skpUnless[alu=0];error; bgp );N1bAq1a ^1]K 1\ Yp q1XU#1W1U S_p q1R"1P1O M,p q1K1J IP&e]kernel1.mcMay 18, 1981 11:08 AM%24* March 26, 1979 11:04 AM%*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++overflowTestPerform an exhaustive test of the overflow condition. Even though we expect the arithmetic result ofRM+T to be identical to T+RM, we test all possible combinations since the arithmetic gets implementedinside a rather complicated chip.The tables below show the aluA and aluB inputs, and the carry out values for b0, b1. Notice thecontents of the table are not the sum of a,b, but the carry out values. The subtraction table showsthe original input for B and then its converted value after the number gets converted to a twoscomplement value (the chip converts it to the twos complement form, then adds).For AdditionB input=00011011A input00000000000100010011Notice these values represent the carry out values1000001010for b0,b1 during addition. They presume carry-in to1100111011b1 is zero%*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++mc[x01, 40000];mc[x10, 100000];mc[x11, 140000];overflowTest:t _ t-t;t _ t + t;skpif[overflow'];overflErr0:* 0+0 should not cause overflowerror;t_t-t;t_t+(x01);skpif[overflow'];overflErr1:* see 0 + 01 entryerror;t _ t-t;t _ t + (x10);skpif[overflow'];overflErr2:* see 0 + 10 entryerror;t_t-t;t_t+(x11);skpif[overflow'];overflerr3: * see 0 + 11 entryerror;t_rscr_x01;* keep x01 in rscr for a whilet _ t + (0c);skpif[overflow'];overflErr4:* see 01 + 0 entryerror;t_rscr;t _ t + (x01);skpif[overflow];* FIRST TRY FOR OVERFLOWoverflErr5:* see 01 + 01 entryerror;t_rscr;t _ t + (x10);skpif[overflow'];overFLerr6:error;* see 01 + 10 entryt_rscr;t_t+(x11);skpif[overflow'];overflErr7:* see 01 + 11 entryerror;t_rscr_x10;* keep x10 in rscr for a whilet _ t + (0c);skpif[overflow'];overflErr10:* see 10 + 0 entryerror;t_rscr;t _ t + (x01);skpif[overflow']; bgp );N bAq a@*_p ^qe ]Ke \! Z4pq Yd XU_ WO*Up 1Tq@S_@R"j@Pj%2@Oj%4@Nij% K@ J Is H6 Fp EqD} C@ Bp +q@?>J =  ;p +q:9T8 6 5p +q4^3 1 0 /hp q.*, ++ *r )4p +q'&%| $>+ #p +q! H   p q+R  p +q\ + f )p +q   p  30 D]ekernel1.mcMay 18, 1981 11:08 AM%25overflErr11:* see 10 + 01 entryerror;t_rscr;t _ t + (x10);skpif[overflow];overfLerr12:error;* see 10 + 10 entryt_rscr;t_t+(x11);skpif[overflow];overflErr13:* see 10 + 11 entryerror;t_rscr_x11;* keep x11 in rscr for a whilet _ t + (0c);skpif[overflow'];overflErr14:* see 11 + 0 entryerror;t_rscr;t _ t + (x01);skpif[overflow'];overflErr15:* see 11 + 01 entryerror;t_rscr;t _ t + (x10);skpif[overflow];overFLerr16:error;* see 11 + 10 entryt_rscr;t_t+(x11);skpif[overflow'];overflErr17:* see 11 + 11 entryerror;goto[afterKernel1]; bgp );N bA +qa_^ ]K \p Zq+YXU W Up +qTR" +P O Nip +qM,KJ Is H6p +qFED} C@ Bp @q+?>J =  ;p +q: 9T2 740kernel2.mcJanuary 18, 1979 2:07 PM%1* INSERT[D1ALU.MC];* TITLE[KERNEL2];* INSERT[PREAMBLE.MC];top level;beginKernel2:%January 20, 1978 3:13 PM%%TESTCONTENTScntRWread and write CNTcntFFrwread and write CNT, load from FFcntFcntest CNT=0&+1 fast branchNotAtesttest alu op, NOT ANotBtesttest alu op, NOT BAandBtesttest alu op, A AND BAorBtesttest alu op, A OR BLINKRWread and write LINKcallTestglobal and local subroutine callsQtestRWread and write Q, q lsh 1, q rsh 1tioaTestload and read tioa from FF and from bmuxSTKPtestRWread and write STKP, perform TIOA&STKPrstkTest0write different RM address from one read%%January 18, 1979 2:07 PMAdd tioaTest%`gp (< N bAq a _ ^ ]Kp \qZ Y W U T S_ R" P O Ni M, K J! Is" H6( F & E( D} C@ B@ ? <) +"kernel2.mcJanuary 18, 1979 2:07 PM%2* October 19, 1978 5:22 PM% TEST ALL THE BITS IN CNT: REMEMBER THAT CNT CAN BE LOADED FROMBOTH B AND FF.%cntRW:t _ cnt _ r0;* test loading cnt w/ 0rscr _ cnt;t _ t # (rscr);* t _ bits read from cnt # expected bitsskpif[ALU=0];cntErr1:* t = bad bits, rscr = expectederror;* value of cntt _ cnt _ rm1;* test loading cnt w/ -1rscr _ cnt;t _ t # (rscr);* t _ bits read from cnt # expected bitsskpif[ALU=0];cntErr2:* t = bad bits, rscr = expectederror;* value of cntt _ cnt _ r01;* test loading cnt w/ alternating 01rscr _ cnt;t _ t # (rscr);* t _ bits read from cnt # expected bitsskpif[ALU=0];cntErr3:* t = bad bits, rscr = expectederror;* value of cntt _ cnt _ r10;* test loading cnt w/ alternating 10rscr _ cnt;t _ t # (rscr);* t _ bits read from cnt # expected bitsskpif[ALU=0];cntErr4:* t = bad bits, rscr = expectederror;* value of cnt* October 19, 1978 8:33 PMcntFFrw:* TEST FF BITS FOR LOADING cntcnt_1S;t_cnt;t_t#(r1);* we set it to 1; check the val.skpif[ALU=0];cntFFrw1:* t=bad bits, 1=expected valueerror;cnt _ 2s;t_cnt;t _ t # (2c);skpif[ALU=0];cntFFrw2:* t = bad bits, 2 = expected valueerror;cnt _ 4s;t _ cnt;t _ t # (4c);skpif[ALU=0];cntFFrw3:* t = bad bits, 4 = expectederror;cnt _ 10s;t _ cnt;t _ t # (10c);skpif[ALU=0];cntFFrw4:* t = bad bits, 10c = expectederror;`gp (< N bAq a_?^ ]K YpqXU +W U+(T S_p+qR"+ O +Ni M,+(K Jp+qIs+ F +$E D}+(C@ Bp+q@+ >J +$= ;+(: 9Tp+q8+ 5 4^pq+3 10+/h .*p+q,*r)4' & %|p+q"$>! H  p+q  \ p+q& C:Wkernel2.mcJanuary 18, 1979 2:07 PM%3* October 30, 1978 1:54 PM% TEST cnt BY LOOPING FOR ALL VALUES OF cntAT POINTS TESTED, cnt AND rscr SHOULD BE EQUAL.rscr_cnt_-1;-- test cnt for maximum iterationsWHILE cnt NE 0 DOcnt_cnt-1;IF rscr=0 THEN ERROR;rscr_rscr-1;ENDLOOP;IF rscr NE 0 THEN ERROR%cntFcn:t _ rscr_cm1;* t _ rscr _ initial value into cntcnt_t;* cnt _ initial valuecntFcnIL:branch[cntFcnXitIL, cnt=0&-1], PD _ rscr;skpUnless[ALU=0], PD_rscr;cntFcnErr1:* value of rscr suggests weerror;* should have exitedbranch[cntFcnIL], rscr_(rscr)-1;cntFcnXitIL:skpif[ALU=0];cntFcnErr2:* rscr#0. value of rscr suggests weerror;* should not have exited.cnt _ r0;* test cnt for initial value = zeroskpif[cnt=0&-1];cntFcnErr3:* didn't notice first value we loadederror;* was zero`gp (< N bAq a_*^/ \ +" ZY XUW U T S_ R"pqP +#O+ M,pqK)J Isp +qH6+F Ep qD} C@p +q#B+?+#>J = p +q%;+  :n8-kernel2.mcJanuary 18, 1979 2:07 PM%4* August 31, 1977 12:48 PM% Test not A, not B%NotAtest:t_not(A_r0);t_t#(rm1);skpif[ALU=0];error;* ~RO # RMNotAb:t_not(A_rm1);t_t#(r0);skpif[ALU=0];error;* ~rm1 # r0NotAc:t_not(A_r01);t_t#(r10);skpif[ALU=0];error;* ~r01 # r10NotAd:t_not(A_r10);t_t#(r01);skpif[ALU=0];error;* ~r10 # r01NotAe:rscr_177776C;t_not(A_r1);t_t#(rscr);skpif[ALU=0];error;* ~r1 # 177776NotBtest:t_not(B_r0);t_t#(rm1);skpif[ALU=0];error;* ~RO # RMNotBTestb:t_not(B_rm1);t_t#(r0);skpif[ALU=0];error;* ~rm1 # r0NotBTestc:t_not(B_r01);t_t#(r10);skpif[ALU=0];error;* ~r01 # r10NotBTestd:t_not(B_r10);t_t#(r01);skpif[ALU=0];error;* ~r10 # r01NotBTeste:rscr_177776C;t_not(B_r1);t_t#(rscr);skpif[ALU=0];error;* ~r1 # 177776%Test A AND BAssume a,b source dont matter. Ie.,t_(b_t) and (a_r) =t_(a_t) and (b_r)%`gp (< N bAq a _ ]Kpq\ Z Y XU+ UpqT S_R" P+ NipqM, K J Is+ FpqE D} C@ B+ ?pq>J = ; : 9T+ 6pq5 4^ 3 1+ /hpq.* ,+ *r+ 'pq& %| $> #+ pqH   + pq  \  + f)  #  p 3, )`]kernel2.mcJanuary 18, 1979 2:07 PM%5AandBtest:t_rm1;t_tAND(rm1);t_t#(rm1);skpif[ALU=0];error;* (rm1 AND rm1) #rm1t_r01;t_tAND(r10);skpif[ALU=0];error;* (r01 AND r10)t_r0;t_tAND(rm1);skpif[ALU=0];error;* r0 AND rm1%Test A orB.Assume same as AandB test.%AorBtest:t_rm1;t_tOR(r0);t_t#(rm1);skpif[ALU=0];error;* (rm1 OR r0) # rm1AorBtestb:t_r01;t_tOR(r10);t_t#(rm1);skpif[ALU=0];error;* (r01 OR r10) # rm1AorBtestc:t_rm1;t_tOR(rm1);t_t#(rm1);skpif[ALU=0];error;* (rm1 OR rm1) # rm1AorBtestd:t_r01;t_tOR(r01);t_t#(r01);skpif[ALU=0];error;* (r01 OR r01) # r01AorBteste:t_r10;t_tOR(r10);t_t#(r10);skpif[ALU=0];error;* (r10 OR r10) # r10AorBtestf:t_(r0)OR(r0);t_t#(r0);skpif[ALU=0];error;* (r0 OR r0) # r0`gp (< N bAqa_ ^ ]K \+YXU W U+S_R" P O+ M,K J Is H6pqFE D} C@ B+ ?pq>J= ; : 9T+ 6pq54^ 3 1 0+ .*pq,+ *r )4 '+ %|pq$># !  H+ pq R + w-hQkernel2.mcJanuary 18, 1979 2:07 PM%6* February 17, 1978 8:51 AM%LINK READ/WRITE TEST + MINOR TEST OF CALLFOR I IN[0..7777B] DOLINK_I;CHECK_LINK;CHECK _ BITAND[CHECK,7777B];IF CHECK NE LINK THEN ERROR;ENDLOOP;minor test of LINK, call%linkRW:rscr_7777C;* BEGIN W/ MAX LINK VALUE & COUNT DOWNlinkL:link _ rscr;t _ link;t _ t and (77777C);* ISOLATE 15 BITS 'CAUSE OF DMUX DATAt_t#(rscr);skpif[alu=0];linkErr1:error;* LINK DOESN'T HAVE THE VALUE WE LOADEDrscr_(rscr)-1;dblBranch[linkL,afterLink, alu<0];afterLink:`gp (< N bAq a_)]K\Z YXUWU T R"pqP +& NipqM, KJ+%Is H6 FpEq+'C@ B" >Jpq <:,+"zkernel2.mcJanuary 18, 1979 2:07 PM%7* November 3, 1978 6:40 PM% TEST Q: READ AND WRITEFOR I IN [0..177777B] DOQ_I;t_Q XOR I;IF T #0 THEN error;ENDLOOP;then test q lsh 1, q rsh 1 w/ selected values%QtestRW:rscr_r0;QRWL:Q_(rscr);t_(A_rscr)#(B_Q);skpif[ALU=0];QrwErr:error;rscr_(rscr)+1;dblBranch[.+1,QRWL,ALU=0];* now check rsh1, lsh1q _ r0;q lsh 1;* q _ 0 lsh 1PD _ q;skpif[ALU=0];qr0Lerr:* r0 lsh 1 should be zeroerror;q _ r01;q lsh 1;* q _ r01 lsh 1(q) # (r10);skpif[alu=0];qr10Lerr:* r10 lsh1 should be r01. (zero fill)error;q _ rm1;q lsh 1;t _ cm2;(q) # t;skpif[ALU=0];qrm1Lerr:* -1 lsh1 w/ zero fill should be -2error;q _ rhigh1;q lsh 1;* q _ 100000B lsh 1PD _ q;skpif[ALU=0];qrhigh1Lerr:* rhigh1 (100000B) lsh1 w/ zero fill shoulderror;* zeroq _ r0;q rsh 1;* zero rsh1 should be zeroPD _ q;skpif[ALU=0];qr0Rerr:error;* zero rsh1 should be zeroq _ r10;q rsh 1; * q _ r10 rsh 1(q) # (r01);skpif[ALU=0];qr10Rerr:* r10 rsh 1 w/ zero fillerror;* should be r01q _ rm1;q rsh 1;* q _ -1 rsh 1;t _ 77777c;`gp (< N aq _^\ZY XUW U- T R"pqP NipqM,qKJ IspH6qF E C@B@+ ?>J = p+q;9T8+6 5 4^p+q%3 0/h.*,+ *rp+q#)4& %|+$># !p +q+ + +R pq+\+  fp+q)+  p+ 3  <]kernel2.mcJanuary 18, 1979 2:07 PM%8(q) # t;skpif[ALU=0];qrm1Rerr:* -1 rsh 1 w/ zero fill should be 77777Berror;q _ rhigh1;q rsh 1;* q _ 100000B rsh 1t _ 40000C;(q) # t;skpif[ALU=0];qrhigh1Rerr:* rhigh1 rsh1 should be 40000Berror;`gp (< NbAqa _p+q(^\ Z+Y XUW Up +qT S<:Gkernel2.mcJanuary 18, 1979 2:07 PM%9* January 18, 1979 1:29 PM%tioaTestTest the processor's ability to read and write TIOA. Write TIOAk from both FF constants and from RM.%tioaTest:t _ 377c;cnt _ t;rscr2_ t-t;tioaL:tioa _ rscr2;* RSCR2 = value we load into Tioacall[getTioa];* rtn Tioa, still left justified, in trscr _ (rscr2) # t;skpif[ALU=0];tioaErr1:* We wrote tioa w/ contents of rscr2, goterror;* back the value in t. Bad bits in rscr.loopUntil[cnt=0&-1, tioaL], rscr2 _ (rscr2) + (b7);* increment rscr2* Here are device ddeclarations to keep micro happy. We use them to set Tioa directly from FF.device[dvc5, b13!]; device[dvc6, b14!]; device[dvc7, b15!];mc[tioa.0thru4C, b0,b1,b2,b3,b4];mc[tioa.mask, 177400];tioa _ r0;* zero all the bis of tioatioa[dvc7];* should set tioa[5:7] to 1call[getTioa];rscr _ (t) # (b7);* only one bit should be setskpif[ALU=0];tiaErr2:* tioa should be 1, (= 1 lshift 8 = 400)error;* t = value of tioa, rscr = bad bits.tioa[dvc6];* should set tioa[5:7] to 2call[getTioa];rscr _ t # (b6);* tioa should be 2, (= 1 lshift 9 = 1000)skpif[ALU=0];tioaErr3:error;* rscr = bad bits, t = tioa left justifiedtioa[dvc5];* tioa should be 4 (= 1 lshift 10 = 2000)call[getTioa];rscr _ t # (b5);skpif[ALU=0];tioaErr4:error;* rscr = bad bits, t = tioa left justifiedtioa _ rm1;* all ones into tioatioa[dvc7];call[getTioa];rscr _ tioa.0thru4C;rscr _ (rscr) or (b7);* only should have set tioa[5:7];rscr _ t # (q_rscr);* q = expected valueskpif[ALU=0];tioaErr5:error;* t = tioa, left justified; rscr = bad bits, q =expected valuetioa[dvc6];call[getTioa];* set tioa[5:7] to 2rscr _ tioa.0thru4C;rscr _ (rscr) or (b6);* only should have set tioa[5:7];rscr _ t # (q_rscr);* q = expected valueskpif[ALU=0];tioaErr6:* q = expected valueerror;* t = tioa, left justified; rscr = bad bitstioa[dvc5];call[getTioa];* set tioa[5:7] to 4rscr _ tioa.0thru4C;rscr _ (rscr) or (b5);* only should have set tioa[5:7];rscr _ t # (q_rscr);* q = expected valueskpif[ALU=0];tioaErr7:* q = expected value`gp (< N bAq a+f_p ^qe ]K \pZqYXU WpUq +!T +&S_R" Pp+q)O+)Ni32 K^ Jpqpqpq Isp q H6pq E +D} +C@ B+@ ?p+q(>J+%; +: 9T+)8 6p5q+*3 +)1 0/h .*p,q+**r +)4 ' & pq%|+!$>+# !p q+0 H   +R pq+!+ \p+q++ f +) pq +! + p 3p+q C]Wkernel2.mcJanuary 18, 1979 2:07 PM%10error;* t = tioa, left justified; rscr = bad bitsbranch[afterTioa];getTioa: subroutine;t _ TIOA&STKP;return, t _ t and (177400C);* isolate left bytetop level;afterTioa:`gp (< NbAq++_ ^pq ]K \+Z XUp U<T7kernel2.mcJanuary 18, 1979 2:07 PM%11* October 19, 1978 8:54 PM%TEST STKP: READ AND WRITEFOR I IN[0..377B] DOSTKP_I;t_TIOA&STKP[]t_t and (stkpMask);t_t XOR I;IF T # 0 THEN error;ENDLOOP;%STKPtestRW:t_r0;rscr_t;* rscr = values loaded into stackprscr2 _ t_377C;* MASK TO ISOLATE STACKPcnt_t;* mask just happens to be count, toostkpL:STKP_rscr;* LOAD STKP FROM rscrt _ (TIOA&STKP);t_t AND (rscr2);* READ AND MASK THE VALUEt_t#(rscr);skpif[ALU=0];stkpErr:error;* error: DIDN'T READ WHAT WE LOADEDdblBranch[.+1,stkpL,CNT=0&-1],rscr_(rscr)+1;`gp (< N bAq a_]K\Z YXU WU T R"p qPO+"Ni+M,+$ JpqIs +H6F+E D} C@pBq+#@, ?d8((kernel2.mcJanuary 18, 1979 2:07 PM%12* October 26, 1978 12:03 PM%rstkFFTest the FF operation that replaces rstk with a valuefrom the FF field during rm Writing. Test each bitpath only.%rstkFF:q _ rmx0;* save rmx0rmx0 _ t-t;* background test rm location w/ zerot _ rmx7 _ cm1;* KEEP -1 IN RMX7, AND Trmx0 _ rmx7;* write into RM w/ rstk from FF fieldt # (rmx0);* compare target RM w/ expected valueskpif[alu=0];rstkFF0Err:* can't write into rstk0 w/ fferror;rmx0 _ q;* restore old valueq _ rmx1;* save rmx1rmx1 _ t-t;* background test rm location w/ zerormx1 _ rmx7;* write into RM w/ rstk from FF fieldt # (rmx1);* compare target RM w/ expected valueskpif[ALU=0];rstkFF1Err:* can't write into rstk1 w/ fferror;rmx1 _ q;* restore old valueq _ rmx2;* save rmx2rmx2 _ t-t;* background test rm location w/ zerormx2 _ rmx7;* write into RM w/ rstk from FF fieldt # (rmx2);* compare target RM w/ expected valueskpif[ALU=0];rstkFF2Err:* can't write into rstk2 w/ fferror;rmx2 _ q;* restore old valueq _ rmx4;* save rmx4rmx4 _ t-t;* background test rm location w/ zerormx4 _ rmx7;* write into RM w/ rstk from FF fieldt # (rmx7);* compare target RM w/ expected valueskpif[ALU=0];rstkFF4Err:* can't write rstk4 w/ fferror;rmx4 _ q;* restore old valueq _ rmx10;* save rmx10rmx10 _ t-t;* background test rm location w/ zerormx10 _ rmx7;* write into RM w/ rstk from FF fieldt # (rmx10);* compare target RM w/ expected valueskpif[ALU=0];rstkFF10Err:* can't write rstk10 w/ fferror;rmx10 _ q;`gp (< N bAq a_p+q5 ^rq ]K \pZq+ Y +%XU+W +%U +%T S_p +qR"O+Ni+ M, +%K +%J +%Is H6p +qFD}+C@+ B +%@ +%? +%>J = p +q;9T+8+ 6 +%5 +%4^ +%3 1p +q0.*+, + + +%*r +%)4 +%' &p +q%|#  !D@Fk kernel2.mcJanuary 18, 1979 2:07 PM%13* October 26, 1978 6:14 PM%rbaseFFtest the facility that changes the value of rbase whenrm storing occurs.%* sibling[FoosBrotherInRegion5, 5, foo]* declare FoosBrotherInRegion5 as an RM* location in rmRegion 5 with its rstk value the same as the one for foo. Eg., if foo is* located at rm addr 17,,12 (rbase = 17, rstk = 12) then FoosBrotherInRegion5 is located* at rm addr 5,,12m[sibling,rm[#1, add[lshift[#2,4], and[17,ip[#3]]]]];sibling[rb0rm0, 0, rmx0];sibling[rb1rm1, 1, rmx1];sibling[rb2rm2, 2, rmx2];sibling[rb4rm4, 4, rmx4]; sibling[rb10rm10, 10, rmx10];rbaseFF:rbase _ rbase[defaultRegion];q _ rmx0;* save current value for "source" rmrb0rm0 _ t-t;* zero "destination" rmrmx0 _ cm1;* t _ "source rm" _ -1rb0rm0 _ rmx0;* "destin" rm (different rbase)_ source rmrbase _ 0s;* check the result. First fetch the value int _ rmx0, RBASE _ rbase[defaultRegion];* the destination rm, then compare it tot # (rmx0);* the source rm. An error means we didn'tskpif[ALU=0];rbaseFF0Err:* succeed in writing rm with rbase_0 fromerror;* ff field. t = real val, rmx0=expected val.rmx0 _ q;* restore old valueq _ rmx1;* save current value for "source" rmt _ rmx1 _ cm1;* t _ "source rm" _ -1rb1rm1 _ t-t;* zero "destination" rmrb1rm1 _ rmx1;* "destin" rm (different rbase)_ source rmRBASE _ 1s;* check the result. First fetch the value int _ rmx1, RBASE _ rbase[defaultRegion];* the destination rm, then compare it tot # (rmx1);* the source rm. An error means we didn'tskpif[ALU=0];rbaseFF1Err:* succeed in writing rm with rbase_0 fromerror;* ff field. t = real val, rmx0=expected val.rmx1 _ q;* restore old valueq _ rmx2;* save current value for "source" rmt _ rmx2 _ cm1;* t _ "source rm" _ -1rb2rm2 _ t-t;* zero "destination" rmrb2rm2 _ rmx2;* "destin" rm (different rbase)_ source rmRBASE _ 2s;* check the result. First fetch the value int _ rmx2, RBASE _ rbase[defaultRegion];* the destination rm, then compare it tot # (rmx2);* the source rm. An error means we didn'tskpif[ALU=0];rbaseFF2Err:* succeed in writing rm with rbase_0 fromerror;* ff field. t = real val, rmx0=expected val.rmx2 _ q;* restore old valueq _ rmx4;* save current value for "source" rmt _ rmx4 _ cm1;* t _ "source rm" _ -1rb4rm4 _ t-t;* zero "destination" rmrb4rm4 _ rmx4;* "destin" rm (different rbase)_ source rmRBASE _ 4s;* check the result. First fetch the value int _ rmx4, RBASE _ rbase[defaultRegion];* the destination rm, then compare it tot # (rmx4);* the source rm. An error means we didn'tskpif[ALU=0];rbaseFF4Err:* succeed in writing rm with rbase_0 fromerror;* ff field. t = real val, rmx0=expected val.rmx4 _ q;* restore old valueq _ rmx10;* save current value for "source" rmt _ rmx10 _ cm1;* t _ "source rm" _ -1rb10rm10 _ t-t;* zero "destination" rmrb10rm10 _ rmx10;RBASE _ 10s;* check the result. First fetch the value int _ rmx10,RBASE _ rbase[defaultRegion];* the destination rm, then compare it tot # (rmx10);* the source rm. An error means we didn't`gp (< N bAq a_p+q6 ^ ]K \'+' ZX YX XU WpUq)T S_pq pq .p pq R"pqpq OpqNiM,+$K +J +Is +*H6 +,F'+(E +)D} C@p q+)B+,?+>J+$= +; +: +*9T +,8'+(6 +)5 4^p q+)3 +,0+/h+$.*+, ++ +**r +,)4'+(' +)& %|p q+)$>+,!+ +$H+ + +* +,R'+( +) p q+)\+,+ +$f+)+  +, p'+( 3 +) D]kernel2.mcJanuary 18, 1979 2:07 PM%14skpif[ALU=0];rbaseFF10Err:* succeed in writing rm with rbase_0 fromerror;* ff field. t = real val, rmx0=expected val.%Test RSTK destination function:FOR I IN [0..7] DOFOR J IN [0..7] DORBASE[I]_RBASE[J];t_RBASE[I];IF T#RBASE[J] THEN error;ENDLOOP; ENDLOOP;Of course, this code is "expanded" inline rather than in a loop%*FOR I IN [0..7] DO RBASE[0] _ RBASE[I]; (EXCEPT FOR _RBASE[0])rstkTest0:rscr_3C;rscr2_4C;Q_r0;t_r0_r1;t#(Q);skpUnless[ALU=0], t_t#(r0);error;skpif[ALU=0];error;t_r0_rm1;t#(Q);skpUnless[ALU=0], t_t#(r0);rstkTest02:error;skpif[ALU=0];error;t_r0_r01;t#(Q);skpUnless[ALU=0], t_t#(r0);error;skpif[ALU=0];error;t_r0_r10;t#(Q);skpUnless[ALU=0], t_t#(r0);rstkTest04:error;skpif[ALU=0];error;t_r0_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(r0);error;skpif[ALU=0];error;t_r0_rscr;t#(Q);skpUnless[ALU=0], t_t#(r0);rstkTest06:error;skpif[ALU=0];error;t_r0_rscr2;t#(Q);skpUnless[ALU=0], t_t#(r0);`gp (< NbAq ap q+)_+, \ ZXUW@U@T @S_R" O? Ni K> JpqIsH6ED}C@B@? >J;:9T 8p q65 4^10/h.*, +)4'& %|p q$># !H  R  \ p qf )  p 3 =y]kernel2.mcJanuary 18, 1979 2:07 PM%15error;skpif[ALU=0];error;r0_Q;*FOR I IN [0..7] DO RBASE[1] _ RBASE[I]; (EXCEPT FOR _RBASE[1])rstkTest1:Q_r1;t_r1_r0;t#(Q);skpUnless[ALU=0], t_t#(r1);error;skpif[ALU=0];error;t_r1_rm1;t#(Q);skpUnless[ALU=0], t_t#(r1);rstkTest12:error;skpif[ALU=0];error;t_r1_r01;t#(Q);skpUnless[ALU=0], t_t#(r1);error;skpif[ALU=0];error;t_r1_r10;t#(Q);skpUnless[ALU=0], t_t#(r1);rstkTest14:error;skpif[ALU=0];error;t_r1_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(r1);error;skpif[ALU=0];error;t_r1_rscr;t#(Q);skpUnless[ALU=0], t_t#(r1);rstkTest16:error;skpif[ALU=0];error;t_r1_rscr2;t#(Q);skpUnless[ALU=0], t_t#(r1);error;skpif[ALU=0];error;r1_Q;*FOR I IN [0..7] DO RBASE[2] _ RBASE[I]; (EXCEPT FOR _RBASE[2])rstkTest2:Q_rm1;t_rm1_r0;t#(Q);skpUnless[ALU=0], t_t#(rm1);error;skpif[ALU=0];error;t_rm1_r1;`gp (< NbAqa _^ \> ZpqYXUWUTS_ R"ONiM, Kp qJIs H6ED}C@B@ ?= ;: 9Tp q86 53 10/h.* ,*r )4' &p q%|$> # H  R > \pqf)   3. 1]kernel2.mcJanuary 18, 1979 2:07 PM%16t#(Q);skpUnless[ALU=0], t_t#(rm1);rstkTest22:error;skpif[ALU=0];error;t_rm1_r01;t#(Q);skpUnless[ALU=0], t_t#(rm1);error;skpif[ALU=0];error;t_rm1_r10;t#(Q);skpUnless[ALU=0], t_t#(rm1);rstkTest24:error;skpif[ALU=0];error;t_rm1_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(rm1);error;skpif[ALU=0];error;t_rm1_rscr;t#(Q);skpUnless[ALU=0], t_t#(rm1);rstkTest26:error;skpif[ALU=0];error;t_rm1_rscr2;t#(Q);skpUnless[ALU=0], t_t#(rm1);error;skpif[ALU=0];error;rm1_Q;*FOR I IN [0..7] DO RBASE[3] _ RBASE[I]; (EXCEPT FOR _RBASE[3])rstkTest3:Q_r01;t_r01_r0;t#(Q);skpUnless[ALU=0], t_t#(r01);error;skpif[ALU=0];error;t_r01_r1;t#(Q);skpUnless[ALU=0], t_t#(r01);rstkTest32:error;skpif[ALU=0];error;t_r01_rm1;t#(Q);skpUnless[ALU=0], t_t#(r01);error;skpif[ALU=0];error;t_r01_r10;t#(Q);`gp (< NbAqa _p q^]K \Y XUWUT S_P ONi M,p qKJ IsF ED}C@B @>J = ; :p q9T8 64^ 3 10/h .*, *r> )4pq'&%|$>#!    Rp q  f)   p  3 1]kernel2.mcJanuary 18, 1979 2:07 PM%17skpUnless[ALU=0], t_t#(r01);rstkTest34:error;skpif[ALU=0];error;t_r01_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(r01);error;skpif[ALU=0];error;t_r01_rscr;t#(Q);skpUnless[ALU=0], t_t#(r01);rstkTest36:error;skpif[ALU=0];error;t_r01_rscr2;t#(Q);skpUnless[ALU=0], t_t#(r01);error;skpif[ALU=0];error;r01_Q;*FOR I IN [0..7] DO RBASE[4] _ RBASE[I]; (EXCEPT FOR _RBASE[4])rstkTest4:Q_r10;t_r10_r0;t#(Q);skpUnless[ALU=0], t_t#(r10);error;skpif[ALU=0];error;t_r10_r1;t#(Q);skpUnless[ALU=0], t_t#(r10);rstkTest42:error;skpif[ALU=0];error;t_r10_r01;t#(Q);skpUnless[ALU=0], t_t#(r10);error;skpif[ALU=0];error;t_r10_rm1;t#(Q);skpUnless[ALU=0], t_t#(r10);rstkTest44:error;skpif[ALU=0];error;t_r10_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(r10);error;skpif[ALU=0];error;t_r10_rscr;t#(Q);skpUnless[ALU=0], t_t#(r10);`gp (< NbAq ap q_^ ]KZ YXUWU TR" PO Nip qM,K JH6 FED}C@ B@ >J> = pq;:9T865 4^10/h .*p q,+ *r' &%|$># !H   p qR \ f )  p 38 1]kernel2.mcJanuary 18, 1979 2:07 PM%18rstkTest46:error;skpif[ALU=0];error;t_r10_rscr2;t#(Q);skpUnless[ALU=0], t_t#(r10);error;skpif[ALU=0];error;r10_Q;*FOR I IN [0..7] DO RBASE[5] _ RBASE[I]; (EXCEPT FOR _RBASE[5])rstkTest5:Q_rhigh1;t_rhigh1_r0;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);error;skpif[ALU=0];error;t_rhigh1_r1;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);rstkTest52:error;skpif[ALU=0];error;t_rhigh1_r01;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);error;skpif[ALU=0];error;t_rhigh1_r10;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);rstkTest54:error;skpif[ALU=0];error;t_rhigh1_rm1;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);error;skpif[ALU=0];error;t_rhigh1_rscr;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);rstkTest56:error;skpif[ALU=0];error;t_rhigh1_rscr2;t#(Q);skpUnless[ALU=0], t_t#(rhigh1);error;skpif[ALU=0];error;rhigh1_Q;*FOR I IN [0..7] DO RBASE[6] _ RBASE[I]; (EXCEPT FOR _RBASE[6])rstkTest6:Q_rscr;`gp (< N bA qa_ ^\ ZYXUW UT R"> PpqONi M,KJIs H6E D}C@ Bp q@? >J; :9T86 53 10 /hp q.*, +)4 '&%|$> # H  p qR \ f) > ppq 3r 1]kernel2.mcJanuary 18, 1979 2:07 PM%19t_rscr_r0;t#(Q);skpUnless[ALU=0], t_t#(rscr);error;skpif[ALU=0];error;t_rscr_r1;t#(Q);skpUnless[ALU=0], t_t#(rscr);rstkTest62:error;skpif[ALU=0];error;t_rscr_r01;t#(Q);skpUnless[ALU=0], t_t#(rscr);error;skpif[ALU=0];error;t_rscr_r10;t#(Q);skpUnless[ALU=0], t_t#(rscr);rstkTest64:error;skpif[ALU=0];error;t_rscr_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(rscr);error;skpif[ALU=0];error;t_rscr_rm1;t#(Q);skpUnless[ALU=0], t_t#(rscr);rstkTest66:error;skpif[ALU=0];error;t_rscr_rscr2;t#(Q);skpUnless[ALU=0], t_t#(rscr);error;skpif[ALU=0];error;rscr_Q;*FOR I IN [0..7] DO RBASE[7] _ RBASE[I]; (EXCEPT FOR _RBASE[7])rstkTest7:Q_rscr2;t_rscr2_r0;t#(Q);skpUnless[ALU=0], t_t#(rscr2);error;skpif[ALU=0];error;t_rscr2_r1;t#(Q);skpUnless[ALU=0], t_t#(rscr2);rstkTest72:error;skpif[ALU=0];error;t_rscr2_r01;`gp (< NbAq a_^]K \Y XUW Up qTS_ R"O NiM,KJ IsF ED} C@p qB@ ?= ;:9T8 64^ 3 1 0p q/h.* ,*r )4'&%| $># > Hpq  R   fp q)   3 : 1]kernel2.mcJanuary 18, 1979 2:07 PM%20t#(Q);skpUnless[ALU=0], t_t#(rscr2);error;skpif[ALU=0];error;t_rscr2_r10;t#(Q);skpUnless[ALU=0], t_t#(rscr2);rstkTest74:error;skpif[ALU=0];error;t_rscr2_rhigh1;t#(Q);skpUnless[ALU=0], t_t#(rscr2);error;skpif[ALU=0];error;t_rscr2_rscr;t#(Q);skpUnless[ALU=0], t_t#(rscr2);rstkTest76:error;skpif[ALU=0];error;t_rscr2_rm1;t#(Q);skpUnless[ALU=0], t_t#(rscr2);error;skpif[ALU=0];error;rscr2_Q;goto[afterKernel2];`gp (< NbAqa_^ ]KZ YXU Wp qUT S_PONiM,K JH6 FE D}p qC@B @>J = ;:9T 86 4^ 2k5kernel3.mcNovember 13, 1978 10:43 AM%1* INSERT[D1ALU.MC];* TITLE[KERNEL3];top level;beginKernel3: noop;%TESTCONTENTSSHCtestRWRead and write SHCRlshtest RM shiftlmask, lsh r[i]; 0<=i<=15Tlshtest T shiftlmask, lsh t[i]; 0<=i<=15Rrshtest RM shiftlmask, rsh r[i]; 0<=i<=15Trshtest T shiftlmask, rsh t[i]; 0<=i<=15TRlcyTesttest T R lcy[i]; 0<=i<=15. (cycle 0,,1 and 177777,,177776)RTlcyTesttest R T lcy[i]; 0<=i<=15. (cycle 0,,1 and 177777,,177776)rcy16, lcy16test 16 bit cycles with selected bit valuescycleTestTest 32 bit cycles by generating possible r,t, count valuesRFWFtesttest RF_ and WF_aluRSHtest alu right shift (ie., H3 _ ALU rightshift 1)aluRCYtest alu right cycle (ie., H3 _ ALU rightCycle 1)aluARSHtest alu arithmetic right shift (ie., H3 _ ALU rightshift 1, sign preserved)aluLSHtest alu left shiftaluLCYtest alu left cyclealuSHTESTexhaustive test of alu shifts% gp )YN bAq a _ ^p q \ Z Y XU& W% U& T% S_: R": P + O; Ni M,1 K1 JL Is H6 F Ej CAY$kernel3.mcNovember 13, 1978 10:43 AM%2* August 9, 1977 12:33 PM%TEST SHC: READ AND WRITEFOR I IN[0..177777B] DOSHC_I;T_SHC XOR I;IF T#0 THEN ERROR;ENDLOOP;Note: ShC is a 16 bit register AND the upper three bits [0..2] are notused by the shifter!%SHCtestRW:rscr_r0;SHCRWL:SHC_rscr;t _ SHC;t_(rscr)#(t);branch[.+2,ALU=0];error;rscr_(rscr)+1;loopUntil[ALU=0,SHCRWL];% TEST THE SHIFTERMAKE SURE THAT ALL SHIFTS WORK PROPER AMOUNTMAKE SURE ALL MASKS WORKMAKE SURE SHIFTS AND MASKS WORK TOGETHERThese tests work by left (or right) shifting bit15 (bit 0) 0 thru15 times. rscr or rscr2 holds the expected value. The result is XOR'dwith the expected value and those bits are placed in T. If t #0 therehas been an error.test order:R shift leftT shift leftR shift rightT shift rightR T cycle leftT R cycle leftR T cycle rightT R cycle rightNote: The cycle tests are duplicated with the bits inverted (eg.,bit15 {bit0} is zero and all other bits are one.%Rlsh:t_r1;rscr_t;t_B15;rscr _ lsh[rscr,0];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_B14;rscr _ lsh[rscr,1];t_t#(rscr);skpif[ALU=0];error;Rlsh2:t_r1;rscr_t;t_B13;rscr _ lsh[rscr,2];t_t#(rscr);skpif[ALU=0];error; gp )YN bAq a_]K\Z YXUUFT S_ R"pqP OpqNiM,K JIsH6 F D}C@,B@(?A>JE= E;9T 8 6 5 4^ 1 0 /h.*,A+0 *r 'pq&%|$>#!  HR  \ pqf)   p  3 2]kernel3.mcNovember 13, 1978 10:43 AM%3t_r1;rscr_t;t_B12;rscr _ lsh[rscr,3];t_t#(rscr);skpif[ALU=0];error;Rlsh4:t_r1;rscr_t;t_B11;rscr _ lsh[rscr,4];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_B10;rscr _ lsh[rscr,5];t_t#(rscr);skpif[ALU=0];error;Rlsh6:t_r1;rscr_t;t_B9;rscr _ lsh[rscr,6];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_B8;rscr _ lsh[rscr,7];t_t#(rscr);skpif[ALU=0];error;Rlsh8:t_r1;rscr_t;t_B7;rscr _ lsh[rscr,10];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_B6;rscr _ lsh[rscr,11];t_t#(rscr);skpif[ALU=0];error;Rlsh10:t_r1;rscr_t;t_B5;rscr _ lsh[rscr,12];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_B4; gp )YNaq_^]K\ Z Y WpqUTS_R"P O NiKJIsH6F E D} Bpq@?>J= ; : 9T654^3 1 0 /h ,pq+*r)4'& %| $>! H   R pq\ f )  p 3h %]kernel3.mcNovember 13, 1978 10:43 AM%4rscr _ lsh[rscr,13];t_t#(rscr);skpif[ALU=0];error;Rlsh12:t_r1;rscr_t;t_B3;rscr _ lsh[rscr,14];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_B2;rscr _ lsh[rscr,15];t_t#(rscr);skpif[ALU=0];error;Rlsh14:t_r1;rscr_t;t_B1;rscr _ lsh[rscr,16];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_t;t_RHIGH1;rscr _ lsh[rscr,17];t_t#(rscr);skpif[ALU=0];error; gp )YNbAqa _ ^ \pqZYXUWU T S_PONiM,K J Is FpqED}C@B@ ? >J;:9T86 5 4^x 1%6Kkernel3.mcNovember 13, 1978 10:43 AM%5* October 20, 1978 10:32 AMTlsh:t_rscr_B15;noop;t_lsh[t,0];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B14;t_lsh[t,1];t_t#(rscr);skpif[ALU=0];error;Tlsh2:t_r1;rscr_B13;t_lsh[t,2];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B12;t_lsh[t,3];t_t#(rscr);skpif[ALU=0];error;Tlsh4:t_r1;rscr_B11;t_lsh[t,4];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B10;t_lsh[t,5];t_t#(rscr);skpif[ALU=0];error;Tlsh6:t_r1;rscr_B9;t_lsh[t,6];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B8;t_lsh[t,7];t_t#(rscr);skpif[ALU=0];error;Tlsh8:t_r1;rscr_B7;t_lsh[t,10];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B6; gp )YN bAq apq^ ]K\ Z Y XUUTS_ R" P O M,pqKJIs H6 F EC@B@ ? >J =  :pq9T86 5 4^ 3 0/h.* , + *r 'pq&%|$> # !    R   \pq f )   p 3\ %]kernel3.mcNovember 13, 1978 10:43 AM%6t_lsh[t,11];t_t#(rscr);skpif[ALU=0];error;Tlsh10:t_r1;rscr_B5;t_lsh[t,12];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B4;t_lsh[t,13];t_t#(rscr);skpif[ALU=0];error;Tlsh12:t_r1;rscr_B3;t_lsh[t,14];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_B2;t_lsh[t,15];t_t#(rscr);skpif[ALU=0];error;Tlsh14:t_r1;rscr_B1;t_lsh[t,16];t_t#(rscr);skpif[ALU=0];error;t_r1;rscr_RHIGH1;t_lsh[t,17];t_t#(rscr);skpif[ALU=0];error; gp )YNbAq a _ ^ \pqZYXU W U TR"PO Ni M, K IspqH6FE D} C@ B?>J= ; : 9T 6pq54^3 1 0 /h,+ *r )4 ' & %Y%Bkernel3.mcNovember 13, 1978 10:43 AM%7* October 20, 1978 10:12 AM%KEEP 100000 IN Q FOR THESE TESTS !!!%Rrsh:Q_RHIGH1;GOTO[Rrsh1];* Temporary EXPEDIENTrscr_Q;t_RHIGH1;rscr _ rsh[rscr,0];t_t#(rscr);skpif[ALU=0];error;Rrsh1:rscr_Q;t_B1;rscr _ rsh[rscr,1];t_t#(rscr);skpif[ALU=0];error;Rrsh2:rscr_Q;t_B2;rscr _ rsh[rscr,2];t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B3;rscr _ rsh[rscr,3];t_t#(rscr);skpif[ALU=0];error;Rrsh4:rscr_Q;t_B4;rscr _ rsh[rscr,4];t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B5;rscr _ rsh[rscr,5];t_t#(rscr);skpif[ALU=0];error;Rrsh6:rscr_Q;t_B6;rscr _ rsh[rscr,6];t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B7;rscr _ rsh[rscr,7];t_t#(rscr);skpif[ALU=0];error;Rrsh8:rscr_Q;t_B8;rscr _ rsh[rscr,10]; gp )YN bAq a_$ ^ ]Kpq\Z +YXUWU T S_ PpqONiM,K J Is FpqED}C@B @ ?= ;:9T 8 6 4^pq3 10/h .* ,*r)4'& %| $> pqH  R \  f pq  p 3 .]kernel3.mcNovember 13, 1978 10:43 AM%8t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B9;rscr _ rsh[rscr,11];t_t#(rscr);skpif[ALU=0];error;Rrsh10:rscr_Q;t_B10;rscr _ rsh[rscr,12];t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B11;rscr _ rsh[rscr,13];t_t#(rscr);skpif[ALU=0];error;Rrsh12:rscr_Q;t_B12;rscr _ rsh[rscr,14];t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B13;rscr _ rsh[rscr,15];t_t#(rscr);skpif[ALU=0];error;Rrsh14:rscr_Q;t_B14;rscr _ rsh[rscr,16];t_t#(rscr);skpif[ALU=0];error;rscr_Q;t_B15;rscr _ rsh[rscr,17];t_t#(rscr);skpif[ALU=0];error; gp )YNbAq a _]K\ZY XU W TpqS_R"PO Ni M,JIsH6F E D} Bpq@?>J= ; :8654^ 3 1 /hpq.*,+*r )4 '%|$>#!  H %J#kernel3.mcNovember 13, 1978 10:43 AM%9* October 20, 1978 10:13 AMTrsh:GOTO[Trshift1];* Temporary EXPEDIENTt_rscr_RHIGH1;NOOP;T_rsh[t,0];t_t#(rscr);skpif[ALU=0];error;Trshift1:t_rhigh1;rscr_B1;t_rsh[t,1];t_t#(rscr);skpif[ALU=0];error;Trsh2:t_rhigh1;rscr_B2;t_rsh[t,2];t_t#(rscr);skpif[ALU=0];error;t_rhigh1;rscr_B3;t_rsh[t,3];t_t#(rscr);skpif[ALU=0];error;Trsh4:t_rhigh1;rscr_B4;t_rsh[t,4];t_t#(rscr);skpif[ALU=0];error;t_rhigh1;rscr_B5;t_rsh[t,5];t_t#(rscr);skpif[ALU=0];error;Trsh6:t_rhigh1;rscr_B6;t_rsh[t,6];t_t#(rscr);skpif[ALU=0];error;t_rhigh1;rscr_B7;t_rsh[t,7];t_t#(rscr);skpif[ALU=0];error;Trsh8:t_rhigh1;rscr_B8;t_rsh[t,10];t_t#(rscr);skpif[ALU=0];error; gp )YN bAq apq^+]K \Z Y XU W TpqS_R"P O Ni M, JpqIsH6F E D} C@@?>J = ; : 8pq654^ 3 1 0.*,+ *r )4 ' %|pq$>#!  H  R   \ pqf)    p .]kernel3.mcNovember 13, 1978 10:43 AM%10t_rhigh1;rscr_B9;t_rsh[t,11];t_t#(rscr);skpif[ALU=0];error;Trsh10:t_rhigh1;rscr_B10;t_rsh[t,12];t_t#(rscr);skpif[ALU=0];error;t_rhigh1;rscr_B11;t_rsh[t,13];t_t#(rscr);skpif[ALU=0];error;Trsh12:t_rhigh1;rscr_B12;t_rsh[t,14];t_t#(rscr);skpif[ALU=0];error;t_rhigh1;rscr_B13;t_rsh[t,15];t_t#(rscr);skpif[ALU=0];error;Trsh14:t_rhigh1;rscr_B14;t_rsh[t,16];t_t#(rscr);skpif[ALU=0];error;t_rhigh1;rscr_B15;t_rsh[t,17];t_t#(rscr);skpif[ALU=0];error; gp )YNbAqa_ ^ ]K \ YpqXUWU T S_ R"ONiM, K J Is FpqED}C@ B @ ?= ;: 9T 8 6 4^pq3 10 /h .* ,*r)4' & %| $> "%E-kernel3.mcNovember 13, 1978 10:43 AM%11* October 20, 1978 10:14 AM%These tests work by cycling by 0, 1, ...17B. The predicted resultis kept in RSCR2 and the actual result XOR's w/ predicted result iskept in T. Note that each test is done twice: once w/ one "1" bit and allthe rest "0" bits, and once w/ one "0" bit and all the rest "1" bits.FOR THESE TESTS WE WILL REDEFINE R01 TO BE RM2 (-2)!%TRlcyTest:RM[rm2,IP[R01]];rm2 _ CM2;t_r0;rscr2_B15;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,0];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB15;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,0];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B14;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,1];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB14;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,1];t_t#(rscr2);skpif[alu=0];error;TRlcy2:t_r0;rscr2_B13;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,2];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB13;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,2];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B12;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,3];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB12;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,3];t_t#(rscr2);skpif[alu=0];error;TRlcy4:t_r0;rscr2_B11;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,4];t_t#(rscr2);skpif[alu=0]; gp )YN bAq a_A^C]KI\EY4 XU WpqUT R"P +O Ni M, KJIs +H6F E D}B@ +? >J = ;:9T +86 5 4^ 1pq0/h +.* , + *r)4' +&%| $> # H +   R +\   fpq) +  p  3  4]kernel3.mcNovember 13, 1978 10:43 AM%12error;t_rm1;rscr2_NB11;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,4];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B10;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,5];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB10;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,5];t_t#(rscr2);skpif[alu=0];error;TRlcy6:t_r0;rscr2_B9;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,6];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB9;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,6];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B8;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,7];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB8;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,7];t_t#(rscr2);skpif[alu=0];error;TRlcy8:t_r0;rscr2_B7;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,10];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB7;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,10];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B6;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,11];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB6;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,11];t_t#(rscr2); gp )YNbAqa_ +^]K \ ZXUW +U T S_ R"PO +NiM, K J H6pqFE+D} C@ B @?>J += ; : 9T65+4^ 3 1 0/h.* +,+ *r )4 &pq%|$>+#!  H  +R  \+ f )  + p 3  1p]kernel3.mcNovember 13, 1978 10:43 AM%13skpif[alu=0];error;TRlcy10:t_r0;rscr2_B5;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,12];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB5;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,12];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B4;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,13];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB4;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,13];t_t#(rscr2);skpif[alu=0];error;TRlcy12:t_r0;rscr2_B3;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,14];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB3;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,14];t_t#(rscr2);skpif[alu=0];error;t_r0;rscr2_B2;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,15];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB2;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,15];t_t#(rscr2);skpif[alu=0];error;TRlcy14:t_r0;rscr2_B1;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,16];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB1;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,16];t_t#(rscr2);skpif[alu=0];error;t_r0; gp )YNbAq a ^pq]K\+ZY XU WUT +S_R" P OM,K+JIs H6 FED} +C@B @ ? = pq;:+9T8 6 54^3 +10 /h .*+*r+)4' & %|$># +! H   pqR+ \  +f)    3 1p]kernel3.mcNovember 13, 1978 10:43 AM%14rscr2_B0;* RSCR2 _ PREDICTED RESULTt_lcy[t,r1,17];t_t#(rscr2);skpif[alu=0];error;t_rm1;rscr2_NB0;* RSCR2 _ PREDICTED RESULTt_lcy[t,rm2,17];t_t#(rscr2);skpif[alu=0];error; gp )YNbAq+a_ ^ ]K\Z +YXU W U Q1p Akernel3.mcNovember 13, 1978 10:43 AM%15**October 20, 1978 10:06 AMRTlcyTest:*RSCR2 HOLDS THE PREDICTED RESULT, T HOLDS ACTUALRESULTt_r1;* rscr2, T _ [0,1] LCY[0]rscr2_B15;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,0];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB15;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,0];t_t#(rscr2);skpif[alu=0];error;t_r1;rscr2_B14;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,1];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB14;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,1];t_t#(rscr2);skpif[alu=0];error;RTlcy2:t_r1;rscr2_B13;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,2];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB13;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,2];t_t#(rscr2);skpif[alu=0];error;t_r1;rscr2_B12;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,3];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB12;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,3];t_t#(rscr2);skpif[alu=0];error;RTlcy4:t_r1;rscr2_B11;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,4];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB11;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,4];t_t#(rscr2);skpif[alu=0];error; gp )YN bAq a _pq+1 ^\+Z +Y XU W UTS_ +R"P O NiKJ +Is H6 F ED}C@ +B@ ? >J ;pq:9T +8 6 5 4^3 1 +0/h .* ,*r)4 +' & %| $>#! + H   Rpq + \  f +)   p A]kernel3.mcNovember 13, 1978 10:43 AM%16t_r1;rscr2_B10;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,5];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB10;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,5];t_t#(rscr2);skpif[alu=0];error;RTlcy6:t_r1;rscr2_B9;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,6];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB9;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,6];t_t#(rscr2);skpif[alu=0];error;t_r1;rscr2_B8;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,7];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB8;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,7];t_t#(rscr2);skpif[alu=0];error;RTlcy8:t_r1;rscr2_B7;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,10];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB7;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,10];t_t#(rscr2);skpif[alu=0];error;t_r1;rscr2_B6;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,11];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB6;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,11];t_t#(rscr2);skpif[alu=0];error;RTlcy10:t_r1;rscr2_B5;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,12];t_t#(rscr2); gp )YNbAqa +_ ^ ]K \ZY +XUW U T R"pqPO+Ni M, K JIsH6 +FE D} C@@?+>J = ; :9T8 +65 4^ 3  0pq/h.*+,+ *r )4'& +%|$> # !H + R  +\   )pq  + p 3  1p]kernel3.mcNovember 13, 1978 10:43 AM%17skpif[alu=0];error;t_rm2;rscr2_NB5;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,12];t_t#(rscr2);skpif[alu=0];error;t_r1;rscr2_B4;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,13];t_t#(rscr2);skpif[alu=0];error;t_rm2;rscr2_NB4;* rscr2 _ PREDICTED RESULTt_lcy[rm1,t,13];t_t#(rscr2);skpif[alu=0];error;RTlcy12:t_r1;rscr2_B3;* rscr2 _ PREDICTED RESULTt_lcy[r0,t,14];t_t#(rscr2);skpif[alu=0];error;t_rm2;RSCR2_NB3;* RSCR2 _ PREDICTED RESULTt_lcy[rm1,t,14];t_t#(rscr2);skpif[alu=0];error;t_r1;RSCR2_B2;* RSCR2 _ PREDICTED RESULTt_lcy[r0,t,15];t_t#(rscr2);skpif[alu=0];error;t_rm2;RSCR2_NB2;* RSCR2 _ PREDICTED RESULTt_lcy[rm1,t,15];t_t#(rscr2);skpif[alu=0];error;RTlcy14:t_r1;RSCR2_B1;* RSCR2 _ PREDICTED RESULTt_lcy[r0,t,16];t_t#(rscr2);skpif[alu=0];error;t_rm2;RSCR2_NB1;* RSCR2 _ PREDICTED RESULTt_lcy[rm1,t,16];t_t#(rscr2);skpif[alu=0];error;t_r1;RSCR2_B0;* RSCR2 _ PREDICTED RESULTt_lcy[r0,t,17];t_t#(rscr2);skpif[alu=0];error;t_rm2;RSCR2_NB0;* RSCR2 _ PREDICTED RESULTt_lcy[rm1,t,17]; gp )YNbAq a_^ +]K\ Z YWU+TS_ R" PONi +M,K J Is FpqED}+C@B @ ?>J= +;: 9T 854^+3 1 0 /h.*, ++*r )4 ' %|pq$>#+! H   +R  +f )    p + 3 1p]kernel3.mcNovember 13, 1978 10:43 AM%18t_t#(rscr2);skpif[alu=0];error;RTlcyDone:r01 _ NOT(r10);* REDEFINE r01 !!!!!!! gp )YNbAq a _ ]Kpq\+v Z. ^+kernel3.mcNovember 13, 1978 10:43 AM%19* November 3, 1978 6:43 PM%rcy16, lcy16Test the 16 bit cycles with selectedbit values. This is not an exhaustive test.%rcyTest:* test 16 bit right cyclet _ rcy[r01, r01, 1];t # (r10);skpif[ALU=0];rcy16Err1:* r10 rcy 1 should be r01error;t _ r01;t _ rcy[t, t, 1];* try it again from tt # (r10);skpif[ALU=0];rcy16Err2:* r10 rcy 1 should be r01. (done fromerror;* t this time)t _ rcy[r1, r1, 1];t # (rhigh1);skpif[ALU=0];rcy16Err3:* 1 rcy 1 should be 100000Berror;t _ r1;t _ rcy[t, t, 1];t # (rhigh1);skpif[ALU=0];rcy16Err4:* 1 rcy 1 should be 100000B. (done from terror;* time).t _ rcy[r10, r10, 1];t # (r01);skpif[ALU=0];rcy16Err5:* r10 rcy 1 should be r01error;t _ r10;t _ rcy[t, t, 1];* t _ r10 rcy 1t # (r01);skpif[ALU=0];rcy16Err6:* r10 rcy 1 should be r01error;* done from t this time.t _ rcy[r01, r01, 2];t # (r01);skpif[ALU=0];rcy16Err7:* r01 rcy 2 should be r01error;t _ rcy[r01, r01, 3];t # (r10);skpif[ALU=0];rcy16Err8:* r01 rcy 3 should be r10error;t _ rcy[r01, r01, 10];t # (r01);skpif[ALU=0];rcy16Err9:* r01 rcy 10 should be r01error;lcyTest:t _ lcy[r01, r01, 1];t # (r10);skpif[ALU=0];lcy16Err1:* r01 lcy 1 should be r10error;t _ lcy[rhigh1, rhigh1, 1];t # (r1); gp )YN bAq a_p +q$ ^+ ]K \p+qZY XU Wp +qUS_R"+P O Nip +q%M,+ JIs H6 Fp +qEC@B@ ? >Jp +q)= +:9T 8 6p +q53 1+0 /h .*p +q,+*r)4 ' &p +q%|#!  Hp +q R  p +q pq f )p +q  p 3 <0] kernel3.mcNovember 13, 1978 10:43 AM%20skpif[ALU=0];lcy16Err2:* 100000B lcyd 1 should be 1error;t _ lcy[r1, r1, 1];t#(2c);skpif[ALU=0];lcy16Err3:* 1 lcy 1 should be 2error;t _ lcy[r10, r10, 1];* t _ r10 lcy 1t # (r01);skpif[ALU=0];lcy16Err4:* r10 lcy 1 should be r01error;t _ lcy[r10, r10, 2];t # (r10);skpif[ALU=0];lcy16Err5:* r10 lcy 2 should be r10error;t _ lcy[r10, r10, 3];t # (r01);skpif[ALU=0];lcy16Err6:* r10 lcy 3 should be r01error;t _ lcy[r10, r10, 4];t # (r10);skpif[ALU=0];lcy16Err7:* r10 lcy 4 should be r10error;t _ lcy[r10, r10, 10];t # (r10);skpif[ALU=0];lcy16Err8:* r10 lcy 10 should be r10error; gp )YNbAq ap +q_]K\Z Yp +qXUU+T S_ R"p +qPNiM, K Jp +qIsFE D} C@p +qB?>J = ;p +q:86 5 4^p +q3 h 126Kkernel3.mcNovember 13, 1978 10:43 AM%21* November 13, 1978 10:40 AM%cycleTestTest the cycle machinery by generating all possiblevalues for the r, t, and count fields in Shc (6 bits). The 16-bit data patterns must test all possiblestarting positions (ie., bit 0, bit 1, ...). Furthermore, set the "other word" to all 1s when singleone-bits are being tested, and set it to all zeros when single zero bits are being tested. Since wetest cycling, we don't set any of the mask fields in ShC.SHC: TYPE = MACHINE DEPENDENT RECORD[ShifterIgnores: IN[0..3],-- bits 0, 1a: IN [0..1],-- bit 2, shA select. 1 ==> "select T"b: IN [0..1],-- bit 3, shB select. 1 ==> "select T"Count: IN [0..17B],-- bits 4:7, shift countRMask: IN [0..17B],-- bits 8:11LMask: IN [0..17B],-- bits 12:15];shcVals: IN [0..77B];-- iterate thru all possible counts, sha, shbFOR pats IN NPats DOFOR shcVal In SHCVals DOShc.a _ shcVals AND 40B;Shc.b _ shcVals AND 20B;Shc.count _ shcVals AND 17B;r _ getPattern[pats];t _ IF numberOfZeroBitsGr1[r] THEN -1 ELSE 0;result _ doShift[];expected _ simulateCycle[t,r,shcVal];IF result # expected THEN SIGNAL BadShift[result, expected, shcVals];ENDLOOP;-- end of shcVals loopENDLOOP;-- end of pats loopsimulateCycle: PROCEDURE[t, r: WORD, shcVal: SHCVals] RETURNS [expected: WORD] =BEGINtCycle: CARDINAL = 60B;-- 2 highest bits in shcVal are 1rCycle: CARDINAL = 0;-- 2 hightest bits in shcVal are 0trCycle: CARDINAL = 40B;-- highest bit in shcVal is 1rtCycle: CARDINAL = 20BB;-- 2nd highest bit in ShcVal is 1shAB _ shcVal AND 60B;SELECT shAB INTOtCycle=> BEGINleft _right_t; END,rCycle=> BEGINleft _ right _ r; END,trCycle=> BEGINleft _ t, right _ r; END,rtCycle=> BEGINleft _ r;right _ t; END,END;shiftCount _ shcVal AND 17B;saveMask _ SELECT shiftCount INTO1=>100000;2=>140000B;3=>160000B;4=>170000B;5=>174000B;6=>176000B;7=>177000B;8=>177400B;9=>177600B;10=>177700B;11=>177740B;12=>177760B;13=>177770B;14=>177774B;15=>177776B;0=>177777B,END;savedValue _ left AND saveMask;right _ LeftShift[right, shiftCount];savedValue _ RightShift[right, 16-shiftCount];result _ savedValue OR left;END; gp )YN bAq a_p+q3 ^f ]Kd \c Z9 XUpq!W+ U +&T +&S_+R"+ P+ O Nipq +- KJIsH6FED}-C@B%@E?+>J+ = p qB;:pq+!9Tpq +"8pq+6pq+!54^3 10 /h.*,+*r)4'&%|!$> # !  H    R    \    f) % . p 30 E3]<kernel3.mcNovember 13, 1978 10:43 AM%22numberOfZeroBitsGr1: PROCEDURE[ x: WORD] RETURNS[result: BOOLEAN] =BEGINcount _ 0;FOR i IN [0..15] DOIF (x AND 1) =0 THEN count _ count + 1;x _ RightShift[x,1];ENDLOOP;result _ IF count >1 THEN TRUE ELSE FALSE;END;% gp )YN bAq/a_ ^]K'\ZY*XU U Tz-;kernel3.mcNovember 13, 1978 10:43 AM%23%November 17, 1978 2:39 PMTEST RF AND WFShC: TYPE = MACHINE DEPENDENT RECORD [IGNORE: TYPE = [0..7B]SHIFTCOUNT: TYPE = [0..37B]RMASK: TYPE = [0..17B]LMASK: TYPE = [0..17B]]MesaDescriptor: TYPE = MACHINE DEPENDENT RECORD[ -- this is the value stored w/ rf_, wf_IGNORE: TYPE = [0..377B] -- IGNORE FIRST BYTEPOS: TYPE = [0..17B]-- RIGHT SHIFT OF POS WILL RIGHT JUSTIFY THE FIELDSIZE: TYPE = [0..17B]-- LENGTH OF FIELD IN BITS]THIS TEST PROCEEDS BY WRITING ShC W/ ALL POSSIBLE RF AND WF VALUES. THENShC IS READ AND CHECKED TO MAKE SURE THAT IT WAS LOADED PROPERLY.FOR I IN [0..377B] DORF_I;RSCR_SHC;SIZE _ I AND 17B;POS _ BITSHIFT[I,-4] AND 17B;IF RSCR.LMASK # (16-SIZE-1) THEN ERROR;-- BAD LMASKIF RSCR.RMASK # 0 THEN ERROR;-- BAD RMASKIF RSCR.SHIFTCOUNT # (16+pos+size+1) THEN ERROR;-- BAD SHIFT COUNT (Actually this computation isn't quite right.* let count = 16+pos+size+1. realCount _ (count and 17b).* IF (realCount and 17b) #0 then realCount _ realCount OR 20B. This funny computation* accommodates hardware limitations associated w/ carry across boards.-- now test wfWF_I;RSCR_SHC;IF RSCR.RMASK # (16-POS-SIZE-1) THEN ERROR;-- BAD RMASKIF RSCR.LMASK NE POS THEN ERROR;-- BAD LMASKIF RSCR.SHIFTCOUNT # (16-pos-size-1) THEN ERROR;-- BAD SHIFT COUNTENDLOOP;%RM[r4BitMsk,IP[R01]];r4BitMsk _ 17C;* RENAME R01 AS r4BitMsk !!!RM[lastShC, IP[RSCR]];* RENAME RSCR AS lastShCRFWFtest:Q_R0;* Q WILL HOLD THE INDEX VARIABLEt_377C;CNT_t;* LOOP LIMITRFTESTL:t_Q;RF_t;lastShC_SHC;* CHECK LMASKT_ (r4BitMsk)AND (Q);* COMPUTE LMASK (= 16-SIZE-1) FROM INDEX VARrscr2_t;* rscr2 _ sizet_17C;* 16-1rscr2 _ t - (rscr2);* rscr2 _ expected Lmask = 16-size-1t _ (lastShC) and (17c);* t _ Lmask from ShCt # (rscr2);branch[.+2, ALU=0];RFLMASK:* t = Lmask from ShC, rscr2 = expected Lmaskerror;* LMASK FIELD WRONG IN ShC* CHECK RMASKt_(lastShC) and (360c);* t = isolated Rmask field of ShCskpif[ALU=0]; gp )YN bAq a ^ \&ZYXUWU S_4p$R"q-P2ONi KH JAH6FED}C@B'- @( ?05 >J. = 9 ;U :F8 654^+0Z 3 + 105/h .* + *r+ )4+ &pq%|+$>#+ pqH  R +,+ +\+$+  fpq+,)+  p+! 3  =] kernel3.mcNovember 13, 1978 10:43 AM%24RFRMASK:error;* RMASK FIELD NOT 0* CHECK SHIFT COUNT = 16+pos+size+1 (Actually this computation isn't quite right.* let count = 16+pos+size+1. realCount _ (count and 17b).* IF (realCount and 17b) #0 then realCount _ realCount OR 20B. This funny computation* accommodates hardware limitations associated w/ carry across boards.rscr2_ (Q);t_r4BitMsk;rscr2 _ rsh[rscr2,4];rscr2 _ t AND (rscr2);* rscr2 = POSt _ 21c;* 16 + 1t _ t + (rscr2);* 16 + 1 + posrscr2 _ q;rscr2 _ (rscr2) and (17c);* isolate sizerscr2 _ t + (rscr2);* rscr2 _ 16 + 1 + pos + sizerscr2 _ (rscr2) and (17c);* isolate to 17 bitsskpif[alu=0];* see if bit 0 of count is onerscr2 _ (rscr2) or (20c);* set bit0 of count if count[1:4]#0rscr2 _ (rscr2) and (17c);* isolate result to 5 bitst_ rsh[LastShC, 10];RFSHIFTC:t#(rscr2);* t=value from LastShC, rscr2 = computed valueskpif[ALU=0];error;* BAD SHIFT COUNT gp )YN bAqa+ ^Q ]K9 \U ZFY XU WU+ T+S_+ R" P+ O+Ni+M, +K+#J+H6 FpqE +.D} C@+ A>&,kernel3.mcNovember 13, 1978 10:43 AM%25* June 28, 1978 5:06 PM* NOW TEST WFWFTEST:t_Q;WF_t;lastShC_SHC;* CHECK LMASK: COMPUTE posrscr2 _ q;noop;t _ rsh[rscr2,4];rscr2 _ t and (r4BitMsk);* isolate pos bits in rscr2t_lastShC;t _ t AND (r4BitMsk);* T_ LMASKWFLMASK:t#(rscr2);* t=LastShC's Lmask, rscr2 = computed valuebranch[.+2, ALU=0];error;* SHC'S LMASK # pos* CHECK THAT RMASK = 16 - pos - size -1rscr2 _ q;t _ (r4BitMsk) and (q);* isolate size in trscr2 _ rsh[rscr2,4];* rscr2 _ posrscr2 _ (rscr2) + t;* rscr2 _ pos + sizet _ 17c;* t _ 16 -1rscr2 _ t - (rscr2);* rscr2 _ 16 - pos - size - 1rscr2 _ (rscr2) and (17c);* isolate to 17 bitst _ rsh[lastShC,4];* t = ShC's shift countt _ t and (r4BitMsk);WFRMASK:t#(rscr2);* t = ShC's shift countskpif[ALU=0];* rscr2 = 16-pos-size-1error;* RMASK NE (16-POS-SIZE-1)* CHECK SHIFT COUNT=16-pos-size-1t _ rsh[lastShC,10];* put ShC's shift count into tt _ t and (37c);t#(rscr2);* t = ShC's shift countskpif[ALU=0];* rscr2 = 16-pos-size-1, as computed aboveWFSHIFTC:* for the Rmask checkerror;* SHC'S SHIFTCOUNT # POSrscr2_(R1) + (Q);loopUntil[CNT=0&-1,RFTESTL],Q_(rscr2);RFXITL:R01 _ NOT(R10);* RESET R01 !!!!!! gp )YN bAq a ^pq]K\Z XUW UTS_+P O+ NipqM, ++KJ+ H6'F E+D}+ C@+B+ @+?+>J+=  :pq9T +8 +6+ 4^!1+0/h +.* +* ,pq+++'&& %|pq#+ !J+;:9T 8+54^ 3 1+,/h.* , ++$ )4A 'pq&%| $> #+ H +R   \+ f)   +* 3 =] kernel3.mcNovember 13, 1978 10:43 AM%27aluLSH:t_(PD_rhigh1)lsh 1;t_t#(r0);skpif[ALU=0];error;* 100000 LSH SHOULD BE 0aluLSHb:t_(PD_r1)lsh 1;rscr_(r1)+(r1);t_t#(rscr);skpif[ALU=0];error;* 1 LSH SHOULD BE 2aluLSHc:t_(PD_r01)lsh 1;t_t#(r10);skpif[ALU=0];error;* (ALT. 01) LSH SHOULD BE (ALT. 10)aluLSHd:t_(PD_rm1)lsh 1;rscr_CM2;t_t#(rscr);skpif[ALU=0];error;* -1 LSH SHOULD BE -2* TEST RESULT _ ALU LCY1aluLCY:t_(PD_rm1)lcy 1;t_t#(rm1);skpif[ALU=0];error;* -1 LCY SHOULD BE -1aluLCYb:t_(PD_r10)lcy 1;t_t#(r01);skpif[ALU=0];error;* (ALT. 10) LCY SHOULD BE (ALT. 01)aluLCYc:t_(PD_r01)lcy 1;t_t#(r10);skpif[ALU=0];error;* (ALT. 01) LCY SHOULD BE (ALT. 10)aluLCYd:t_(PD_r0)lcy 1;t_t#(r0);skpif[ALU=0];error;* 0 LCY SHOULD BE 0aluLCYe:t_(PD_r1)lcy 1;rscr_(r1)+(r1);t_t#(rscr);skpif[ALU=0];error;* 1 LCY SHOULD BE 2 gp )YN bAqa_^ ]K+ ZpqYXUW U T+ R"pqPO Ni M,+# JpqIsH6F E D}+ B @pq?>J = ;+ 9Tpq86 5 4^+# 1pq0/h .* ,+# *rpq)4'& %|+ #pq! H  +( m7|Lkernel3.mcNovember 13, 1978 10:43 AM%28* October 20, 1978 10:24 AM%EXHAUSTIVE TEST OF ALU SHIFT FUNCTIONSFOR Q IN[0..177777B] DOrscr2_Q rsh 1;t_predictedRSH[I];IF t_(T XOR rscr2) THEN ERROR;rscr2_Q )rcy 1;t_predictedRCY[I];IF t_(T XOR rscr2) THEN ERROR;rscr2_Q Arsh 1;t_predictedARSH[I];IF t_(T XOR rscr2) THEN ERROR;rscr2_Q lsh 1;t_predictedLSH[I];IF t_(T XOR rscr2) THEN ERROR;rscr2_Q rsh 1;t_predictedRSH[I];IF t_(T XOR rscr2) THEN ERROR;rscr2_Q lcy 1;t_predictedLCY[I];IF t_(T XOR rscr2) THEN ERROR;ENDLOOP;%aluSHTEST:Q_r0;* USE Q AS LOOP VARIABLEaluSHL:* TOP OF LOOP* RSH TESTrscr_Q;t_(PD_rscr)rsh 1;rscr_rsh[rscr,1];t_t#(rscr);branch[.+2,ALU=0];RSHER:error;* PREDICTED RESULT DIFFERENT FROM REAL ONE* RCY TESTrscr_Q;* Q IS LOOP VARIABLEt_(PD_rscr)rcy 1;rscr2_t;* REAL RESULT IN rscr2t_rsh[rscr,1];skpif[R EVEN], (PD_rscr);* ADD HIGH BIT IF NECESSARYt_t+(rhigh1);* PREDICTED RESULT IN Tt_t#(rscr2);branch[.+2,ALU=0];RCYER:error;* T _ (PREDICTED T) XOR rscr2* ARSH TESTrscr_Q;* Q IS LOOP VARIABLEt_(PD_rscr)Arsh 1;rscr2 _ T;* rscr2 = ACTUAL RESULTt_rsh[rscr,1];PD_Q;* ADD SIGN BIT IF REQUIREDskpUnless[ALU<0];* ADD SIGN BIT IF REQUIREDt_t+(rhigh1);t_t#(rscr2);skpif[ALU=0];ARSHER:error;* t_(PREDICTED T) XOR rscr2* LSH TEST gp )YN bAq a_& ]K\ ZYWUTR"POM, KJH6 FEC@ B@>J = ;pq:+ 8pq+ 5 4^3 10 /h .*pq,+* *r )4+'&+%| $>+# +!   Hpq +  R+ + \++ f ) pq + 3  'BE)kernel4.mcJuly 14, 1979 4:53 PM%2* May 8, 1979 11:53 AM%TEST STKP PUSH AND POP OPERATIONS-- I AND STKP SHOULD BE INCREMENTING TOGETHER.-- notation: stack&+1[stkp] _ val : place val into stack[stkp], then increment stkp by 1-- stack+1[stkp] _ val : increment stkp by one, then place val into stack[stkp]-- The stragegy for this test is to perform all the various stack manipulations (+1, +2, +3,-- -1, -2, -3, -4, &+1, &+2, &+3, &-1, &-2, &-3, &-4) for every value of stkp that won't-- cause a hardware error (underflow). The test knows what to expect in RM by setting-- each rm location to its address (stack[i] _ i).FOR top2StkpBits IN [0..3] DOFOR index IN [0..stkpMax] DO-- check simple loading of stkp and stki _ index + LeftShift[top2StkpBits, 6];stkp _ i;IF POINTERS[].stkError THEN ERROR;-- underflow or overflowIF POINTERS[].stkp # i THEN ERROR;-- stkp not the value we loadedstk[stkp] _ 0;IF stk[stkp] # 0 THEN ERROR;-- loaded zero, got back something different.stk[stkp] _ -1;IF stk[stkp] # -1 THEN ERROR;-- loaded -1, got back something different.stk[stkp] _ Alternating01;IF stk[stkp] # Alternating01 THEN ERROR;-- loaded Alternating01, got back something different.stk[stkp] _ Alternating10;IF stk[stkp] # Alternating10 THEN ERROR;-- loaded Alternating10, got back something different.stk[stkp] _ i;-- init current stack to stk[i] _ iIF stk[stkp] # i THEN ERROR;ENDLOOP:FOR index IN [0..STKPMAX] DO-- test other operations within that stacki _ index + LeftShift[top2StkpBits, 6];stkp _ i;IF i # STKPMAX THEN-- check +,- 1 operationsBEGIN -- begin w/ operations that use current stkp for loading rmstack&+1[stkp] _ -1;IF POINTERS[].stack # i+1 THEN ERROR;-- auto increment of stkp failedIF stack[stkp] # i+1 THEN ERROR;-- got wrong data after incrementstack&-1[stkp] _ i+1;-- rewrite current data, decrement stkpIF POINTERS[].stack # i THEN ERROR;-- auto decrement of stkp failedIF stack[stkp] # -1 THEN ERROR;-- got wrong data ater decrementstkp _ i+1;-- set stkp to check dataIF stack[stkp] # i+1 THEN ERROR;-- wrong data during auto decrementstkp _ i;-- reset stkpstack[stkp] _ 0;IF stack[stkp] # 0 THEN ERROR;-- bypass errorstack[stkp]_ 1;IF stack[stkp] = 0 THEN ERROR;-- bypass errorstack[stkp] _ i;-- reset data at "current" stkp-- now test operations that modify stkp before loading rmstack+1[stkp] _ -1;-- increment stkp, then load rmIF POINTERS[].stack # i+1 THEN ERROR;-- stkp auto increment failedIF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i+1;-- fix clobbered locationstack-1[stkp] _ -1;-- decrement stkp, then load rmIF POINTERS[].stack # i THEN ERROR;-- stkp auto decrement failedIF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i;-- fix clobbered locationEND;IF i+1 < stkpMAX THEN-- check +,- 2 operationsBEGIN -- begin w/ operations that use current stkp for loading rmstack&+2[stkp] _ -1;IF POINTERS[].stack # i+2 THEN ERROR;-- auto increment of stkp failedIF stack[stkp] # i+2 THEN ERROR;-- got wrong data after incrementstack&-2[stkp] _ i+2;-- rewrite current data, decrement stkpIF POINTERS[].stack # i THEN ERROR;-- auto decrement of stkp failedIF stack[stkp] # -1 THEN ERROR;-- got wrong datastack[stkp] _ i;-- reset data at current stkpstkp _ i+2;-- set stkp to check dataIF stack[stkp] # i+2 THEN ERROR;-- wrong data during auto decrement bgp );N bAq a1_! ]K. \rq6 Zrq9 Y\ XUX WV U2 S_ R"'1P'1O1Ni"&1M,"&1K 1J" -1Is1H6" +1F1E()z61D}1C@()z61@ #1?1>J = *1;'1:19T8r<6q5%+4^&!3 " '1#)z0&/h .*&#+ *r)4&'&&%|#r6!q"  %+H& " #)zR&1\r<q%+&!f" ')#)z &  p  3&#  B ]lkernel4.mcJuly 14, 1979 4:53 PM%3stkp _ i;-- reset stkp-- now test operations that modify stkp before loading rmstack+2[stkp] _ -1;-- increment stkp, then load rmIF POINTERS[].stack # i+2 THEN ERROR;-- stkp auto increment failedIF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i+2;-- fix clobbered locationstack-2[stkp] _ -1;-- decrement stkp, then load rmIF POINTERS[].stack # i THEN ERROR;-- stkp auto decrement failedIF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i;-- fix clobbered locationEND;IF i+2 < stkpMAX THEN-- check +,- 3 operationsBEGIN -- begin w/ operations that use current stkp for loading rmstack&+3[stkp] _ -1;IF POINTERS[].stack # i+3 THEN ERROR;-- auto increment of stkp failedIF stack[stkp] # i+3 THEN ERROR;-- stkp auto increment failedstack&-2[stkp] _ i+2;-- rewrite current data, decrement stkpIF POINTERS[].stack # i THEN ERROR;-- auto decrement of stkp failedIF stack[stkp] # -1 THEN ERROR;-- got wrong datastack[stkp] _ i;-- reset data at current stkpstkp _ i+3;-- set stkp to check dataIF stack[stkp] # i+3 THEN ERROR;-- wrong data during auto decrementstkp _ i;-- reset stkp-- now test operations that modify stkp before loading rmstack+3[stkp] _ -1;-- increment stkp, then load rmIF POINTERS[].stack # i+3 THEN ERROR;-- stkp auto increment failedIF stack[stkp] # -1 THEN ERROR;-- stkp auto increment failedstack[stkp] _ i+3;-- fix clobbered locationstack-3[stkp] _ -1;-- decrement stkp, then load rmIF POINTERS[].stack # i THEN ERROR;-- stkp auto decrement failedIF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i;-- fix clobbered locationEND;IF i>3 THEN-- check -4 operationsBEGIN -- begin w/ operations that use current stkp for loading rmstack&-4[stkp] _ -1;-- decrement stkp, then load rmIF POINTERS[].stack # i-4 THEN ERROR;-- stkp auto decrement failedIF stack[stkp] # i-4 THEN ERROR;-- didn't get data we wrotestkp _ i;IF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i-4;-- fix clobbered location-- now test operations that modify stkp before loading rmstack-4[stkp] _ -1;-- decrement stkp, then load rmIF POINTERS[].stack # i-4 THEN ERROR;-- stkp auto decrement failedIF stack[stkp] # -1 THEN ERROR;-- didn't get data we wrotestack[stkp] _ i-4-- fix clobbered locationstkp _ i;IF stack[stkp] # i THEN ERROR;ENDLOOP;ENDLOOP;-- end of stkp loopENDLOOP;-- end of top2StkpBits loop% bgp );Naq ^r6]Kq" \%+Z&YXU" W#)zU&TS_1R"Pr<OqNi%+M,&K" 'J#)zIs&H6F E&#C@ @r6?q" >J%+= &;:" 9T#)z8&6514^ 3 r<1q" 0%+/h&.*,&+)4r6'q" &%+%|&$>#!  H'  '  n m5L.kernel4.mcJuly 14, 1979 4:53 PM%4* July 14, 1979 4:53 PM%stkTestTest the various stack operations%mc[stkPMaxXC, 77];mc[pointers.stkOvf, b8];mc[pointers.stkUnd, b9];mc[pointers.stkErr, b8, b9];stkTest:* initialize the top2bits loopcall[iTopStkBits];stkTopL:* top of "top 2 bits of stkp" loopcall[nextTopStkBits];skpif[ALU#0];branch[stkXitTopL];noop;* This code writes the current stack with the address (stack[stkP] _ stkP).* It also checks that stkp_, _stack work properly.call[iStkPAddr];* initialize stack index [1..maxStkXC]stkIL:call[nextStkPAddr];* top of stk init loop. here we check stkp_ and _stack.skpif[ALU#0];branch[stkiXit];stkp _ t;* load stkpcall[chkStkErr];skpif[ALU=0];stkiErr0:* got stack underflow or overflowerror;call[getRealStkAddr], rscr _ t;t # (rscr);* compare real stkp with value we loadedskpif[ALU=0];stkiErr1:* t = tskp, rscr = value we loadederror;* This is a limited test of the bits in the stack memory: write zero, -1, alternating 10, 01t _ stack _ t-t;t _ t #(Q_stack) ;skpif[ALU=0];stkiErr2:* wrote zero, got back something elseerror;* Q = value from stackt _ rm1;stack _ t;t _ t #(Q_stack) ;skpif[ALU=0];stkiErr3:* wrote -1 got back something else.error;* t = bad bits Q = value from stackt _ r01;stack _ t;t _ t #(Q_stack) ;skpif[ALU=0];stkiErr4:* wrote r01 got back something else.error;* t = bad bits. Q = value from stackt _ r10;stack _ t;t _ t #(Q_stack) ;skpif[ALU=0];stkiErr5:* wrote r10 got back something else.error;* t = bad bits. Q = value from stackt _ rscr;* t _ current indexstack_t;* stack[i] _i, then check itt # (Q_stack);skpif[ALU=0];stkiErr6:* wrote stkp from rscr. Q = value from stackerror;* read it into t. they aren't the samebranch[stkiL];stkiXit: bgp );N bAq a@_p&q! ^ ]Kpq \pq Zpq Ypq XUp&q@W Up&q"@T@S_ @R"@P NiK M,2@K&& Jp@Isq&7@H6 @F@E& @D}@C@ Bp&q!@@@>J@= &(@; :p&q"@9T 6\@5@4^@3 1p&q%@0&@.*@, @+@*r )4p&q#@'&#@%|@$> @#@! p&q$@H&$@@ @R@ p&q$@&$@&@&@ @f )p&q,@ &&@ pp ?=]?kernel4.mcJuly 14, 1979 4:53 PM%5* July 14, 1979 4:53 PM* We have successfully written the stack using non incrementing and non decrementing* operations. Now we test stack&+1_, stack&-1_, stack+1_, stack-1_call[iStkPAddr];* init the main loop for the main teststkTestL:* top of main loopcall[nextStkPAddr];* get next stack index or exit loopskpif[alu#0];branch[stkTestXitL];stkp _ t;* stackP _ icall[chkStkErr];skpif[ALU=0];stkpErr10:* got stack underflow or overflowerror;rscr _ t and (77c);* isolate the index (exclude top 2 bits)(rscr)-(stkPMaxXC);* skip this test if it would cause overflowbranch[afterStkTest1, ALU=0];t # (Q_stack);* see if stack[stkp] = stkpskpif[ALU=0];* if not, an earlier execution of this loop clobberedstkpErr1:* the stack entry at location in t, or this is first timeerror;* thru, and the initialization didn't work properly.*Q=value from stack* stack&+1 stack&+1 stack&+1 stack&+1 stack&+1 stack&+1 stack&+1 stack&+1stack&+1 _ cm1;* stack[stackP] _ -1, then stackP _ stackP+1call[chkStkErr];skpif[ALU=0];stk&+1Err0:* got stack underflow or overflowerror;call[getRealStkAddr], rscr_t+1;* compare stackPAddr from Pointers w/ expected valt #(rscr);skpif[ALU=0];stkP1AddrErr:* auto increment of StackP failed. rscr = expected value,error;* t = value from Pointerst _ t # (Q_stack);skpif[ALU=0];stkP1ValErr:* value at stackp is bad. Q = value from stackerror;* t = expected val, rscr = stack's val from Pointerst _ rscr;* restore t* stack&-1 stack&-1 stack&-1 stack&-1 stack&-1 stack&-1 stack&-1 stack&-1 stack&-1stack&-1 _ t;* stack["i+1"] _ i+1, stackp _ i.call[chkStkErr];skpif[ALU=0];stkpErr12:* got stack underflow or overflowerror;call[getRealStkAddr], rscr _ t-1;t # (rscr);* compare expected stkP (rscr) withskpif[ALU=0];* actual stkp (t)stkM1AddrErr:* auto decrement failederror;t _ cm1;t _ t # (Q_stack);skpif[ALU=0];* see if original stack&+1 _ cm1 workedstkP1ValErr2:* stack&+1 seems to have clobbered theerror;* (i+1)th value. t = bad bits. Q = value from stackt _ rscr;* restore t(stack)_ t;* reset stk[stkp] to contain stkpcall[chkStkErr];skpif[ALU=0]; bgp );N bAq aT _B@]K&& \p&q@Z&#@Y @XU@W& @T@S_ R"p &q!@P@Ni&(@M,&+@K@Is &@H6 &5 Fp&q9@E&4 D}@ BpI@?q&,@>J@= ;p &q!@:@8&2@6 @5 4^p &q9@3 &@0@/h .*p &q.@,&4@+& )4pR@&q &!@$>@# !p &q!@ @ !@ &#@ & Rp &q@@@\@ &' p &q&@&3@)& @ &!@ p@ 3 . @]4kernel4.mcJuly 14, 1979 4:53 PM%6stkpErr13:* got stack underflow or overflowerror;rscr _ t _ t+1;stkp _ t;* check the data modified during "stack&-1" instructiont _ t # (Q_stack);* compare tos with expected valuskpif[ALU=0];stkM1ValErr:*. Q = value from stackerror;* t = bad bits, rscr = expected valuet _ rscr _ (rscr)-1;* t, rscr _ "i"stkp _ t;* stkp is at i+1 now. Fix it.call[chkStkErr];skpif[ALU=0];stkpErr14:* got stack underflow or overflowerror;Q _ stack;* save stack valuestack _ t-t;PD_(stack);skpif[ALU=0];stkByPassErr0:* didn't notice that we just zeroed the stackerror;t _ cm1;stack _ cm1;PD _ (stack) # t;skpif[ALU=0];stkByPassErr1:* didn't notice that we just put all oneserror;* in the stack.stack _ Q;* restore stack* stack+1 stack+1 stack+1 stack+1 stack+1 stack+1 stack+1 stack+1 stack+1 stack+1rscr _ (rscr)+1;* compute expected stkp valuet _ cm1;stack+1 _ t;* stkp _ i+1, stack[stkp] _ -1call[chkStkErr];skpif[ALU=0];stkpErr15:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;skpif[ALU=0];stkP1AddrErr2:* expected Rscr, got stackp in t, they're differenterror;t _ cm1;t _ t # (Q_stack);* check that we loaded -1 into incremented stack locationskpif[ALU=0];* Q = value from stackstkP1ValErr3:* t = bad bitserror;t _ rscr;* restore t* stack-1 stack-1 stack-1 stack-1 stack-1 stack-1 stack-1 stack-1 stack-1 stack-1stack _ t;* reset stack which was clobbered by "stack+1_cm1"call[chkStkErr];skpif[ALU=0];stkpErr16:* got stack underflow or overflowerror;rscr _ t-1;* compute expected value of rscrt _ cm1;stack-1 _ t;* (stack-1) _ "-1"call[chkStkErr];skpif[ALU=0]; bgp );N bA &q!@a@^@]K&7@\&@Z Yp &q@XU&%@U&@T&@R"@P Op &q!@Ni@K &@J @Is @H6 Fp &q-@E@D}@C@ @B@@ ?p &q)@>J&@; & 9TpQ@6q&@5@4^ &@1@0 /hp &q!@.*@+@*r @)4 'p &q3@&@$>@#&9@! & p &q @H@ & pQ@q &2@@\ p &q!@@f &@)@ &@ p@ 3 D @]"kernel4.mcJuly 14, 1979 4:53 PM%7stkpErr17:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;* see if real stkp (t) matches expected stkp (rscr)skpif[ALU=0];stkM1AddrErr2:error;t _ cm1;t _ t # (Q_stack);* compare tos with -1skpif[ALU=0];stkM1ValErr2:* Q = value from stackerror;* t = bad bits, expected -1t _ rscr;* restore t(stack) _ t;* restore addr as value in stack: stack[stkp]_stkpcall[chkStkErr];skpif[ALU=0];stkpErr18:* got stack underflow or overflowerror;noop;* for placementafterStkTest1: bgp );N bA &q!@a@^@]K &3@\ Zp @Yq@W@U&@T S_p &q@R"&@O& @Ni &2@K@J Isp &q!@H6@F& D}p  C<$vkernel4.mcJuly 14, 1979 4:53 PM%8* November 30, 1978 6:07 PM%remember, don't execute if i=1, if i+2=77%call[getStkPAddr];rscr _ t and (77c);* isolate the index (exclude top 2 bits)rscr _ (rscr)+1;(rscr)-(stkPMaxXC);* skip this test if it would cause overflowbranch[afterStkTest2, ALU>=0];t # (Q_stack);* see if stack[stkp] = stkpskpif[ALU=0];* if not, an earlier execution of this loop clobberedstkpErr21:* the stack entry at location in t, or this is first timeerror;* thru, and the initialization didn't work properly.*Q=value from stack* stack&+2 stack&+2 stack&+2 stack&+2 stack&+2 stack&+2 stack&+2 stack&+2stack&+2 _ cm1;* stack[stackP] _ -1, then stackP _ stackP+2call[chkStkErr];skpif[ALU=0];stk&+2Err0:* got stack underflow or overflowerror;call[getRealStkAddr], rscr_t+(2c);* compare stackPAddr from Pointers w/ expected valt #(rscr);skpif[ALU=0];stkP2AddrErr:* auto increment of StackP failed. rscr = expected value,error;* t = value from Pointerst _ t # (Q_stack);skpif[ALU=0];stkP2ValErr:* value at stackp is bad. Q = value from stackerror;* t = expected val, rscr = stack's val from Pointerst _ rscr;* restore t* stack&-2 stack&-2 stack&-2 stack&-2 stack&-2 stack&-2 stack&-2 stack&-2 stack&-2stack&-2 _ t;* stack["i+2"] _ i+2, stackp _ i.call[chkStkErr];skpif[ALU=0];stkpErr22:* got stack underflow or overflowerror;call[getRealStkAddr], rscr _ t-(2c);t # (rscr);* compare expected stkP (rscr) withskpif[ALU=0];* actual stkp (t)stkM2AddrErr:* auto decrement failederror;t _ cm1;t _ t # (Q_stack);skpif[ALU=0];* see if original stack&+2 _ cm1 workedstkP2ValErr2:* stack&+2 seems to have clobbered theerror;* (i+2)th value. t = bad bits. Q = value from stackt _ rscr;* restore t(stack)_ t;* reset stk[stkp] to contain stkpcall[chkStkErr];skpif[ALU=0];stkpErr23:* got stack underflow or overflowerror;rscr _ t _ t+(2C);stkp _ t;* check the data modified during "stack&-2" instructiont _ t # (Q_stack);* compare tos with expected valuskpif[ALU=0];stkM2ValErr:*. Q = value from stackerror;* t = bad bits, rscr = expected value* stack+2 stack+2 stack+2 stack+2 stack+2 stack+2 stack+2 stack+2 stack+2 stack+2 bgp );N bAq ap*@_q@^&(@]K@\&+@Z@XU &@W &5 Up &q9@T&4 S_@ PpI@Niq&,@M,@K Jp &q!@Is@F"&2@E @D} C@p &q9@B&@?@>J = p &q.@;&4@:& 8pR@5q &!@3 @1 0p &q!@/h@,$@+ &#@*r & )4p &q@'@%|@$>@# &' !p &q&@ &3@ & @ &!@R@ p &q!@@@&7@&@f )p &q@ &% ppQH @]6kernel4.mcJuly 14, 1979 4:53 PM%9t _ rscr _ (rscr)-(2c);* t, rscr _ "i"stkp _ t;* stkp is at i+2c now. Fix it.call[chkStkErr];skpif[ALU=0];stkpErr24:* got stack underflow or overflowerror;rscr _ t+(2c);* compute expected stkp valuet _ cm1;stack+2 _ t;* stkp _ i+2, stack[stkp] _ -1call[chkStkErr];skpif[ALU=0];stkpErr25:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;skpif[ALU=0];stkP2AddrErr2:* expected stackP t, got stackp in Rscr, they're differenterror;t _ cm1;t _ t # (Q_stack);* check that we loaded -1 into incremented stack locationskpif[ALU=0];* Q = value from stackstkP2ValErr3:* t = bad bitserror;t _ rscr;* restore t* stack-2 stack-2 stack-2 stack-2 stack-2 stack-2 stack-2 stack-2 stack-2 stack-2stack _ t;* reset stack which was clobbered by "stack+2_cm1"call[chkStkErr];skpif[ALU=0];stkpErr26:* got stack underflow or overflowerror;rscr _ t-(2c);* compute expected value of rscrt _ cm1;stack-2 _ t;* (stack-2) _ "-1"call[chkStkErr];skpif[ALU=0];stkpErr27:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;* see if real stkp (t) matches expected stkp (rscr)skpif[ALU=0];stkM2AddrErr2:error;t _ cm1;t _ t # (Q_stack);* compare tos with -1skpif[ALU=0];stkM2ValErr2:* Q = value from stackerror;* t = bad bits, expected -1t _ rscr;* restore t(stack) _ t;* restore addr as value in stack: stack[stkp]_stkpcall[chkStkErr];skpif[ALU=0];stkpErr228:* got stack underflow or overflowerror;noop;* for placementafterStkTest2: bgp );N@bAq&@a&@^@]K \p &q!@Z@XU &@W@U &@S_@R" Pp &q!@O@M,@K @J Isp &q:@H6@E@D}&9@C@ & Bp &q @@@?& = pQ@:q &2@8@6 5p &q!@4^@1 &@0@/h &@,@+ *rp &q!@)4@&@%| &3@$> #p @!q@H@ &@ p &q@R&@& @ &2@@ p &q!@f@)& p  MAA\kernel4.mcJuly 14, 1979 4:53 PM%10* December 1, 1978 3:19 PM%remember, don't execute if i=1, if i+3>=77%noop;* placement for afterStkTest2 branchcall[getStkPAddr];rscr _ t and (77c);* isolate the index (exclude top 2 bits)rscr _ (rscr)+(2c);(rscr)-(stkPMaxXC);* skip this test if it would cause overflowbranch[afterStkTest3, ALU>=0];t # (Q_stack);* see if stack[stkp] = stkpskpif[ALU=0];* if not, an earlier execution of this loop clobberedstkpErr31:* the stack entry at location in t, or this is first timeerror;* thru, and the initialization didn't work properly.*Q=value from stack* stack&+3 stack&+3 stack&+3 stack&+3 stack&+3 stack&+3 stack&+3 stack&+3stack&+3 _ cm1;* stack[stackP] _ -1, then stackP _ stackP+3call[chkStkErr];skpif[ALU=0];stk&+3Err0:* got stack underflow or overflowerror;call[getRealStkAddr], rscr_t+(3c);* compare stackPAddr from Pointers w/ expected valt #(rscr);skpif[ALU=0];stkP3AddrErr:* auto increment of StackP failed. rscr = expected value,error;* t = value from Pointerst _ t # (Q_stack);skpif[ALU=0];stkP3ValErr:* value at stackp is bad. Q = value from stackerror;* t = expected val, rscr = stack's val from Pointerst _ rscr;* restore t* stack&-3 stack&-3 stack&-3 stack&-3 stack&-3 stack&-3 stack&-3 stack&-3 stack&-3stack&-3 _ t;* stack["i+3"] _ i+3, stackp _ i.call[chkStkErr];skpif[ALU=0];stkpErr32:* got stack underflow or overflowerror;call[getRealStkAddr], rscr _ t-(3c);t # (rscr);* compare expected stkP (rscr) withskpif[ALU=0];* actual stkp (t)stkM3AddrErr:* auto decrement failederror;t _ cm1;t _ t # (Q_stack);skpif[ALU=0];* see if original stack&+3 _ cm1 workedstkP3ValErr2:* stack&+3 seems to have clobbered theerror;* (i+3)th value. t = bad bits. Q = value from stackt _ rscr;* restore t(stack)_ t;* reset stk[stkp] to contain stkpcall[chkStkErr];skpif[ALU=0];stkpErr33:* got stack underflow or overflowerror;rscr _ t _ t+(3C);stkp _ t;* check the data modified during "stack&-3" instructiont _ t # (Q_stack);* compare tos with expected valuskpif[ALU=0];stkM3ValErr:*. Q = value from stackerror;* t = bad bits, rscr = expected value* stack+3 stack+3 stack+3 stack+3 stack+3 stack+3 stack+3 stack+3 stack+3 stack+3 bgp );N bAq ap+@_q&$@^@]K&(@\@Z&+@Y@W &@U &5 Tp &q9@S_&4 R"@ OpI@M,q&,@K@J Isp &q!@H6@E"&2@D} @C@ Bp &q9@@&@>J@= ;p &q.@:&4@9T& 6pR@4^q &!@1@0 /hp &q!@.*@+$@*r &#@)4 & 'p &q@&@$>@#@! &' p &q&@H&3@& @ &!@@ p &q!@\@@&7@f&@) p &q@ &% 3pQt @]<kernel4.mcJuly 14, 1979 4:53 PM%11t _ rscr _ (rscr)-(3c);* t, rscr _ "i"stkp _ t;* stkp is at i+3c now. Fix it.call[chkStkErr];skpif[ALU=0];stkpErr34:* got stack underflow or overflowerror;rscr _ t+(3c);* compute expected stkp valuet _ cm1;stack+3 _ t;* stkp _ i+3, stack[stkp] _ -1call[chkStkErr];skpif[ALU=0];stkpErr35:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;skpif[ALU=0];stkP3AddrErr2:* expected stackP t, got stackp in Rscr, they're differenterror;t _ cm1;t _ t # (Q_stack);* check that we loaded -1 into incremented stack locationskpif[ALU=0];* Q = value from stackstkP3ValErr3:* t = bad bitserror;t _ rscr;* restore t* stack-3 stack-3 stack-3 stack-3 stack-3 stack-3 stack-3 stack-3 stack-3 stack-3stack _ t;* reset stack which was clobbered by "stack+3_cm1"call[chkStkErr];skpif[ALU=0];stkpErr36:* got stack underflow or overflowerror;rscr _ t-(3c);* compute expected value of rscrt _ cm1;stack-3 _ t;* (stack-3) _ "-1"call[chkStkErr];skpif[ALU=0];stkpErr37:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;* see if real stkp (t) matches expected stkp (rscr)skpif[ALU=0];stkM3AddrErr2:error;t _ cm1;t _ t # (Q_stack);* compare tos with -1skpif[ALU=0];stkM3ValErr2:* Q = value from stackerror;* t = bad bits, expected -1t _ rscr;* restore t(stack) _ t;* restore addr as value in stack: stack[stkp]_stkpcall[chkStkErr];skpif[ALU=0];stkpErr38:* got stack underflow or overflowerror;noop;* for placementafterStkTest3: bgp );N@aq&@_&@]K@\ Zp &q!@Y@W &@U@T &@R"@P Op &q!@Ni@K@J @Is H6p &q:@F@D}@C@&9@B & @p &q @?@>J& ;pQ@9Tq &2@6@5 4^p &q!@3 @0 &@/h@.* &@+@*r )4p &q!@'@%|@$> &3@# !p @ q@ @&@ Rp &q@&@& @\ &2@@ fp &q!@)@ & pp  AA]kernel4.mcJuly 14, 1979 4:53 PM%12* December 1, 1978 4:57 PM%remember, don't execute if i=1, if i+4>=77%noop;* placement for the afterStkTest3 checkcall[getStkPAddr];rscr _ t and (77c);* isolate the index (exclude top 2 bits)rscr _ (rscr)+(3c);(rscr)-(stkPMaxXC);* skip this test if it would cause overflowbranch[afterStkTest4, ALU>=0];t # (Q_stack);* see if stack[stkp] = stkpskpif[ALU=0];* if not, an earlier execution of this loop clobberedstkpErr41:* the stack entry at location in t, or this is first timeerror;* thru, and the initialization didn't work properly.*Q=value from stack* Simulate stack&+4 -- hardware can perform stack&+3 as maximum incrementstack&+3 _ cm1;* stack[stackP] _ -1, then stackP _ stackP+4stkp+1;* simulate +4call[chkStkErr];skpif[ALU=0];stk&+4Err0:* got stack underflow or overflowerror;call[getRealStkAddr], rscr_t+(4c);* compare stackPAddr from Pointers w/ expected valt #(rscr);skpif[ALU=0];stkP4AddrErr:* auto increment of StackP failed. rscr = expected value,error;* t = value from Pointerst _ t # (Q_stack);skpif[ALU=0];stkP4ValErr:* value at stackp is bad. Q = value from stackerror;* t = expected val, rscr = stack's val from Pointerst _ rscr;* restore t* stack&-4 stack&-4 stack&-4 stack&-4 stack&-4 stack&-4 stack&-4 stack&-4 stack&-4stack&-4 _ t;* stack["i+4"] _ i+4, stackp _ i.call[chkStkErr];skpif[ALU=0];stkpErr42:* got stack underflow or overflowerror;call[getRealStkAddr], rscr _ t-(4c);t # (rscr);* compare expected stkP (rscr) withskpif[ALU=0];* actual stkp (t)stkM4AddrErr:* auto decrement failederror;t _ cm1;t _ t # (Q_stack);skpif[ALU=0];* see if original stack&+4 _ cm1 workedstkP4ValErr2:* stack&+4 seems to have clobbered theerror;* (i+4)th value. t = bad bits. Q = value from stackt _ rscr;* restore t(stack)_ t;* reset stk[stkp] to contain stkpcall[chkStkErr];skpif[ALU=0];stkpErr43:* got stack underflow or overflowerror;rscr _ t _ t+(4C);stkp _ t;* check the data modified during "stack&-4" instructiont _ t # (Q_stack);* compare tos with expected valuskpif[ALU=0];stkM4ValErr:*. Q = value from stackerror;* t = bad bits, rscr = expected value bgp );N bAq ap+@_q&'@^@]K&(@\@Z&+@Y@W &@U &5 Tp &q9@S_&4 R"@ OpI@M,q&,@K& @J@Is H6p &q!@F@D}"&2@C@ @B @p &q9@?&@= @; :p &q.@9T&4@8& 5pR@3 q &!@0@/h .*p &q!@,@*r$@)4 &#@' & &p &q@%|@#@!@ &' Hp &q&@ &3@& @R &!@@ \p &q!@@@f&7@)&@ p &q@ p&%: @]=kernel4.mcJuly 14, 1979 4:53 PM%13* stack+4 stack+4 stack+4 stack+4 stack+4 stack+4 stack+4 stack+4 stack+4 stack+4t _ rscr _ (rscr)-(4c);* t, rscr _ "i"stkp _ t;* stkp is at i+4c now. Fix it.call[chkStkErr];skpif[ALU=0];stkpErr44:* got stack underflow or overflowerror;rscr _ t+(4c);* compute expected stkp valuet _ cm1;stkp+1;* simulate stack+4stack+3 _ t;* stkp _ i+4, stack[stkp] _ -1call[chkStkErr];skpif[ALU=0];stkpErr45:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;skpif[ALU=0];stkP4AddrErr2:* expected stackP t, got stackp in Rscr, they're differenterror;t _ cm1;t _ t # (Q_stack);* check that we loaded -1 into incremented stack locationskpif[ALU=0];* Q = value from stackstkP4ValErr3:* t = bad bitserror;t _ rscr;* restore t* stack-4 stack-4 stack-4 stack-4 stack-4 stack-4 stack-4 stack-4 stack-4 stack-4stack _ t;* reset stack which was clobbered by "stack+4_cm1"call[chkStkErr];skpif[ALU=0];stkpErr46:* got stack underflow or overflowerror;rscr _ t-(4c);* compute expected value of rscrt _ cm1;stack-4 _ t;* (stack-4) _ "-1"call[chkStkErr];skpif[ALU=0];stkpErr47:* got stack underflow or overflowerror;call[getRealStkAddr];(rscr) # t;* see if real stkp (t) matches expected stkp (rscr)skpif[ALU=0];stkM4AddrErr2:error;t _ cm1;t _ t # (Q_stack);* compare tos with -1skpif[ALU=0];stkM4ValErr2:* Q = value from stackerror;* t = bad bits, expected -1t _ rscr;* restore t(stack) _ t;* restore addr as value in stack: stack[stkp]_stkpcall[chkStkErr];skpif[ALU=0];stkpErr48:* got stack underflow or overflowerror;noop;* for placement bgp );N bAqpqpqpqpqpqpqpqpqpq@_&@^&@\@Z Yp &q!@XU@U &@T@S_&@R" &@O@Ni M,p &q!@K@Is@H6 @F Ep &q:@D}@B@@&9@? & >Jp &q @= @;& 9TpQ@6q &2@4^@3 1p &q!@0@.* &@,@+ &@)4@' &p &q!@%|@#@! &3@ Hp @ q@@R&@ p &q@&@& @ &2@f@) p &q!@ @ p& AA]0kernel4.mcJuly 14, 1979 4:53 PM%14afterStkTest4:branch[stkTestL];stkTestXitL:branch[stkTopL]; bgp );N bA @aq _p @^q^ ](g 'kernel4.mcJuly 14, 1979 4:53 PM%15* November 27, 1978 10:31 AM.iStkPAddr: subroutine;return, stackPAddr _ t-t;* first valid index is one.nextStkPAddr: subroutine;* stack indeces are 6 bits long.*Return (stackPaddr OR stackPtopBits) in T. It's an 8 bit address.*ALU#0 =>valid value.klink _ link;t _ stackPAddr _ (stackPAddr) + 1;* increment the indext and (77c);* check for 6 bit overflowskpif[ALU=0], t _ t + (stackPTopBits);* OR the top two bits into returned valueskip, rscr _ 1c;* indicate valid valuerscr _ t-t;* indicate invalid valuereturnAndBranch[klink, rscr];getStkPAddr: subroutine;t _ stackPAddr;return, t _ t + (stackPTopBits);iTopStkBits: subroutine;t _ (r0) - (100c);return, stackPTopBits _ t;* first valid index is zero.nextTopStkBits: subroutine;klink _ link;top level;t _ stackPTopBits _ (stackPTopBits)+(100c);t - (400c);skpif[ALU#0], rscr _ 1c;rscr _ t-t;returnAndBranch[klink, rscr];getRealStkAddr: subroutine;t _ TIOA&Stkp;return, t _ t and (377c);chkStkErr: subroutine;* rtn w/ ALU#0 ==> stk (underflow or overflow).* Clobber rscr2 _ Pointers[]rscr2 _ Pointers[];return, rscr2 _ (rscr2) AND (pointers.stkErr);top level;stkXitTopL: bgp );N bAq _p q @^& \p q & Z@A Y@@W @U"&@T &@S_&()@R"&@P &@O M,p q @K@J H6p q @F@E& D}pq @C@ @B @@+@? @>J@= @; 9Tpq @8 @6 4^p q &/ 3 @1@0.@/h .*p  +9<kernel4.mcJuly 14, 1979 4:53 PM%16* September 3, 1977 2:25 PM%TEST CARRY20 FUNCTIONThis function causes a 1 go be or'd into the carry out bit that is usedas input to bit 11 in the alu. Given that there was not already a carry, thisfunction has the effect of adding 20B to the value in the alu.%carry20Test:t_rscr_17C;t_t+(r0),CARRY20;rscr2 _ 37C;t_t#(rscr2);skpif[ALU=0];error;* T NE 17B + 0 + CARRY20t_rscr;t_t+(r1),CARRY20;* t_17B+1+CARRY20rscr2_20C;t_t#(rscr2);skpif[ALU=0];error;* T NE 17B+1=20(=17B+1+CARRY20)t_r0;t_t+(r0),CARRY20;* t_0+0+CARRY20rscr2_20C;t_t#(rscr2);skpif[ALU=0];error;* T NE 20B=0+0+CARRY20t_r0;t_t-(rscr2);* t_-20B=(0-20B)t_t+(r0),CARRY20;skpif[ALU=0];error; bgp );N bAq a_]KG \M Z> XU Wp qU TS_ R" P O+M,K+J Is H6 F+D}C@+B @ ? >J+;: +9T8 6 5x42kernel4.mcJuly 14, 1979 4:53 PM%17* September 11, 1977 1:57 PM%TEST XORCARRY FUNCTIONXORCARRY causes the carry in bit for bit 15 of the alu to be xor'd.Normally this bit is 0. When the bit is one, alu arithmetic functions willsee a carry into bit 0. For A-B the ALUFM is programmed to provide a oneand XORCARRY will leave a result one less than expected.%xorCarryTest:t_(r0)+(r0),XORCARRY;t_t#(r1);skpif[ALU=0];error;* 1 = 0+0+XORCARRYt_r1;t_t+(r0),XORCARRY;t_t#(2C);skpif[ALU=0];xorCarryb:error;* 2= 0+1+XORCARRYt_r1;t_t+(r1),XORCARRY;t_t#(3C);skpif[ALU=0];xorCarryc:error;* 3= 1+1+XORCARRYt_RM1;t_t+(r0),XORCARRY;skpif[ALU=0];xorCarryd:error;* 0= -1+XORCARRYt_(r0)AND(r0),XORCARRY;skpif[ALU=0];xorCarrye:error;* CIN SHOULD BE IGNORED ON LOGICAL OPS!t_(r1)AND(r1),XORCARRY;t_t#(r1);skpif[ALU=0];xorCarryf:error;* SHOULD BE 1. CIN IGNORED ON LOGICAL OPSt_(RM1)OR(RM1),XORCARRY;t_t#(RM1);skpif[ALU=0];xorCarryg:error;* SHOULD BE -1. CIN IGNORED ON LOGICAL OPSt_(r1)-(r1),XORCARRY;t_t#(RM1);skpif[ALU=0];xorCarryh:error;* BWL SEZ THIS SHOULD BE -1. IE.,* R1-R1 causes 1+1777777, but xorcarry causes the op to become,* 1+177776 because "A-B" uses carryin = 1, and xorcarry causes it to be* zero! bgp );N bAq a_]KC \J ZH Y8 XU Wp qUTS_ R"+ONiM,K JpqIs+FED}C@ Bpq@+>J= ; :pq9T+65 4^pq3 +'0/h.* ,pq++))4' & %|pq$>+*! H  pq+! ? RG  <0PWkernel4.mcJuly 14, 1979 4:53 PM%18* September 12, 1977 9:52 AM%TEST USESAVEDCARRYThis function causes the alu carry bit from the last instruction to be used asthe carry in bit to bit 15 during the current instruction. This bit is usuallyprovided by the alufm and is usually zero (its the bit complemented by thexorcarry function).%%commented outsavedCarry:T_(RHIGH1)+(RHIGH1);* T_0, CARRY_1T_T+(R0),USESAVEDCARRY;* T_0+0+LAST CARRYT_T#(R1);SKPIF[ALU=0];ERROR;* EXPECTED 1, USED LASTCARRY=1T_(RM1)+(RM1);* T_-2, CARRY _1T_T+(R1),USESAVEDCARRY;* T_-2+1+LAST CARRYSKPIF[ALU=0];savedCarryB:ERROR;* EXPECTED 0, USED LASTCARRY=1T_(R0)+(R0);* T_0, CARRY_0T_(R1)+(R1),USESAVEDCARRY;* T_1+1+LAST CARRYT_T#(2C);SKPIF[ALU=0];savedCarryC:ERROR;* EXPECTED 2, USED LASTCARRY=0T_(R0)+(R0);* T_0, CARRY_0T_(RM1)+(RM1),USESAVEDCARRY;* T_(-1)+(-1)+LAST CARRYT_T#(177776C);SKPIF[ALU=0];savedCarryD:ERROR;* EXPECTED -2, USED LASTCARRY=0T_(RM1)+(RM1);* T_-2, CARRY_1T_(R1)+(R1),USESAVEDCARRY;* T_1+1+LAST CARRYT_T#(3C);SKPIF[ALU=0];savedCarryE:ERROR;* EXPECTED 3, USED LASTCARRY=1commented out% bgp );N bAq a_ ]KN \N ZJ Y XU W+p U qT+ S_+R"P O+M, +K+J Isp qH6+E + D}+C@B @p q?+= + ;+: 9T 8p q6+4^ +3 +10 /hp q.*++,p 4 *O4=kernel4.mcJuly 14, 1979 4:53 PM%19* September 14, 1977 12:03 PM%TEST MULTIPLY STEP.MULTIPLY works as follows:H3[0:15] _ CARRY,,ALU[0:14] ==> CARRY,,ALU/2Q[0:15] _ ALU[15],,Q[0:14] ==> ALU[15],,Q/2Q[14] OR'D INTO TNIA[10] AS SLOW BRANCH! ==> ADDR OR'D 2 IF Q[14]=1These tests invoke mulCheck, a subroutine that performs two services:1) T_T+RSCR,MULTIPLY2) RSCR2_1 IF Q[14] BRANCH IS TAKEN (ZERO OTHERWISE)ERRORS are numbered 1 thru 3:mulXerr1 ==> T value wrong (H3)mulXerr2 ==> Q[14] branch wrongmulXerr3 ==> Q value wrong%multiplyTest:* Q[14]=0, CARRY=0, ALU15=0t_Q_r0;rscr_t;call[mulCheck];* t_t+rscr,MULTIPLY==>ALU_0, CARRY_0skpif[R EVEN],rscr2_rscr2;mulAerr1:error;* TOOK Q[14]=1 BRANCHt_t;skpif[ALU=0];mulAerr2:error;* CARRY,,(0+0)/2 SHOULD BE ZEROt_Q;skpif[ALU=0];mulAerr3:error;* ALU15,,Q[0:14] SHOULD BE ZERO*Q[14]=0, CARRY=1, ALU15=0multiplyB:* Q=0; t_-1+1,MULTIPLYQ_r0;rscr_r1;call[mulCheck],t_rm1;* t_t+rscr,MULTIPLY==>ALU_0, CARRY_1skpif[R EVEN], rscr2_rscr2;mulBerr1:error;* TOOK Q[14]=1 BRANCHt_t#(rhigh1);*-1+1 GENERATES CARRY BITskpif[ALU=0];mulBerr2:error;* CARRY,,(0+0)/2 SHOULD BE 100000t_Q;* -1+1 WOULD LEAVE ALU15=0skpif[ALU=0];mulBerr3:error;* ALU15,,Q[0:14] SHOULD BE ZERO*Q[14]=0, CARRY=0, ALU15=1multiplyC:* Q=0; t_0+1,MULTIPLYt_Q_r0;rscr_r1;call[mulCheck];* t_t+rscr,MULTIPLY==>ALU_1, CARRY_0skpif[R EVEN], rscr2_rscr2;mulCerr1:error;* TOOK Q[14]=1 BRANCHt_t;* 0+1==> CARRY_0skpif[ALU=0];mulCerr2:error;* CARRY,,(0+1)/2 SHOULD BE 0t_(rhigh1)#(Q);* 0+1 WOULD LEAVE ALU15=1skpif[ALU=0]; bgp );N bAq a_ ]K\-Z-YC WEUT5R"PONi M, Kp q JIsH6Fj$E D}pqC@@? >Jpq= :9T 8pq6 4^ 3 pq10/h$.* ,pq+)4 ' &pq%|!#! pqH  pqRj$ \pqf )pq  pj 3  0]+kernel4.mcJuly 14, 1979 4:53 PM%20mulCerr3:error;* ALU15,,Q[0:14] SHOULD BE 100000*Q[14]=0, CARRY=1, ALU15=1multiplyD:* Q=0; t_100001+100000,MULTIPLYQ_r0;t_rscr_rhigh1;call[mulCheck],t_t+(r1);* t_t+rscr,MULTIPLY==>ALU_1, CARRY_1skpif[R EVEN], rscr2_rscr2;mulDerr1:error;* TOOK Q[14]=1 BRANCHt_t#(rhigh1);* 1000001+100000==> CARRY_1skpif[ALU=0];mulDerr2:error;* CARRY,,(1000001+100000)/2 SHOULD BE 100000t_(rhigh1)#(Q);* 1000001+100000 WOULD LEAVE ALU15=1skpif[ALU=0];mulDerr3:error;* ALU15,,Q[0:14] SHOULD BE 100000multiplyE:* Q[14]=1, CARRY=0, ALU15=0t_(r1)+(r1);Q_t;* Q[14]_1t_r0;rscr_t;call[mulCheck];* t_t+rscr,MULTIPLY==>ALU_0, CARRY_0skpif[R ODD],rscr2_rscr2;mulEerr1:error;* DIDN'T TAKE Q[14]=1 BRANCHt_t;skpif[ALU=0];mulEerr2:error;* CARRY,,(0+0)/2 SHOULD BE ZEROt_(r1)#(Q);skpif[ALU=0];mulEerr3:error;* ALU15,,Q[0:14] SHOULD BE 1*Q[14]=1, CARRY=1, ALU15=0multiplyF:* Q=1; t_-1+1,MULTIPLYt_(r1)+(r1);Q_t;* Q[14]_1rscr_r1;call[mulCheck],t_rm1;* t_t+rscr,MULTIPLY==>ALU_0, CARRY_1skpif[R ODD], rscr2_rscr2;mulFerr1:error;* DIDN'T TAKE Q[14]=1 BRANCHt_t#(rhigh1);*-1+1 GENERATES CARRY BITskpif[ALU=0];mulFerr2:error;* CARRY,,(0+0)/2 SHOULD BE 100000t_(r1)#(Q);* -1+1 WOULD LEAVE ALU15=0skpif[ALU=0];mulFerr3:error;* ALU15,,Q[0:14] SHOULD BE 1*Q[14]=1, CARRY=0, ALU15=1multiplyG:* Q=1; t_0+1,MULTIPLYt_(r1)+(r1);Q_t;* Q[14]_1t_r0;rscr_r1;call[mulCheck];* t_t+rscr,MULTIPLY==>ALU_1, CARRY_0skpif[R ODD], rscr2_rscr2;mulGerr1: bgp );N bAqa! ^ ]Kpq\Z Y $XU WpqUS_ R" PpqO,M,j$K JpqIs! Fpq E+D} C@+B@?+$>J = pq;+9T8 6pq5+3 1 0pq/h+ ,+ +pq+*r )4+'&+$%| $>pq#+ +H  pq+!R + pq+ + pq+ f+)  +$ p 3pq 8(]Ckernel4.mcJuly 14, 1979 4:53 PM%21error;* DIDN'T TAKE Q[14]=1 BRANCHt_t;* 0+1==> CARRY_0skpif[ALU=0];mulGerr2:error;* CARRY,,(0+1)/2 SHOULD BE 0t_(rhigh1)+1;* 0+1 WOULD LEAVE ALU15=1t_t#(Q);skpif[ALU=0];mulGerr3:error;* ALU15,,Q[0:14] SHOULD BE 100001*Q[14]=1, CARRY=1, ALU15=1multiplyH:* Q=2; t_100001+100000,MULTIPLYt_(r1)+(r1);Q_t;* Q[14]_1t_rscr_rhigh1;call[mulCheck],t_t+(r1);* t_t+rscr,MULTIPLY==>ALU_1, CARRY_1skpif[R ODD], rscr2_rscr2;mulHerr1:error;* DIDN'T TAKE Q[14]=1 BRANCHt_t#(rhigh1);* 1000001+100000==> CARRY_1skpif[ALU=0];mulHerr2:error;* CARRY,,(1000001+100000)/2 SHOULD BE 100000t_(rhigh1)+1;* 1000001+100000 WOULD LEAVE ALU15=1t_t#(Q);skpif[ALU=0];mulHerr3:error;* ALU15,,Q[0:14] SHOULD BE 100001multiplyJ:* Q_r01=>Q[14]=0; CARRY=0,ALU15=0t_r01;Q_t;* Q[14]_0t_r0;rscr_t;call[mulCheck];* t_t+rscr,MULTIPLY==>ALU_0, CARRY_0skpif[R EVEN],rscr2_rscr2;mulJerr1:error;* TOOK Q[14]=1 BRANCHt_t;skpif[ALU=0];mulJerr2:error;* CARRY,,(0+0)/2 SHOULD BE ZEROt_(r01) RSH 1;t_t#(Q);skpif[ALU=0];mulJerr3:error;* ALU15,,Q[0:14] SHOULD BE (r01) RSH 1multiplyK:* Q_r10=>Q[14]=1; CARRY=0,ALU15=0t_r10;Q_t;* Q[14]_1t_r0;rscr_t;call[mulCheck];* t_t+rscr,MULTIPLY==>ALU_0, CARRY_0skpif[R ODD],rscr2_rscr2;mulKerr1:error;* DIDN'T TAKE Q[14]=1 BRANCHt_t;skpif[ALU=0];mulKerr2:error;* CARRY,,(0+0)/2 SHOULD BE ZERO bgp );NbAq+_+^ ]Kpq\+Y +XUW UpqT+! R"+ Ppq+O Ni+M, K+$J IspqH6+E +D} C@pqB+,? +$>J= ;pq:+! 8pq 6+54^+3 10+$/h .*pq,+*r)4 'pq&+$> #! pqH+& pq +R+\+$ pq+) pq p+ =]7kernel4.mcJuly 14, 1979 4:53 PM%22t_(r10) RSH 1;t_t#(Q);skpif[ALU=0];mulKerr3:error;* ALU15,,Q[0:14] SHOULD BE (r10) RSH 1mulDone: BRANCH[afterMul]; bgp );NbAq a_ ^pq]K+& Y X291kernel4.mcJuly 14, 1979 4:53 PM%23* September 11, 1977 2:46 PM%MULCHECKThis subroutine performs,t_t+(rscr),MULTIPLY;It sets rscr2=0 IF Q[14] branch DID NOT HAPPEN.It sets rscr2=1 IF Q[14] branch DID HAPPENT and rscr2 ARE CLOBBERED! IT ASSUMES r0=0, r1=1.%SUBROUTINE;mulCheck:t_t+(rscr),MULTIPLY, GLOBAL, AT[700];GOTO[.+1];rscr2_r0,AT[701];RETURN;rscr2_r1,AT[703];RETURN;TOP LEVEL;afterMul: bgp );N bAq a_ ]K\ Y/ XU* U1 T S_ R"pqP%O NiM,KJ Is Fpq E "s`kernel4.mcJuly 14, 1979 4:53 PM%24* September 14, 1977 12:03 PM%DIVIDE TESTH3 _ ALU[1:15],,Q[0] ==> H3_ 2*ALU,,Q[0]Q _ Q[1:15], CARRY ==> Q _ 2*Q,,CARRY%divideTest:*Q0=0, CARRY=0Q_r0;t_(r1)+(r1),DIVIDE;*t_1+1,DIVIDE==> CARRY_0,t_t#(4C);skpif[ALU=0];error;* 2*(1+1)=4, Q0=0t_Q;skpif[ALU=0];error;* CARRY WAS ZERO, Q SHOULD BE ZEROdivB:*Q0=0, CARRY=1Q_r0;t_rhigh1;t_t+(r1);* T = 100001t_t+(rhigh1),DIVIDE;* t_100001+100000,DIVIDE==>ALU=1, CARRY=1t_t#(2C);skpif[ALU=0];error;* 2*(1+1)=4, Q0=0t_(r1)#(Q);skpif[ALU=0];error;* 2*0,,CARRY SHOULD BE 1divC:*Q0=1, CARRY=0Q_rhigh1;t_(r1)+(r1),DIVIDE;* t_1+1,DIVIDE==>ALU=2, CARRY=0t_t#(5C);skpif[ALU=0];error;* 2*(2),,Q[0]=5t_(Q);skpif[ALU=0];error;* Q[1:15],,CARRY SHOULD BE ZEROdivD:*Q0=1, CARRY=1t_Q_rhigh1;* SET Q[0] TO ONEt_t+(r1);* T = 100001t_t+(rhigh1),DIVIDE;* t_100001+100000,DIVIDE==>ALU=1, CARRY=1t_t#(3C);skpif[ALU=0];error;* 2*(1),,Q[0]=3t_(r1)#(Q);skpif[ALU=0];error;* 2*0,,CARRY SHOULD BE 1divE:*Q_r01=>Q0=0, CARRY=1Q_r01;t_(rhigh1)+1;* T = 100001t_t+(rhigh1),DIVIDE;* t_100001+100000,DIVIDE==>ALU=1, CARRY=1t_t#(2C);skpif[ALU=0];error;* 2*(1),,Q[0]=2t_(r01) LSH 1;t_t+(r1);* ADD ONE FOR CARRYt_t#(Q);skpif[ALU=0]; bgp );N bAq a_ ]K)\( Z Yp q XU+ WU+TS_ R"+ONi M,+" Jpq Is+ H6FE+ D}+)C@B @+>J = ;+ 8pq 6+ 54^+3 1 0+.*, ++ )4pq '+ & +%|+ $>+)#!  +  + pq +\ + +) f+  + p 3  ;](kernel4.mcJuly 14, 1979 4:53 PM%25error;* 2*r01,,CARRY SHOULD BE ((r01)LSH 1)+1 bgp );NbAq+'P `:,*kernel4.mcJuly 14, 1979 4:53 PM%26* May 1, 1909 1:09 PM%CDIVIDE TESTH3 _ ALU[1:15],,Q[0] ==> H3_ 2*ALU,,Q[0]Q _ Q[1:15], CARRY ==> Q _ 2*Q,,CARRY' (COMPLEMENTED CARRY)%CdivideTest:*Q0=0, CARRY=0Q_r0;t_(r1)+(r1),CDIVIDE;*t_1+1,DIVIDE==> CARRY_0t_t#(4C);skpif[ALU=0];error;* 2*(1+1)=4, Q0=0t_(r1)#(Q);skpif[ALU=0];error;* CARRY' WAS 1, Q SHOULD BE 1CdivB:*Q0=0, CARRY=1Q_r0;t_rhigh1;t_t+(r1);* T = 100001t_t+(rhigh1),CDIVIDE;* t_100001+100000,DIVIDE==>ALU=1, CARRY=1t_t#(2C);skpif[ALU=0];error;* 2*(1+1)=4, Q0=0t_(Q);skpif[ALU=0];error;* 2*0,,CARRY' SHOULD BE 0CdivC:*Q0=1, CARRY=0Q_rhigh1;t_(r1)+(r1),CDIVIDE;* t_1+1,DIVIDE==>ALU=2, CARRY=0t_t#(5C);skpif[ALU=0];error;* 2*(1),,Q[0]=3t_(r1)#(Q);skpif[ALU=0];error;* Q[1:15],,CARRY' SHOULD BE 1CdivD:*Q0=1, CARRY=0T_Q_rhigh1;* SET Q[0] TO ONET_T+(R1);* T = 100001T_T+(rhigh1),CDIVIDE;* T_100001+100000,DIVIDE==>ALU=1, CARRY=1T_T#(3C);skpif[ALU=0];ERROR;* 2*(1),,Q[0]=3T_(Q);skpif[ALU=0];ERROR;* 2*0,,CARRY' SHOULD BE 0CdivE:*Q_R01=>Q0=0, CARRY=1Q_R01;T_(rhigh1)+1;* T = 100001T_T+(rhigh1),CDIVIDE;* T_100001+100000,CDIVIDE==>ALU=1, CARRY=1T_T#(2C);skpif[ALU=0];ERROR;* 2*(1),,Q[0]=2T_(R01) LSH 1;T_T#(Q);skpif[ALU=0];ERROR;* 2*R01,,CARRY' SHOULD BE (R01)LSH 1 bgp );N bAq a_ ]K)\> Z Yp q XU+ WU+TS_ R"+O Ni M,+ Jpq Is+ H6FE+ D}+)C@B @+>J= ;+ 8pq 6+ 54^+3 1 0+.* , ++ )4pq '+ & +%|+ $>+)#!  +  + pq +\ + +* f+   p  3+$ <0](kernel4.mcJuly 14, 1979 4:53 PM%27 bgp );N$ _ghkernel4.mcJuly 14, 1979 4:53 PM%28* September 9, 1977 5:09 PM%TEST 8 WAY SLOW B DISPATCHGo thru the loop 16 times to make sure that only the low 3 bits areor'd into next pc. keep counter in Q, loop control in CNT.%slowBr:cnt_17s;t_q_r0;rscr2_7C;* THIS WILL BE A 3 BIT MASKslowBrL:* TOP OF LOOPt_rm1;rscr_t;t_q;BDISPATCH_t;* DO DISPATCH W/ BITS IN T (=Q)branch[BDTbl];slowBRnoBr:* should have branched and didn'terror;bdConverge:t_(rscr2)AND(q);* MASK DISPATCH VALUEt_t#(rscr);branch[.+2,ALU=0];slowBRbadBr:error;* DIDN'T GO WHERE WE EXPECTEDt_(r1)+(q);* GET NEXT VALUE FOR DISPATCHloopChk[slowBrL,CNT#0&-1],q_t;afterBD:goto[afterKernel4];SET[BDTblLoc,5110];BDTbl:goto[bdConverge], rscr_r0, AT[BDTblLoc];goto[bdConverge], rscr_r1, AT[BDTblLoc,1];goto[bdConverge], rscr_2C, AT[BDTblLoc,2];goto[bdConverge], rscr_3C, AT[BDTblLoc,3];goto[bdConverge], rscr_4C, AT[BDTblLoc,4];goto[bdConverge], rscr_5C, AT[BDTblLoc,5];goto[bdConverge], rscr_6C, AT[BDTblLoc,6];goto[bdConverge], rscr_7C, AT[BDTblLoc,7];goto[bdConverge], rscr_10C, AT[BDTblLoc,10];* shouldn't be heregoto[bdConverge], rscr_11C, AT[BDTblLoc,11];* shouldn't be heregoto[bdConverge], rscr_12C, AT[BDTblLoc,12];* shouldn't be heregoto[bdConverge], rscr_13C, AT[BDTblLoc,13];* shouldn't be heregoto[bdConverge], rscr_14C, AT[BDTblLoc,14];* shouldn't be heregoto[bdConverge], rscr_15C, AT[BDTblLoc,15];* shouldn't be heregoto[bdConverge], rscr_16C, AT[BDTblLoc,16];* shouldn't be heregoto[bdConverge], rscr_17C, AT[BDTblLoc,17];* shouldn't be here bgp );N bAq a_]KC \: Z YpqXUWU+ S_pq+ R"PONi +M, Kp +q!J H6p qF+E D} C@p Bq+? +>J ;pq: 8 6pq5(4^*3 *1*0*/h*.**,*+,3*r,3)4,3',3&,3%|,3$>,3#,3 c6GGACHAGACHAGACHAF XN "')027^:>AEGLRORXZ`^cffkcnruw{}~pqpp O=H_y% p %+28;BGNSZ`bEflim6qv{emSubrsD.DIB.[.[, memSubrsD.cm.[@[ 7memsubrsChaos.press.[P[.,gmemSubrsChaos.mc.[z[@;memSubrsChaos.ER.Z ''[{[Q[A[/[![[ZZZZZZZZj/i^KernelDiagnostics.Pressmcdanielw22-Jun-81 8:29:40 PDT