/DM8E40.PA 15-MAR-80 /TEST PROGRAM FOR DM8E40 MEMORY MANAGEMENT BOARD / E. LOPES CARDOZO / WESTVRIES COMPUTER CONSULTING BV / RIJKSSTRAATWEG 19A / 1969 LB HEEMSKERK / 02510 - 43244 /SYMBOL DEFINITIONS: SINT=6254 SUF=6274 CINT=6204 CUF=6264 RTM=6205 LTM=6235 LRM=6245 SMME=6265 CMME=6275 SKME=6215 SKMM=6225 /FOR PRODUCTION TEST DEFINE PRODUCTION: PRODUCTION=1 /INTERRUPT SERVICE ROUTINE: *0 0 JMP SERV *20 SERV, DCA AC /SAVE AC SINT /TRAP ? JMP INTERR /NO, ILLEGAL INTERRUPT CINT /CLEAR TRAP FLAG RTM /READ TRAP REGISTER DCA TRAPD /THAT IS THE INSTR. THE HARDWARE SAW CLA CMA TAD 0 DCA 0 /BACKUP PC TAD I 0 /GET TRAPPED INSTRUCTION FROM MEMORY CIA /AND COMPARE TO TAD TRAPD /TRAP REGISTER CONTENTS SZA CLA /SHOULD BE EQUAL JMS TRPERR /ERROR IN TRAP REGISTER TAD 0 /DID WE TRAP THE SAFETY HLT ? TAD (-HALT / SZA CLA /? CMA /NO, SET AC=-1 JMP I ENDTRP /BACK TO MAIN LOOP ENDTRP, .-1 /CONTINUATION ADDRESS /VIRTUAL CODE SEQUENCES: RELTST, TAD I (7000 /RELOCATION TEST; GET DATAFIELD JMP HALT /EXIT FROM USER MODE TRPTST, JMP . /GETS IOT TO BE TESTED JMP .+2 /FOR CIF: ENABLE INTERRUPTS ION /FOR SKON: REENABLE INTERRUPTS HALT, HLT /EXIT FROM USER MODE JMP . /*** IF HERE, HLT DID NOT TRAP *** TTYTST, TAD BELL /TEST TTY IN UNTRAPED MODE TLS /SEND A BELL TO THE CONSOLE TSF /WAIT TILL READY JMP .-1 / IFNDEF PRODUCTION < CLA / > IFDEF PRODUCTION < KCC /USED TO CLEAR THE AC SZA /DIDITDO ? JMP . /NO !!! *** UNTRAPPED KCC DID NOT CLA *** TCF /EXIT WITH TTY FLAG CLEAR TSF /DID THAT WORK ? SKP /YES JMP . /***TCF DID NOT CLEAR FLAG *** > JMP HALT /NOW EXIT FROM USER MODE /MD-LINE TEST: MDTST, DCA I (Q TAD I (Q IAC SZA /TEST ALL 4096 VALUES JMP MDTST JMP HALT Q, 0 /CDTOIF TEST ROUTINE CDTF, 0 6200 /CDTOIF CIF 0 JMP I CDTF /RDF TEST ROUTINE: TSTRDF, RDF KK, TAD K0 /GET ACTUAL FIELD NUMBER JMP HALT /GOT THROUGH K0, 0 K1, 1 K2, 2 K3, 3 K4, 4 K5, 5 K6, 6 K7, 7 /VARIABLES, COUNTERS AND POINTERS: COUNT, 0 COUNT1, 0 COUNT2, 0 COUNT3, 0 PTR, 0 FIELDS, 0 /NUMBER OF FIELDS AVAILABLE AC, 0 TRAPD, 0 BELL, 207 PAGE JMS INIT /SETUP FIELDS START, CAF KIE /DISABLE KEYBOARD INTERRUPTS LOOP0, JMS COPY /MOVE PAGE 0 TO ALL FIELDS JMS IOTTST /STATIC TEST OF DM8E40 IOTS TAD FIELDS CIA DCA COUNT /FOR ALL FIELDS TAD (CDF DCA FCDF /SET A CDF TO EACH FIELD LOOP1, TAD COUNT / TAD FIELDS FCDF, CDF 0 //CDF0, CDF10, CDF 20, ... DCA I (7000 //PUT THE FIELD NUMBER AT 7000 CDF 0 //RESTORE THE DATAFIELD TAD FCDF /MAKE A NEW CDF TAD (10 DCA FCDF / ISZ COUNT /ALL FIELDS DONE JMP LOOP1 / /NOW A SIMPLE RELOCATION TEST. WE SET UP A SEQUENCE OF /RELOCATION AND THAN GO VIRTUAL, PICK UP THE FIELD /CONSTANT FROM 7000 AND HLT, TO GET OUT OF USER MODE /WE TRY TO TEST IF ALL WORDS OF THE RELOCATION RAM /CAN TAKE ALL VALUES, AT LEAST ALL VALUES FOR WHICH /THERE ARE FIELDS IN THE SYSTEM. TAD (RET1 /SETUP TRAP RETURN ADDRESS DCA ENDTRP / TAD FIELDS /SET UP COUNTER FOR FIELDS CIA DCA COUNT / LOOP2, TAD (-10 /TEST ALL 8 WORDS OF THE RELOCATION RAM DCA COUNT1 / LOOP3, TAD (-10 /LOAD ALL WORDS OF THE RAM DCA COUNT2 / LOOP4, TAD COUNT2 / TAD (10 /MAKE 0, 1, 2, ... LRM /SET ALL WORDS TO 0 ISZ COUNT2 / JMP LOOP4 / TAD COUNT / TAD FIELDS /POSITIVE REAL FIELD # CLL RTL / RAL /SHIFT TO BITS 6-8 TAD COUNT1 /ADD VIRTUAL FIELD # TAD (10 /(POSITIVE) LRM /THIS SETS ONE WORD TAD COUNT1 / TAD (10 / TAD (100 /USER MODE+VIRTUAL DATA FIELD RTF /RESTORE FLAGS CLA /?! JMP RELTST /JMP TO RELOCATION TEST /RELTST MUST BE AVAILABLE IN EACH FIELD RET1, CLA TAD AC /GET AC FROM TRAP CIA /AND COMPARE TO INTENDED FIELD # TAD COUNT / TAD FIELDS / SZA CLA / JMS RELERR /RELOCATION ERROR ISZ COUNT1 / JMP LOOP3 / ISZ COUNT / JMP LOOP2 / /END OF RELOCATION TEST. NOW COMES THE TRAP/UNTRAP TEST /IN EACH AVAILABLE FIELD WE TEST EACH IOT FROM THE TABLE TAD FIELDS / CIA DCA COUNT / LOOP5, TAD (-10 DCA COUNT1 /ZERO THE RELOCATION RAM LOOP6, TAD COUNT / TAD FIELDS / CLL RTL RAL / TAD COUNT1 / TAD (10 /MAKE ONE-TO-ONE MAPPING LRM /LOAD RELOCATION MEMORY ISZ COUNT1 / JMP LOOP6 / TAD COUNT / TAD FIELDS / CLL RTL RAL / TAD (CDF /MAKE CDF DCA XCDF /CDF TO TARGET FIELD TAD (TABLE /SETP POINTER FOR IOT TABLE DCA PTR / LOOP7, TAD I PTR / DCA TRPTST /DROP IT IN THE TRAPTEST TAD (RET2 DCA ENDTRP TAD TRPTST / XCDF, CDF /CDF TARGET FIELD DCA I (TRPTST /IN THE TARGET FIELD TOO CDF 0 / JMS UTRALL /UNTRAP ALL DEVICE CODES TAD TRPTST /GET TEST IOT AGAIN AND (7776 /CLEAR UNTRAP BIT LTM /AND SET DM8E40 TO TRAP FOR THIS IOT SUF /ENTER USER MODE ION /WITH INTERRUPT ON JMP TRPTST /THIS BRINGS US INTHE TARGET FIELD ! /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RET2, ISZ PTR /RETURN FROM TRAP HANDLER TAD I PTR /GET TRAP/UNTRAP INDICATOR RAR /BIT 11 IS XOR! SZL CLA /OK ? JMS TERROR /TRAP ERROR TAD (RET3 DCA ENDTRP /SET NEW RETURN POINT JMS TRPALL /TRAP ALL DEVICE CODES TAD TRPTST AND (7776 IAC /SET UNTRBP BIT LTM / SUF ION JMP TRPTST /GO ! PAGE /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RET3, ISZ PTR TAD I PTR RAR /BIT 11 DOES XOR SZL CLA /OK ? JMS UERROR /NO, UNTRAP ERROR ISZ PTR /SELECT NEXT IOT TAD I PTR /AND FETCH IT SZA CLA /END OF LIST ? JMP LOOP7 /NO, TEST NEXT IOT IFNDEF FYSIOL < /FINALY, WE TEST THE CONSOLE TERMINAL WITH IT'S IOTS UNTRAPPED: TAD (RET4 DCA ENDTRP JMS TRPALL /TRAP ALL DEVICE CODES, TAD (6031 /EXCEPT FOR THE TERMINAL LTM TAD (6041 / LTM / SUF ION JMP TTYTST / /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - RET4, CLA CLL / > TAD (RET5 DCA ENDTRP SUF ION JMP MDTST /TEST ALL VALUES FOR MD DATA /- - - - - - - - - - - - - - - - - - - - - - - - - - RET5, SZA CLA /SHOULD NOT TRAP JMS MDERR JMS RDFTST /NOW EXERCIZE RDF IN USER MODE ISZ COUNT /SELECT NEXT TARGET FIELD JMP LOOP5 /NOT DONE YET JMP LOOP0 /START OVER AGAIN COPY, 0 TAD FIELDS CIA IAC SNA JMP I COPY /ONLY 4K DCA COUNT COPY1, CMA DCA 10 CMA DCA 11 TAD COUNT TAD FIELDS CLL RAL RTL TAD (CDF DCA YCDF TAD (-200 DCA COUNT1 COPY2, CDF 0 TAD I 10 YCDF, HLT DCA I 11 ISZ COUNT1 JMP COPY2 TAD YCDF AND (70 CLL RTR RAR TAD I (KK DCA I (KK CDF 0 ISZ COUNT JMP COPY1 JMP I COPY /STATIC IOT TST FOR DM8E40 INSTRUCTIONS: IOTTST, 0 TAD (IOTLST-1 /SETUP LIST POINTER DCA 10 TAD I 10 /FETCH FIRST IOT IOT1, DCA IOTX / TAD (5252 /GET A TEST PATERN IN THE AC IOTX, HLT /REPLACED BY THE IOT UNDER TEST JMP IOT2 /IOT DID NOT SKIP DCA AC /REMEBER AC AFTER IOT TAD I 10 /GET SKIP FLAG SNA CLA /SHOULD HE HAVE SKIPPED ? JMS ERR1 /NO, BUT HE DID ! JMP IOT3 /GO CHECK AC EFFECTS IOT2, DCA AC /REMEMBER AC TAD I 10 /GET SKIP FLAG SZA CLA /SHOULD HE HAVE SKIPPED ? JMS ERR2 /YES, BUT HE DIDN'T ! IOT3, TAD I 10 /GET AC-CHANGED FLAG SNA CLA /SHOULD AC HAVE CHANGED ? JMP IOT4 /NO, GO CHECK THAT TAD I 10 /YES, MUST AC BE CLEAR NOW ? SNA CLA / JMP IOT5 /NO, UNDEFINED AC NOW TAD AC /YES, TEST AC SZA CLA /ZERO ? JMS ERR3 /NO, IOT DID NOT CLA ! JMP IOT5 /DONE ALL TESTS IOT4, TAD AC /IF HERE AC SHOULD NOT HAVE CHANGED TAD (-5252 /TEST IF STILL OK SZA CLA / JMS ERR4 /IOT SPOILED AC IOT5, TAD I 10 /GET NEXT IOT SZA /END OF LIST ? JMP IOT1 /NO, TEST NEXT IOT JMS I [CDTOIF /TEST 6200 JMP I IOTTST PAGE RDFTST, 0 /TEST RDF IN USER MODE JMS TRPALL TAD (RET6 DCA ENDTRP TAD I (XCDF /SET DATAFIELD TO CMA /COMPLEMENT OF AND (70 /REAL FIELD TAD (CDF DCA KCDF TAD (-7 DCA COUNT1 /CHANGE MAPPING LOOP8, TAD KCDF / AND (70 / TAD COUNT1 / TAD (10 / LRM / ISZ COUNT1 / JMP LOOP8 / KCDF, CDF 70 SUF ION JMP TSTRDF /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - RET6, SZA CLA /DID RDF TRAP ? JMS RDFER1 /YES, ERROR TAD KCDF /COMPUTE CORRECT AC AND (70 MQL MQA CMA AND (70 CLL RTR RAR MQA CIA TAD AC /GET VIRTUAL AC SZA CLA / ? JMS RDFER2 /NO, AC WAS SPOILED ! JMP I RDFTST /RETURN PAGE /ERROR MESSAGE PROCESSORS: INTERR, CAF KIE JMS I [STRING TEXT /UNEXPECTED INTERRUPT/ JMS I [CRLF TAD AC RMF ION JMP I 0 TRPERR, 0 JMS I [STRING TEXT /TRAP REGISTER WRONG: (PC-1)=/ TAD I 0 JMS OCTOUT JMS I [STRING TEXT /, RTM=/ TAD TRAPD JMS OCTOUT JMS I [CRLF JMP I TRPERR RELERR, 0 JMS I [STRING TEXT /RELOCATION ERROR, GOOD FIELD=/ TAD COUNT TAD FIELDS JMS OCTOUT JMS I [STRING TEXT /, ACTUAL FIELD=/ TAD AC JMS OCTOUT JMS I [CRLF JMP I RELERR TERROR, 0 TAD TRPTST JMS OCTOUT TAD I PTR SNA CLA JMP TER1 JMS I [STRING TEXT / FAILED TO TRAP/ JMP TER2 TER1, JMS I [STRING TEXT / DID TRAP / TER2, JMS I [STRING TEXT / IN FIELD / TAD COUNT TAD FIELDS AND (7 TAD ("0 JMS TYPE JMS I [CRLF JMP I TERROR PAGE UERROR, 0 TAD TRPTST JMS OCTOUT TAD I PTR SZA CLA JMP UER1 JMS I [STRING TEXT / DID NOT UNTRAP/ JMP UER2 UER1, JMS I [STRING TEXT / DID UNTRAP/ UER2, JMS I [STRING TEXT / IN FIELD / TAD COUNT TAD FIELDS AND (7 TAD ("0 JMS TYPE JMS I [CRLF JMP I UERROR MDERR, 0 JMS I [STRING TEXT /TRAPPED ON MEMORY DATA / TAD Q JMS OCTOUT JMS I [CRLF JMP I MDERR ERR1, 0 TAD I (IOTX JMS I [OCTOUT JMS I [STRING TEXT / WRONGLY SKIPPED/ JMS I [CRLF JMP I ERR1 ERR2, 0 TAD I [IOTX JMS I [OCTOUT JMS I [STRING TEXT / FAILED TO SKIP/ JMS I [CRLF JMP I ERR2 ERR3, 0 TAD I [IOTX JMS I [OCTOUT JMS I [STRING TEXT / FAILED TO CLEAR AC/ JMS I [CRLF JMP I ERR3 ERR4, 0 TAD I [IOTX JMS I [OCTOUT JMS I [STRING TEXT / SPOILED THE AC/ JMS I [CRLF JMP I ERR4 PAGE RDFER1, 0 JMS I [STRING TEXT /RDF DID TRAP !/ JMS I [CRLF JMP I RDFER1 RDFER2, 0 JMS I [STRING TEXT /RDF RETURNED WRONG ANSWER: / TAD AC JMS I [OCTOUT JMS I [CRLF JMP I RDFER2 PAGE TRPALL, 0 /SUBROUTINE TO SET ALL BITS TAD (-100 /IN THE TRAP MEMORY (EXCEPT 600X) DCA TRPCNT TRP1, TAD TRPCNT TAD (100 /MAKE IT POSITIVE CLL RAL RTL LTM /SET TO TRAP ISZ TRPCNT /DONE ? JMP TRP1 /NO TAD (6001 /UNTRAP ION FOR 6215, 6225 LTM / JMP I TRPALL /YES, RETURN UTRALL, 0 /SUBROUTINE TO UNTRAP ALL DEVICE CODES TAD (-100 DCA TRPCNT / UTR1, TAD TRPCNT TAD (100 /MAKE IT POTIVE CLL RAL RTL IAC /SET UNTRAP BIT LTM ISZ TRPCNT /DONE ? JMP UTR1 /NO JMP I UTRALL /YES, RETURN TRPCNT, 0 CDTOIF, 0 /TEST CDTOIF INSTRUCTION TAD FIELDS /FOR ALL AVAILABLE FIELDS CIA DCA COUNT1 / CDT1, TAD COUNT1 TAD FIELDS /MAKE POSITIVE FIELD NUMBER CLL RAL RTL TAD [CIF DCA CDT3 / TAD CDT3 CMA /MAKE COMPLEMENTARY CDF AND [70 TAD [CDF DCA CDT2 CDT2, HLT /CDF CDT3, HLT /CIF JMS CDTF /DO CDTOIF IN SOME FIELD RDF /READ DATA FIELD CDF 0 /RESET DF CIA TAD CDT3 /AND COMPARE WITH PREVIOUS AND [70 /INSTRUCTION FIELD SZA CLA /OK ? JMS CDTERR /NO, CDTOIF DID NOT WORK ISZ COUNT1 /TRY NEXT FIELD JMP CDT1 JMP I CDTOIF /END OF TEST CRLF, 0 TAD (215 JMS TYPE TAD (212 JMS TYPE JMP I CRLF STRING, 0 TAD I STRING BSW JMS BYTE TAD I STRING ISZ STRING JMS BYTE JMP STRING+1 BYTE, 0 AND (77 SNA JMP I STRING TAD (240 AND (77 TAD (240 JMS TYPE JMP I BYTE OCTOUT, 0 RAL JMS DIGIT JMS DIGIT JMS DIGIT JMS DIGIT CLA JMP I OCTOUT DIGIT, 0 RAL RTL DCA OCTEMP TAD OCTEMP AND (7 TAD ("0 JMS TYPE TAD OCTEMP JMP I DIGIT OCTEMP, 0 PAGE INIT, 0 JMS I [STRING TEXT /HIGHEST FIELD # ? / KSF JMP .-1 KRB TLS TSF JMP .-1 AND (7 IAC DCA FIELDS JMS I [CRLF JMP I INIT CDTERR, 0 JMS I [STRING TEXT /CDTOIF FAILED IN FIELD / TAD COUNT1 TAD FIELDS AND [7 TAD ["0 JMS TYPE JMS I [CRLF JMP I CDTERR TYPE, 0 TLS TSF JMP .-1 CLA KSF JMP I TYPE CTRLQ, TAD (7600 KRS TAD (-7603 SNA JMP I (7600 TAD (3-23 SNA CLA JMP CTRLS KCC JMP I TYPE CTRLS, KCC KSF JMP .-1 JMP CTRLQ PAGE /THE IOT TABLE. THE FORMAT IS: IOT;SHOULD-TRAP-IF-TRAPPED;SHOULD-TRAP- /IF-UNTRAPPED. THE TABLE ENDS WITH IOT=0 Y=7777 N=0000 TABLE, 6000;Y;N 6006;N;N /SGT IFDEF PRODUCTION < 6010;Y;N 6020;Y;N 6030;Y;N 6040;Y;N 6050;Y;N 6060;Y;N 6070;Y;N 6100;Y;N 6110;Y;N 6120;Y;N 6130;Y;N 6140;Y;N 6150;Y;N 6160;Y;N 6170;Y;N / > 6200;Y;Y /CDTOIF 6201;Y;N /CDF 0 6202;Y;N /CIF 0 6203;Y;N /CDF CIF 0 6204;Y;Y /CINT 6205;Y;Y /RTM 6206;Y;Y 6207;Y;Y 6210;Y;Y 6211;Y;N /CDF 10 6212;Y;N /CIF 10 6213;Y;N /CDF CIF 10 6214;N;N /RDF 6215;Y;Y /SKME 6216;Y;Y 6217;Y;Y 6220;Y;Y 6221;Y;N /CDF 20 6222;Y;N /CIF 20 6223;Y;N /CDF CIF 30 6224;N;N /RIF 6225;Y;Y /SKMM 6226;Y;Y 6227;Y;Y 6230;Y;Y 6231;Y;N /CDF 30 6232;Y;N /CIF 30 6233;Y;N /CDF CIF 0 6234;Y;Y 6235;Y;Y 6236;Y;Y 6237;Y;Y 6240;Y;Y 6241;Y;N /CDF 40 6242;Y;N /CIF 40 6243;Y;N /CDF CIF 40 6244;Y;Y 6245;Y;Y 6246;Y;Y 6247;Y;Y 6250;Y;Y 6251;Y;N /CDF 50 6252;Y;N /CIF 50 6253;Y;N /CDF CIF 50 6254;Y;Y 6255;Y;Y 6256;Y;Y 6257;Y;Y 6260;Y;Y 6261;Y;N /CDF 60 6262;Y;N /CIF 60 6263;Y;N /CDF CIF 60 6264;Y;Y 6265;Y;Y 6266;Y;Y 6267;Y;Y 6270;Y;Y 6271;Y;N /CDF 70 6272;Y;N /CIF 70 6273;Y;N /CDF CIF 70 6274;Y;Y 6275;Y;Y 6276;Y;Y 6277;Y;Y IFDEF PRODUCTION < 6300;Y;N 6310;Y;N 6320;Y;N 6320;Y;N 6330;Y;N 6340;Y;N 6350;Y;N 6360;Y;N 6370;Y;N 6400;Y;N 6410;Y;N 6420;Y;N 6430;Y;N 6440;Y;N 6450;Y;N 6460;Y;N 6470;Y;N 6500;Y;N 6510;Y;N 6520;Y;N 6530;Y;N 6540;Y;N 6550;Y;N 6560;Y;N 6570;Y;N 6600;Y;N 6610;Y;N 6620;Y;N 6630;Y;N 6640;Y;N 6650;Y;N 6660;Y;N 6670;Y;N 6700;Y;N 6710;Y;N 6720;Y;N 6730;Y;N 6740;Y;N 6750;Y;N 6760;Y;N 6770;Y;N / > 7402;Y;Y /HLT 7404;Y;Y /OSR 0 /END OF TABLE /LIST FOR STATIC IOT TEST. EACH ENTRY CONSISTS OF /IOT-CODE, SHOULD-SKIP, MAY-CHANGE-AC, (SHOULD-CLEAR-AC). /THE LAST ELEMENT IS ONLY NEEDED IF MAY-CHANGE-AC IS YES. IOTLST, 6200;N;N CMME;N;N RTM;N;Y;N SKME;N;N SKMM;Y;N LTM;N;Y;Y LRM;N;Y;Y SMME;N;N SKME;Y;N SKMM;Y;N RTM;N;Y;N LTM;N;Y;Y LRM;N;Y;Y 0 $