Annotation of cci/d/event/rsvins_evt.s, revision 1.1.1.2

1.1       root        1:  #
                      2:  #     reserved instructions event test
                      3:  #     includes unimplemented instructions
                      4:  #
                      5:  #     R7 = PC that failed
                      6:  #     R0 = error code
                      7:  #          1 - expected reserved inst. fault didnot happen
                      8:  #              R1 = opcode that should cause fault
                      9:  #          2 - Error in PC pushed on the stack
                     10:  #              R1 = actual,  R2 = expected
                     11:  #          3 - PSL is not pushed on the stack
                     12:  #          4 - Too many parameters pushed on the stack
                     13: 
                     14:        .globl  _rsv_evt
                     15: _rsv_evt:
                     16:        .word   0x1fff
                     17:        mtpr    $31,$IPL                /* Set IPL to HIGH              */
                     18:        movab   (sp),_savvec0           /* Save current SP              */
                     19:        mtpr    _savvec0,$ISP           /* Set ISP to current SP        */
                     20:        movl    _scb+PINSTVEC,_savvec2  /* Save priv. inst fault vector */
                     21:        movab   vecvec5,_scb+PINSTVEC   /* Set new vector               */
                     22:        movl    $-1,-(sp)               /* Push marker on stack         */
                     23:        movab   _pcb0,r1
                     24:        mtpr    r1,$PCBB                /* Set PCBB to PCB_U0           */
1.1.1.2 ! root       25:        mfpr    $KSP,_savvec9           /* Save kernal stack pointer    */
        !            26:        mfpr    $USP,_savveca           /* Save user stack pointer      */
1.1       root       27:        movab   rtable,r5               /* R5 = addr reserved operand table */
                     28:        movb    (r5),resinstr           /* Store reserved opcode        */
                     29:        mtpr    $0xff,$PACC             /* Purge all code cache         */
1.1.1.2 ! root       30:        movpsl  r6                      /* r6 = saved psl               */
1.1       root       31:        movab   resinstr,r7             /* R7 = PC that failed */
                     32: 
                     33: resinstr:
                     34:        .byte   0xff    /* This where reserved opcode is stored & executed */
                     35:        movl    $1,r0
                     36:        movb    resinstr,r1             /*r1 = reserved opcode          */
                     37:        andl2   $0xff,r1
                     38:        jmp     *badrtn                 /* Error - no reserved opcode fault */
                     39: #
                     40: #      ***************************************
                     41: #      Event handler for privilege inst. fault
                     42: #      ***************************************
                     43: #      
                     44:        .align  2
                     45: vecvec5:
                     46:        movl    (sp)+,r1        /* R1 = actual PC pop from stack        */
                     47:        movab   resinstr,r2     /* R2 = expected PC                     */
                     48:        cmpl    r1,r2
                     49:        beql    1f
                     50:        movl    $2,r0           /* Error : wrong PC on stack            */
                     51:        jmp     *badrtn         /* R1 = actual & R2 = expected          */
                     52: #
                     53: 1:
                     54:        movl    (sp)+,r1        /* R1 = actual PSL pop from stack       */
1.1.1.2 ! root       55:        movl    r6,r2           /* r2 = expected psl                    */
        !            56:        cmpl    r2,r1
        !            57:        beql    1f
1.1       root       58:        movl    $3,r0           /* Error : PSL is not pushed on stack   */
                     59:        jmp     *badrtn
                     60: #
                     61: 1:
                     62:        cmpl    $-1,(sp)        /* SP should point at the marker        */
                     63:        beql    1f
                     64:        movl    $4,r0           /* Too many parameters pushed on SP     */
                     65:        jmp     *badrtn
                     66: #
                     67: 1:
                     68:        incb    r5              /* Get next reserved opcode             */
                     69:        movb    (r5),resinstr   /* Store it there to be executed        */
                     70:        cmpb    $0,resinstr     /* Is this the last opcode ?            */
                     71:        beql    1f
                     72:        mtpr    $0xff,$23       /* Purge all code cache                 */
1.1.1.2 ! root       73:        movpsl  r6
1.1       root       74:        brw     resinstr        /* Branch back and do again             */
                     75: 1:
1.1.1.2 ! root       76:        
        !            77:        movl    _savvec0,sp
        !            78:        mtpr    _savvec0,$ISP           /* Restore interrupt stack pointer */
        !            79:        mtpr    _savvec9,$KSP           /* Restore kernal stack pointer */
        !            80:        mtpr    _savveca,$USP           /* Restore user stack pointer   */
        !            81:        movl    _savvec2,_scb+PINSTVEC  /* Restore original vector      */
        !            82:        ret                             /* Return                       */
1.1       root       83: #
                     84: #
                     85: #      WARNING : If reserved opcodes change, so do the following table
                     86:        .align  2
                     87: rtable:
                     88: #      .byte   0x01            /* Now is EHALT : 5/13/83       */
                     89:        .byte   0x02
                     90:        .byte   0x03
                     91:        .byte   0x04
                     92: #      .byte   0x05            /* Now is SINF : 20/Feb/85      */
                     93: #      .byte   0x06            /* Now is LDF  : 20/Feb/85      */
                     94: #      .byte   0x07            /* Now is LDD  : 20/Feb/85      */
                     95:        .byte   0x12
                     96:        .byte   0x14
                     97: #      .byte   0x15            /* Now is COSF : 20/Feb/85      */
                     98: #      .byte   0x16            /* Now is LNF  : 20/Feb/85      */
                     99: #      .byte   0x17            /* Now is LND  : 20/Feb/85      */
                    100:        .byte   0x22
                    101:        .byte   0x24
                    102: #      .byte   0x25            /* Now is ATANF : 20/Feb/85     */
                    103: #      .byte   0x26            /* Now is STF   : 20/Feb/85     */
                    104: #      .byte   0x27            /* Now is STD   : 20/Feb/85     */
                    105:        .byte   0x32
                    106:        .byte   0x34
                    107: #      .byte   0x35            /* Now is LOGF  : 20/Feb/85     */
                    108: #      .byte   0x36            /* Now is CMPF  : 20/Feb/85     */
                    109: #      .byte   0x37            /* Now is CMPD  : 20/Feb/85     */
                    110:        .byte   0x42
                    111:        .byte   0x43
                    112:        .byte   0x44
                    113: #      .byte   0x45            /* Now is SQRTF : 20/Feb/85     */
                    114: #      .byte   0x46            /* Now is CMPF2 : 20/Feb/85     */
                    115: #      .byte   0x47            /* Now is CMPD2 : 20/Feb/85     */
                    116:        .byte   0x4f
                    117:        .byte   0x52
                    118:        .byte   0x53
                    119:        .byte   0x54
                    120: #      .byte   0x55            /* Now is EXPF  : 20/Feb/85     */
                    121: #      .byte   0x56            /* Now is TSTF  : 20/Feb/85     */
                    122: #      .byte   0x57            /* Now is TSTD  : 20/Feb/85     */
                    123:        .byte   0x62
                    124:        .byte   0x63
                    125:        .byte   0x64
                    126:        .byte   0x65
                    127:        .byte   0x66
                    128: #      .byte   0x67            /* Now is PUSHD : 20/Feb/85     */
                    129:        .byte   0x72
                    130:        .byte   0x73
                    131:        .byte   0x74
                    132:        .byte   0x75
                    133: #      .byte   0x76            /* Now is CVLF  : 20/Feb/85     */
                    134: #      .byte   0x77            /* Now is CVLD  : 20/Feb/85     */
                    135:        .byte   0x83
                    136:        .byte   0x84
                    137:        .byte   0x85
                    138: #      .byte   0x86            /* Now is CVFL  : 20/Feb/85     */
                    139: #      .byte   0x87            /* Now is CVDL  : 20/Feb/85     */
                    140:        .byte   0x8f
                    141:        .byte   0x93
                    142:        .byte   0x94
                    143:        .byte   0x95
                    144:        .byte   0x96
                    145: #      .byte   0x97            /* Now is LDFD  : 20/Feb/85     */
                    146:        .byte   0x9f
                    147:        .byte   0xa2
                    148:        .byte   0xa3
                    149:        .byte   0xa4
                    150:        .byte   0xa5
                    151: #      .byte   0xa6            /* Now is CVDF  : 20/Feb/85     */
                    152:        .byte   0xa7
                    153:        .byte   0xaf
                    154:        .byte   0xb2
                    155:        .byte   0xb3
                    156:        .byte   0xb4
                    157:        .byte   0xb5
                    158: #      .byte   0xb6            /* Now is NEGF  : 20/Feb/85     */
                    159: #      .byte   0xb7            /* Now is NEGD  : 20/Feb/85     */
                    160:        .byte   0xc4
                    161:        .byte   0xc5
                    162: #      .byte   0xc6            /* Now is ADDF  : 20/Feb/85     */
                    163: #      .byte   0xc7            /* Now is ADDD  : 20/Feb/85     */
                    164: #      .byte   0xcb            /* Now is MOVOW : 6/14/83       */
                    165:        .byte   0xd3
                    166:        .byte   0xd4
                    167:        .byte   0xd5
                    168: #      .byte   0xd6            /* Now is SUBF  : 20/Feb/85     */
                    169: #      .byte   0xd7            /* Now is SUBD  : 20/Feb/85     */
                    170:        .byte   0xde
                    171:        .byte   0xdf
                    172:        .byte   0xe2
                    173:        .byte   0xe3
                    174:        .byte   0xe4
                    175:        .byte   0xe5
                    176: #      .byte   0xe6            /* Now is MULF  : 20/Feb/85     */
                    177: #      .byte   0xe7            /* Now is MULD  : 20/Feb/85     */
                    178:        .byte   0xef
                    179:        .byte   0xf2
                    180:        .byte   0xf3
                    181:        .byte   0xf4
                    182:        .byte   0xf5
                    183: #      .byte   0xf6            /* Now is DIVF  : 20/Feb/85     */
                    184: #      .byte   0xf7            /* Now is DIVD  : 20/Feb/85     */
                    185:        .byte   0xfa
                    186:        .byte   0xff
                    187:        .byte   0x61            /* 8/23 */
                    188:        .byte   0x0f            /* 8/23 */
                    189: #      .byte   0x6e            /* 12/7 divl2u */
                    190: #      .byte   0x7e            /* 12/7 divl3u */
                    191: #      .byte   0x68            /* 12/7 Modl2 */
                    192: #      .byte   0x6a            /* 12/7 Modl2u */
                    193: #      .byte   0x78            /* 12/7 Modl3 */
                    194: #      .byte   0x7a            /* 12/7 Modl3u */
                    195:        .byte   0x00

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.