DataMuseum.dk

Presents historical artifacts from the history of:

CR80 Hard and Floppy Disks

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CR80 Hard and Floppy Disks

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦6e09bcf95⟧ TextFile

    Length: 7814 (0x1e86)
    Types: TextFile
    Names: »TRACE_TRAP_TESTS«

Derivation

└─⟦18a2fd90d⟧ Bits:30005144 8" CR80 Floppy CR80FD_0132 ( CR/D/2479 CRD2479: En-CPU CPU/CACHE TEST- PROGRAMMER node: master: CRP5 )
    └─⟦56889de57⟧ 
        └─ ⟦this⟧ »TRACE_TRAP_TESTS« 

TextFile

PROCEDURE TRACE_TRAP_TEST (R6);
"*********************************************************************

"    TEST TRACETRAP
"    Description:
"         If the parameter LEVEL is zero, a tracetrap is generated.
"         This is indicated by the variable NOO_INTERRUPT: 0=tracetrap.
"
"         The cause-codes (which are only valid after a tracetrap)
"         are saved in the array RESULTS[....] :
"              RESULTS[0] : register 0,
"              RESULTS[1] : register 1,
"              RESULTS[7] : register 7,
"
"         NOO_INTERRUPT is saved in RESULTS[3].
"         #FFFF is saved in RESULTS[4].
"         The context_record generated by the tracetrap is saved in
"         RESULTS[5] to RESULTS[#14].
"
"         The context_record, the cause-codes and the expected cause code
"         2 is printed on the oc, if the variable LOC_OUT_ENABLE is =1.
"

"*********************************************************************
VAR
SAVE:    ARRAY[0..7] OF INTEGER;
SSAV_REG0:     INTEGER;
SSAV_REG1:     INTEGER;
SSAV_REG7:     INTEGER;
EXT_DP:        INTEGER;
AADR_HEX40:     INTEGER;
AADR_HEX39:     INTEGER;
AADR_HEX100:    INTEGER;
NOO_INTERRUPT:  INTEGER;
C_RECORD_STRING:   ARRAY[0..#10] OF INTEGER;
LOG_PG1:     INTEGER;
LOCC_COUNT:   INTEGER;


LABEL TRACE_REENTRY;
LABEL CONTT;
LABEL NO_INTT_ENTRY;
LABEL MON1_ENTRY;
LABEL TRACETRAP;





BEGIN
R7=>SAVE[7];
STC(6,ADDRESS(SAVE[7])=>R7);

IF (LOC_OUT_ENABLE=>R0=1) THEN
     BEGIN
     OUTNEWLINE(R6);
     OUTTEXT(ADDRESS('TEST 6 RUNNING(:0:)')=>R3,R6);
     OUTNEWLINE(R6);
     FLUSHOUT(R6);
     END;

"MAP IN LOG_PROG_PAGE0 AS DATAPAGE 1

    #0FC0=>R1;
    SIO(R0,R1);                    "READ PHPAGE OF LOGPROGPAGE 0
    #0FA0=>R1;
    CAD;
    CIO(R0,R1);                    "MAP IN THIS PHPAGE AS LOGDATAPAGE 1
    R0=>EXT_DP;
    CAD;


    "SAVE LOGPROGLOCATIONS HEX 39, HEX 40, HEX 100

    #8040=>R7;
    R7@INTEGER=>R0=>AADR_HEX40;
    #8100=>R7;
    R7@INTEGER=>R0=>AADR_HEX100;
    #8039=>R7;
    R7@INTEGER=>R0=>AADR_HEX39;

    "PLACE JUMP TO TRACE_REENTRY IN LOG-PROG-LOCATION HEX 39

    #8039=>R7;
    LOCATION(TRACE_REENTRY)=>R0;
    R0=>R7@INTEGER;
    GOTO CONTT;


MON1_ENTRY:                   "MON 64 ENTRY

    " SET LEVEL IN CONTEXT RECORD TO VALUE IN REG 4,
    " AND SET PSW11 ACCORDINGLY

    R4 EXTRACT 4;
    R4 SHIFTLL 4;

    #FFDD=>R7;
    R7@INTEGER=>R7;
    R7+#C;                         "R7 POINTS NOW AT PSW IN CONTEXT REC.
    R7@INTEGER=>R0;

    IF R4=0 THEN
        BEGIN
        #F7FF=>R1;
        R1 AND R0=>R0=>R7@INTEGER; "CLEAR PSW11 IN CONTEXT RECORD
        END
    ELSE
        BEGIN
        #0800=>R1;
        R1 IOR R0=>R0=>R7@INTEGER; "SET PSW11 IN CONTEXT RECORD
        END;

    R7+1;                          "R7 NOW POINTS AT EXR IN CONTEXT RECORD

    R7@INTEGER=>R0;
    #FF0F=>R1;
    R0 AND R1=>R1;
    R1 IOR R4=>R1;
    R1=>R7@INTEGER;                "EXR IN CONTEXT STACK := OLD VALUE,
                                   "WITH NEW LEVEL

    RTM(0,0);




CONTT:


"INITIALIZE DP63

    #FFDD=>R7;
    #FF00=>R0;
    R0=>R7@INTEGER;

    #FFDE=>R7;
    #F000=>R0=>R7@INTEGER;

    #FFDF=>R7;
    #FF00=>R0=>R7@INTEGER;

    #10=>R2;
    0=>R0;
    #FFF0=>R7;
    #3F3E=>R1;
    WHILE R0<>R2 DO
        BEGIN
        R1=>R7@INTEGER;
        R0+1;
        R7+1;
        END;


"::::::::::::::::::::::::::::::::::::::::::


    "SET TRACE-BIT IN PSW

    1=>R6=>NOO_INTERRUPT;
    SVS(R0);
    #0002=>R1;
    R1 IOR R0=>R0;
    LDS(R0);


    "PREPARE MONITOR_CALL

    #8040=>R7;
    LOCATION(MON1_ENTRY)=>R0=>R7@INTEGER;
    #8100=>R7;
    #FFFF=>R0=>R7@INTEGER;
    LOC_LEVEL=>R4 EXTRACT 4;           "NEW LEVEL := LEVEL
    MON(064);

    "WHEN RETURNING FROM MON(64), A TRACETRAP SHOULD BE GENERATED,
    "PROVIDED THE NEW LEVEL = 0

    TRACETRAP:                     "If no interrupt is generated,
                                   "this is the entry. A monitor call
                                   "is executed instead of the trace-
                                   "trap.

    #F=>R4;
    MON(064);                                  "RAISE LEVEL TO F
    GOTO NO_INTT_ENTRY;



"::::::::::::::::::::::::::::::::::::::::::

TRACE_REENTRY:

        NOP;
        NOP;
        NOP;
        NOP;
    0=>R6=>NOO_INTERRUPT;
        NOP;
        NOP;
NO_INTT_ENTRY:
        NOP;
        NOP;
        NOP;
        NOP;
        NOP;
        NOP;
        NOP;
        NOP;
        NOP;
    "SAVE CAUSE CODES

    R0=>SSAV_REG0=>R0=>RESULTS[0];
    R1=>SSAV_REG1=>R1=>RESULTS[1];
    R7=>SSAV_REG7=>R7=>RESULTS[2];

    "REESTABLISH LOGPROGLOCATIONS HEX 39, HEX 40, HEX 100

    AADR_HEX39=>R6;
    #8039=>R7;
    R6=>R7@INTEGER;

    AADR_HEX40=>R6;
    #8040=>R7;
    R6=>R7@INTEGER;

    AADR_HEX100=>R6;
    #8100=>R7;
    R6=>R7@INTEGER;

    NOO_INTERRUPT=>R0=>RESULTS[3];
    #FFFF=>R0=>RESULTS[4];

    IF (NOO_INTERRUPT=>R0)=1 THEN
        BEGIN
        IF (LOC_OUT_ENABLE=>R0)=1 THEN
            BEGIN
            OUTNEWLINE(R6);
            OUTTEXT(ADDRESS('NO INTERRUPT (:0:)')=>R3,R6);
            OUTNEWLINE(R6);
            FLUSHOUT(R6);
            END;
        END
    ELSE
        BEGIN
        IF (LOC_OUT_ENABLE=>R0)=1 THEN
            BEGIN
            OUTNEWLINE(R6);
            OUTTEXT(ADDRESS('TRACE INTERRUPT  (:0:)')=>R3,R6);
            OUTNEWLINE(R6);
            FLUSHOUT(R6);
            END;
        END;


    "DUMP CONTEXTRECORD, REESTABLISH CONTEXT STACK POINTER


    #FFDD=>R7;
    R7@INTEGER=>R6;
    0=>R0;
    #10=>R2;
    #5=>R3;

    WHILE R0<>R2 DO                "READ CONTEXTRECORD => C_RECORD_STRING
        BEGIN
        R6@INTEGER=>C_RECORD_STRING[R0];
        R6@INTEGER=>R7=>RESULTS[R3];
        R0+1;
        R6+1;
        R3+1;
        END;


     #15=>R7;
     LOCATION(TRACETRAP)=>R0=>RESULTS[R7];


    #FFDD=>R7;                     "REESTABLISH CONTEXT STACK POINTER
    #FF00=>R7@INTEGER;


    IF (LOC_OUT_ENABLE=>R0)=1 THEN
        BEGIN
        "DUMP CONTEXT RECORD

        OUTNEWLINE(R6);
        OUTTEXT(ADDRESS('  R0   R1   R2   R3   R4   R5   R6   R7   (:0:)')=>R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);
        0=>R7;
        WHILE R7<>8 DO
            BEGIN
            C_RECORD_STRING[R7]=>R3;
            OUTHEX(R3,R6);
            R7+1;
            END;

        FLUSHOUT(R6);

        OUTNEWLINE(R6);
        OUTTEXT(ADDRESS(' BASE  MOD PROG  PRPC PSW  EXR  DP63 (:0:)')=>R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);


        8=>R7;
        #F=>R1;
        WHILE R7<>R1 DO
            BEGIN
            C_RECORD_STRING[R7]=>R3;
            OUTHEX(R3,R6);
            R7+1;
            END;

        OUTNEWLINE(R6);
        FLUSHOUT(R6);


        "DUMP CAUSE CODES

        OUTNEWLINE(R6);
        OUTTEXT(ADDRESS('REGISTER 0 AFTER INT = (:0:)')=>R3,R6);
        SSAV_REG0=>R3;
        OUTHEX(R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);

        OUTTEXT(ADDRESS('REGISTER 1 AFTER INT = (:0:)')=>R3,R6);
        SSAV_REG1=>R3;
        OUTHEX(R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);


        OUTTEXT(ADDRESS('REGISTER 7 AFTER INT = (:0:)')=>R3,R6);
        SSAV_REG7=>R3;
        OUTHEX(R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);

        OUTTEXT(ADDRESS('EXPECTED CC2  = (:0:)')=>R3,R6);
        LOCATION(TRACETRAP)=>R3;
        OUTHEX(R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);
        END;


    "CLEAR CONTEXT RECORD

    #FEF1=>R7;
    #0=>R1;
    #10=>R2;
    WHILE R1<>R2 DO
        BEGIN
        0=>R7@INTEGER;
        R7+1;
        R1+1;
        END;


    IF (DICA=>R0)=0 THEN CAE ELSE CAD;



    IF (LOC_OUT_ENABLE=>R0)=1 THEN
        BEGIN
        OUTTEXT(ADDRESS('TEST 6 TERMINATED (:0:)')=>R3,R6);
        OUTNEWLINE(R6);
        FLUSHOUT(R6);
        END;

UNS(7,ADDRESS(SAVE[0])=>R7);
EXIT(R6);
END;   "END OF TEST6     "