instruction test 19 may 67 /test program 1 /clear locations 0000 through 7766, and read-in mode simulator readin 7766/ zro, dzm 0 idx zro isp tmp jmp zro /read-in mode simulator rim, rpb /this is location 7772 dio tmp spi i rpb tmp, 770010 /-7767 for memory killer jmp rim start zro 2 /part 2 /test hlt, jmp, szs readin 0/ 2 /program number stt, hlt /only test for hlt jmp 3000 /start of jump test hlt /if jmp fails ss, define ztest a szs i a szs a hlt terminate ztest 10 /test szs and szs i ztest 20 /with all switches off ztest 30 ztest 40 ztest 50 ztest 60 ztest 70 /all switches jmp stt 1 /resume jump test define ntest a szs a szs i a hlt terminate a, ntest 10 /test szs and szs i ntest 20 /with all switches on ntest 30 ntest 40 ntest 50 ntest 60 ntest 70 /all switches jmp a /iterate test 3000/ jmp 4777 /part of jump test hlt /if jmp fails 4777/ jmp 6000 /diddle program counter hlt /if jmp fails 6000/ jmp ss /leave jump test, test switches hlt /if jmp fails foo, start stt 3 /part 3 /test cla, cma, sma, spa, skp, skp i, and lat partly /test word should be 777777 readin 0/ 3 /program number stt, szs 10 /if on, hlt /halt after read-in skp i /test unconditional skip hlt /if fails skp /test no skip jmp a /ok hlt /failed a, lat /all ones to ac cla /test cla and sza jointly sza hlt /failed lat /all ones to ac cma /test cma sza hlt spa /test spa hlt sma i /test sma negation hlt cma /now 777777 sza i /test sza negation hlt spa i /test spa negation hlt sma /test sma true hlt /end of tests szs 20 /if switch on, reiterate jmp stt 2 /by returning jmp 7772 /otherwise, read in next tape start stt 4 /part 4 /test xor, sas, sad readin 0/ 4 /program number stt, szs 10 /if switch on, hlt /halt after read-in clc /ones to ac xor ons /check -0 xor -0 sza hlt /error xor zrs /0 xor 0 sza hlt /error xor ons /0 xor -0 cma /should be -0 sza hlt /error cma xor zrs /-0 xor 0 cma sza hlt /error /start of sad and sas tests sas zrs /ac is 0 hlt /error sza hlt /error, ac was changed sad ons /ac is 0 hlt sza /if ac was changed hlt /error cma /now ac is 777777 sas zrs skp i /ok, skip halt hlt /error cma sza hlt /error, ac was changed cma sad ons /should be same skp i /ok hlt /error cma sza hlt /error, ac was changed /end of tests szs 20 /if switch 2 on, jmp stt 2 /iterate jmp 7772 /read in next test program ons, 777777 zrs, 000000 start stt 5 /part 5 /test dip, dap, dac, lac readin 0/ 5 /program number stt, szs 10 /if sw 1 on, hlt /halt after read-in define junk dip rgs dap rgs sas rgs hlt dac tmp sas tmp hlt terminate /begin tests of dip, dap, and dac cla /first, test with zeroes junk /true blue cma /now test with all ones junk /into all 0s junk /all 1s into all 1s cma /all 0s junk /into all 1s /begin test of lac lac zrs /load from word of zeroes sza /if ac not 0, hlt /then error lac ons /load 1s into 0s sas ons hlt /error lac ons /1s into 1s sas ons hlt /error lac zrs /0s into 1s sza hlt /error /end of tests, part 5 szs 20 /if sw 2 up, jmp stt 2 /iterate jmp 7772 /read in next test zrs, 000000 ons, 777777 rgs, 0 tmp, 0 start stt 6 /part 6 /test dzm, idx readin 0/ 6 /program number stt, szs 10 /if sw 1 up, hlt /halt after read-in /begin test of dzm clc /word of 1s dac tmp dzm tmp /zero test word of 1s lac tmp sza hlt /error dzm tmp /zero test word of 0s lac tmp sza hlt /error /begin test of idx clc /-0 dac tmp idx tmp /should now be 1 spa hlt /big error sza i hlt /error cma dac tmp /now should be -1 idx tmp sza hlt /error /now some lengthy hack define ptest a lac tb1 a dac tmp idx tmp spa hlt terminate define ntest a lac tb2 a dac tmp idx tmp sma hlt terminate /begin idx test of special bits ptest 0 ptest 1 ptest 2 ptest 3 ptest 4 ptest 5 ptest 6 ptest 7 ptest 10 ptest 11 ptest 12 ptest 13 ptest 14 ptest 15 ptest 16 ntest 0 ntest 1 ntest 2 /end of tests szs 20 /if sw2 up jmp stt 2 /iterate jmp 7772 /read in next test program /random storage and constants tmp, 0 tb1, 377776 377775 377773 377767 377757 377737 377677 377577 377377 376777 375777 373777 367777 357777 337777 tb2, 677777 577777 377777 foo, start stt 7 /part 7 /test isp readin 0/ 7 /program number stt, szs 10 /if sw1 up, hlt /halt after read-in lac tn1 /377777 dac ct1 dac t1 lac tn2 /777776 dac ct2 dac t2 /start of isp test define idsas a,b idx a sas b hlt terminate lp, isp t2 /777776 to 0 hlt /error idsas ct2,t2 /check result against idx sad tn1 /leave loop when ct2 is 377777 jmp lst /through this exit isp t1 /should never be positive skp i hlt /error idsas ct1,t1 jmp lp lst, isp t1 /t1 should be 777776 before this hlt /error sza hlt /error isp t2 /377777 to 400000 skp i hlt /error idsas ct2,t2 /end of isp test szs 20 /if sw2 up, jmp stt 2 jmp 7772 /read in next test ct1, 0 ct2, 0 t1, 0 t2, 0 tn1, 377777 /test number 1 tn2, 777776 /test number 2 foo, start stt 10 /part 10 readin /test and, ior 0/ 10 /program number stt, szs 10 /if sw1 up, hlt /halt after read-in /begin tests of and and ior define amac a,b,c lac a and b c hlt terminate amac t2,t2,sas t2 /1s and 1s amac t1,t2,sza /0s and 1s amac t1,t1,sza /0s and 0s amac t2,t1,sza /1s and 0s define imac a,b,c lac a ior b c hlt terminate imac t1,t1,sza /0s or 0s imac t1,t2,sas t2 /0s or 1s imac t2,t2,sas t2 /1s or 1s imac t2,t1,sas t2 /1s or 0s /end of tests for part 10 szs 20 /if sw2 up, jmp stt 2 jmp 7772 t1, 000000 t2, 777777 foo, start stt 11 /part 11 /test lio, dio, spi readin 0/ 11 /program number stt, szs 10 /if sw1 up hlt /halt after read-in /begin tests define loop lio t1 dio t2 sas t2 hlt spa jmp b terminate dzm t1 cla /initialize a, loop /test until t1 is 400000 spi /test spi instruction hlt /error idx t1 jmp a b, spi i /io now negative hlt /error idx t1 loop /test until t1 is 0 /end of tests for part 11 szs 20 /iterate if sw2 up jmp stt 2 jmp 7772 /get next program /random t1, 0 t2, 0 foo, start stt 12 /part 12 /test add, szo, sub readin 0/ 12 /program number stt, szs 10 /if up hlt /halt after read-in /begin test of szo szo /turn off overflow flip-flop szo i /check that szo i doesnt skip szo /should skip hlt /error szo i /should not skip skp i hlt /error /start of add test cla add zro /test add of 0s sza hlt /error add pmx /377777 sas pmx hlt add zro sas pmx hlt /error cla add nmx /400000 sas nmx hlt /error add zro sas nmx hlt /error szo /should be no overflow hlt /error add pmx /-nmx sza hlt /error lac zoz /252525 add zoz /set overflow, check carry sas ozo /525252 hlt /error szo i /overflow should be on hlt /error lac ab /125252 add ab /check carry for even ac bits sas ac /252524 hlt /error lac ons add zro sza /-0 should clear hlt /error szo hlt /error cma add ad /000001 sas ad hlt /error szo /should be off hlt /error lac ozo /525252 add ons /-0 sas ozo hlt /error lac zoz /252525 add ons sas zoz hlt /error szo /still should be off hlt /error /end of add test cla /initialize dac tmp /for sub test cma /begin test of sub lp, sub mon /-1 dac qem idx tmp sas qem hlt /error sas zro /loop for 777777 times jmp lp /end of sub test szs 20 /if up, jmp stt 2 jmp 7772 /read in next test ons, 777777 zro, 000000 pmx, 377777 nmx, 400000 zoz, 252525 ozo, 525252 ab, 125252 ac, 252524 ad, 000001 mon, 777776 tmp, 000000 qem, 000000 start stt 13 /part 13 /test law, cli readin 0/ 13 /program number stt, szs 10 /if sw1 up hlt /halt after read-in /begin test of law clc /all ones to ac law 0 sza hlt /error law 7777 sas ck hlt /error law i 0 /test law with complement cma sza hlt /error law i 7777 sas dk hlt /error /start cli test clc dac tmp lio tmp /load io with all ones cli /check cli with all 1s dio tmp lac tmp sza hlt /error cli /check cli with all 0s dio tmp lac tmp sza hlt /error /end of tests szs 20 jmp stt 2 jmp 7772 tmp, 0 ck, 7777 dk, 770000 start stt 14 /part 14 /test clf, stf, szf readin 0/ 14 /program number stt, szs 10 /if sw1 up, hlt /halt after read-in /begin tests clf 7 /clear all flags szf 7 hlt /error lac e /initialize all instructions dap a 1 /for flag 1 lac f dap a 2 dap c 1 dap c 2 lac cde /set up count loop dac abc /for stf test xa, law a 1 /set up time delay a, jmp cnt 1 stf 1 /start test with flag 1 szf i 1 hlt /error idx a 1 /next flag idx a 2 isp abc jmp xa law b /introduce another time delay jmp cnt 1 b, clf 7 /clear all flags szf 7 hlt /error law b 5 /another time delay jmp cnt 1 stf 7 /set all flags szf i 7 hlt /error /clf tests lac cde /set up loop for 6 flags dac abc xc, law c 1 /time delay c, jmp cnt 1 clf 1 /start test with flag 1 szf 1 hlt /error idx c 1 /next flag idx c 2 isp abc jmp xc /end of tests for part 14 szs 20 /if up jmp stt 2 /program iterates jmp 7766 /clear memory for next test /random junk cnt, 000000 /routine to introduce time delay dap cnt 6 lac mxx dac cnt isp cnt jmp cnt 4 jmp . e, 11 f, 1 mxx, 700000 abc, 0 cde, 777771 /memory killer routine 7765/ 770013 zro, dzm 0 idx zro isp 7765 jmp zro foo, start stt 15 /part 15 /test jsp, jda, cal readin 0/ 15 /program number stt, szs 10 /if sw1 up hlt /halt after read-in szo /clear overflow szo i jmp tt1 /first jsp test /beginning of tests 16/ tt1, lac num /initialize ac to 777757 jp1, jsp ck1 /go to first jsp test 32/ tt4, lac num 3 /000040 dac ck4 /jda address szo /clear overflow szo i lac num 4 /771737 jd1, jda ck4 /first jda test /following is for cal test 100/ 0 /stores ac after cal and msk dac tmp law ca1 1 sas tmp /see if pc was properly saved hlt /cal error lac 100 /check to see if ac saved sas ons hlt /error /end of part 15 szs 20 jmp stt 2 jmp 7772 /read in next test /test numbers, constants, and temporary storage ons, 777777 ofl, 400000 tmp, 0 msk, 007777 num, 777757 776020 771677 000040 771737 006040 006000 771777 /now a few macros define jpmac m,n ck'm, and msk dac tmp law jp'm 1 sas tmp hlt jmp tt'n terminate define jdmac m,n,p,q ck'm, 0 and msk dac tmp law jd'n 1 sas tmp hlt lac ck'm sas num p hlt jmp tt'q terminate 737/ jdmac 4,1,4,5 757/ jpmac 1,2 1000/ jdmac 6,3,7,7 1100/ jpmac 3,4 1731/ tt5, lac tt5 /turn on the add tt5 /overflow flip-flop lac num 4 /771737 dac ck5 /address of 2nd jda lac num 5 /006040 jd2, jda ck5 /second jda test 1755/ tt2, lac num 1 /776020 jp2, jsp ck2 3000/ tt7, clc /word of ones ca1, cal /test of cal 5772/ tt6, szo /clears overflow szo i lac num 6 /006000 dac ck6 /address of third jda lac num 7 /771777 jd3, jda ck6 /third jda test 6020/ jpmac 2,3 6040/ jdmac 5,2,5,6 6076/ tt3, lac num 2 /771677 jp3, jsp ck3 /third jsp test /end of program for part 15 foo, start stt 16 /part 16 /test nop, xct, and deferred addressing readin 0/ 16 /program number stt, szs 10 /if sw1 up, hlt /halt after read-in /begin tests nop /if computer halts, nop failed xct ins /if this fails, hlt /computer halts t1, dzm i t2 /beginning of indirect address chain t2, dzm i t3 t3, dzm i t4 t4, dzm i t5 t5, dzm t6 t6, 777777 ins, jmp nxt /executed by xct nxt, cla /clear ac and check indirect addressing lac i t1 sas t6 hlt /error /end of part 16 szs 20 /if up jmp stt 2 /program iterates jmp 7772 /next test foo, start stt 17 /part 17 /test ral, ril, rar, rir, rcl, rcr readin 0/ 17 /program number stt, szs 10 /if up hlt /halt after read-in /start of ral 1s and ril 1s tests. lac al1 /set up dac lsh lac il1 dac lsh 1 law tst 1 dap lsh 2 lio tst lpl, dio tmp /set ac equal to io lac tmp lsh, ral . /rotate one. different bit each time ril . /different bit each time sas . /test ac rotation hlt /error dio tmp /test io rotation sas tmp hlt /ril error lac lsh and msk /change the address in ral instruction add lsh sad lsl jmp spr /jmp out of loop dac lsh /otherwise, set up next ral lac lsh 1 and msk /set up next ril also add lsh 1 dac lsh 1 idx lsh 2 /set sas instruction jmp lpl /return to loop /start of rar and rir tests spr, lac ar1 /set up loop for right rotation dac rsh lac ir1 dac rsh 1 law tst 10 dap rsh 2 lio tst 11 lpr, dio tmp /set ac equal to io lac tmp rsh, rar . /one right, different bit each time rir . /different bit each time sas . /check ac rotation hlt /rar error dio tmp /check io rotation sas tmp hlt /rir error lac rsh /move the addresses of rar and rir and msk add rsh sad lsr jmp nxt /done with loop dac rsh /not done, set up next rar lac rsh 1 and msk /set up next rir add rsh 1 dac rsh 1 lac rsh 2 sub one /update sas instruction dac rsh 2 jmp lpr /return to loop /start of 9-bit rotation test nxt, lac tst /load ac and io lio tst /with test number ral 9s ril 9s sas tst 11 /check correct ac rotation hlt /error dio tmp /check correct io rotation sas tmp hlt /error rar 9s rir 9s sas tst /check correct ac rotation right hlt /error dio tmp /test io rotation sas tmp hlt /error lac tst 11 rcl 9s /9-bit combined rotation sas ttc /check correct ac contents hlt /error lac ttc 1 dio tmp /check correct io contents sas tmp hlt /error lac ttc /set up combined right 9s rcr 9s sas tst 11 /check correct ac contents hlt lac tst dio tmp sas tmp /check correct io contents hlt /start of 0 bit rotation tests ral ril sas tst /check no rotation hlt /error dio tmp sas tmp /check no rotation of io hlt rar rir sas tst /check no ac rotation hlt dio tmp sas tmp /check no io rotation hlt rcl sas tst /check for correct ac hlt dio tmp sas tmp /check correct io contents hlt rcr sas tst /check correct ac hlt dio tmp sas tmp /check correct io hlt /start of rcl 9s high speed test law flp /set up loop dap fls /for fast rotation lac num /set up count dac cnt /of loops fls, lio . /load with test number fsl, dio tmp /set ac to io lac tmp repeat 4, rcl 9s sas i fls hlt /error, ac changed dio tmp sas tmp hlt /error, io changed isp cnt /leave loop after executing jmp fsl /777 times lac num /set up count dac cnt /for high-speed rcr 9s test fsr, dio tmp /set ac to io lac tmp repeat 4, rcr 9s sas i fls hlt /error, ac changed dio tmp sas tmp hlt /error, io changed isp cnt /leave loop after executing jmp fsr /777 times lac num /start of rcl 9s-rcr 9s high speed test dac cnt /set up loop count rvs, dio tmp /set ac to io lac tmp repeat 4, rcr 9s rcl 9s sas i fls /check for correct ac hlt /error dio tmp /check correct io sas tmp hlt /error isp cnt /leave loop after execution jmp rvs /777 times idx fls /set up next test number sas fin /if not finished jmp fls /return for another fast loop /end of part 17 szs 20 /if sw2 up jmp stt 2 /program iterates jmp 7772 /read in next test /constants, test numbers, and temporary storage al1, 661001 il1, 662001 ar1, 671001 ir1, 672001 tmp, 0 flp, 000000 777777 one, 000001 777776 525252 525254 num, 777000 cnt, 0 msk, 000777 lsl, 662000 lsr, 672000 fin, lio flp 6 tst, 777070 776161 774343 770707 761617 743437 707077 616177 434377 070777 777777 ttc, 777777 070070 foo, start stt 20 /part 20 /test sal, sil, sar, sir, scl, scr readin 0/ 20 /program number stt, szs 10 /if sw1 up, hlt /halt after read-in /begin tests lac tst /load ac and io lio tst /with 377777 sal 9s /move ac left sal 8s /17 bits sil 9s /same with io sil 8s sza /ac should now be 0 hlt /error dio tmp /same with io sas tmp hlt /error /tests of sar and sir lac tst /377777 lio tst sar 9s sar 8s sir 9s sir 8s sza /ac and io should both be 0 hlt /error dio tmp sas tmp hlt /error lac tst 5 /400000 lio tst 5 sar 9s sar 8s sir 9s sir 8s cma /ac should be all 1s sza hlt /error cma dio tmp sas tmp /same with io hlt /error /begin tests of scl and scr lac tst /377777 lio tst scl 1s /combined shift sas tst 1 hlt /error dio tmp /io should be 777776 lac tst 2 sas tmp hlt /error lac tst /scr test now lio tst scr 1s sas tst 3 /177777 hlt /error dio tmp lac tst 4 sas tmp hlt /error /end of part 20 szs 20 /if up jmp stt 2 /iterate jmp 7772 /read in next test /random junk tst, 377777 377776 777776 177777 577777 400000 tmp, 0 foo, start stt 21 /part 21 /test adm readin 0/ 21 /program number stt, szs 10 /if sw1 up hlt /halt after read-in /begin test of adm /similar to test of add clo /clear overflow flip-flop skp i /clo should never skip hlt /big error cla /check add of 0s to 0s dac tmp adm tmp sas tmp /ac should be same as storage hlt sza hlt /error lac pmx /check add of 377777 to 000000 adm tmp sas tmp hlt /error sas pmx hlt /error cla /check add of 000000 to 377777 adm tmp sas tmp hlt /error sas pmx hlt /error dzm tmp /check add of 400000 to 000000 lac nmx adm tmp sas tmp hlt /error sas nmx hlt /error cla /check add of 000000 to 400000 adm tmp sas tmp hlt /error sas nmx hlt /error szo /overflow should be 0 up to now hlt /overflow error lac pmx /add 377777 to 400000 adm tmp sas tmp hlt /error sza /result should be plus 0 hlt /error lac zoz /252525 dac tmp adm tmp sas tmp hlt /error sas ozo /525252 hlt /error szo i /overflow should be on now hlt /overflow error lac ab /125252 dac tmp adm tmp sas tmp hlt /error sas ac /252524 hlt /error lac ons /777777 dac tmp cla adm tmp /check clear of -0 sas tmp hlt /error sza hlt /error szo /overflow should be off hlt /error cma /-0 dac tmp lac ad /1 adm tmp sas tmp hlt /error sas ad hlt /error szo /overflow should be off hlt /error lac ozo /525252 dac tmp lac ons /-0 adm tmp sas tmp hlt /error sas ozo hlt /error lac zoz /252525 dac tmp lac ons /-0 adm tmp sas tmp hlt /error sas zoz hlt /error szo /overflow should be off hlt /error /end of adm test szs 20 /if sense switch 2 up, jmp stt 2 /iterate program jmp 7772 /read in next test program /storage and constants ons, 777777 zro, 000000 pmx, 377777 nmx, 400000 zoz, 252525 ozo, 525252 ab, 125252 ac, 252524 ad, 000001 tmp, 0 /end of program foo, start stt 22 /part 22 /test lia, lai, swp, and sni /also zero memory for jdp test of part 23 readin 0/ 22 /program number stt, szs 10 /if up, hlt /halt after read-in /start of tests /test lia and lai cla>>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<>05<