Annotation of researchv9/cmd/sun/as/inst.h, revision 1.1

1.1     ! root        1: /*     @(#)inst.h 1.1 86/02/03 SMI     */
        !             2: 
        !             3: /*
        !             4:  * Copyright (c) 1985 by Sun Microsystems, Inc.
        !             5:  */
        !             6: 
        !             7: 
        !             8: 
        !             9: /* 
        !            10:  * When this table is changed, we must also change:
        !            11:  *     the table in instruction.c that is indexed by it.
        !            12:  */
        !            13: typedef enum{
        !            14:        OP_FIRST = 0, OP_COMMENT, OP_LABEL,
        !            15:        OP_LONG, OP_WORD, OP_BYTE, OP_TEXT, 
        !            16:        OP_DATA, OP_DATA1, OP_DATA2, OP_BSS, 
        !            17:        OP_PROC, OP_GLOBL, OP_COMM, OP_EVEN, OP_ALIGN, 
        !            18:        OP_ASCIZ, OP_ASCII, OP_FLOAT, OP_DOUBLE,
        !            19:        OP_STABS, OP_STABD, OP_STABN, OP_SKIP, OP_LCOMM, OP_CPID, 
        !            20:        OP_CSWITCH, OP_FSWITCH, OP_BRANCH, OP_MOVE, OP_MOVEM, 
        !            21:        OP_EXIT, OP_DBRA, OP_CALL, OP_JUMP, OP_DJMP, 
        !            22:        OP_LINK, OP_CMP, OP_PEA, OP_ADD, OP_AND, 
        !            23:        OP_EXT, OP_OR, OP_TST, OP_ASL, OP_ASR, 
        !            24:        OP_SUB, OP_UNLK, OP_LEA, OP_CLR , OP_BOP,
        !            25:        OP_EOR,
        !            26:        OP_OTHER
        !            27: } opcode_t;
        !            28: 
        !            29: typedef enum{  /* First eight are 68881 data types. */
        !            30:     SUBOP_L = 0, SUBOP_S = 1, SUBOP_X = 2,
        !            31:     SUBOP_P = 3, SUBOP_W = 4, SUBOP_D = 5,
        !            32:     SUBOP_B = 6, SUBOP_C = 7,
        !            33:     JEQ = 8, JNE, JLE, JGE, JLT, JGT, JLS, JHI, JMI, JPL,
        !            34:     JALL, JCS, JCC, JVS, JVC, JNONE, JIND,
        !            35:     SUBOP_Z    /* Last type for typeless instructions. */
        !            36: } subop_t;
        !            37: 
        !            38: #if AS
        !            39: 
        !            40: #define N_OPTYPES 8    /* Maximum number of operand type descriptors. */
        !            41: 
        !            42: struct ins_bkt {
        !            43:        char            *text_i;
        !            44:        int            (*routine_i)();
        !            45:        opcode_t         op_i:8;
        !            46:        subop_t          subop_i:8;
        !            47:        short            noper_i:8;
        !            48:        short            align_i:8;
        !            49:        unsigned short   touchop_i;
        !            50:        unsigned short
        !            51:                         opval_i[5]; /* info, usually opcodes */
        !            52:        unsigned         optype_i[8]; /* up to 4 pairs of 2 operands */
        !            53:        short            xflags_i;
        !            54: };
        !            55: 
        !            56: /* instruction flags */
        !            57: #define I20    1       /* instruction only on 68020 */
        !            58: #define I81    2       /* instruction only on 68881 */
        !            59: 
        !            60: struct ins_ptr {       /* arranged so op-code table can be read-only */
        !            61:        char           *name_p;
        !            62:        struct ins_ptr *next_p;
        !            63:        struct ins_bkt *this_p;
        !            64: };
        !            65: 
        !            66: #endif
        !            67: extern struct ins_ptr *inst;
        !            68: 
        !            69: extern char   opcodetypes[];
        !            70: #define INSTRTYPE      1
        !            71: #define PSEUDONOCODE   2
        !            72: #define PSEUDOCODE     4
        !            73: #define ISINSTRUC( op ) (opcodetypes[(int)(op)]&INSTRTYPE)
        !            74: #define ISPSEUDO( op ) (opcodetypes[(int)(op)]&(PSEUDOCODE|PSEUDONOCODE))
        !            75: #define ISDIRECTIVE( op ) (opcodetypes[(int)(op)]&PSEUDONOCODE)
        !            76: 
        !            77: /* operand access bits */
        !            78: # define RMASK 3
        !            79: # define WMASK 014
        !            80: # define TOUCHWIDTH 5
        !            81: # define TOUCHMASK  037
        !            82: # define BR  1
        !            83: # define WR  2
        !            84: # define LR  3
        !            85: # define BW  4
        !            86: # define WW  8
        !            87: # define LW  12
        !            88: # define SPEC(n) (16+n)
        !            89: # define TOUCH1(a) ((a)<<2*TOUCHWIDTH)
        !            90: # define TOUCH2(a) ((a)<<TOUCHWIDTH)
        !            91: # define TOUCH3(a) (a)
        !            92: /* operand access bits for floating point */
        !            93: # define SR    LR
        !            94: # define XR    LR
        !            95: # define PR    LR
        !            96: # define DR    LR
        !            97: # define CR    LR
        !            98: # define FR    LR
        !            99: # define SW    LW
        !           100: # define XW    LW
        !           101: # define PW    LW
        !           102: # define DW    LW
        !           103: # define CW    LW
        !           104: # define FW    LW
        !           105: 
        !           106: /* size code fields for floating point */
        !           107: 
        !           108: # define L_SIZE        0*02000
        !           109: # define S_SIZE        1*02000
        !           110: # define X_SIZE        2*02000
        !           111: # define P_SIZE        3*02000
        !           112: # define W_SIZE        4*02000
        !           113: # define D_SIZE        5*02000
        !           114: # define B_SIZE        6*02000
        !           115: # define C_SIZE        7*02000
        !           116: 
        !           117: /* floating point condition code fields */
        !           118: 
        !           119: # define FCC_F         00
        !           120: # define FCC_EQ                01
        !           121: # define FCC_OGT       02
        !           122: # define FCC_OGE       03
        !           123: # define FCC_OLT       04
        !           124: # define FCC_OLE       05
        !           125: # define FCC_OGL       06
        !           126: # define FCC_OR                07
        !           127: # define FCC_UN                010
        !           128: # define FCC_UEQ       011
        !           129: # define FCC_UGT       012
        !           130: # define FCC_UGE       013
        !           131: # define FCC_ULT       014
        !           132: # define FCC_ULE       015
        !           133: # define FCC_NEQ       016
        !           134: # define FCC_T         017
        !           135: # define FCC_SF                020
        !           136: # define FCC_SEQ       021
        !           137: # define FCC_GT                022
        !           138: # define FCC_GE                023
        !           139: # define FCC_LT                024
        !           140: # define FCC_LE                025
        !           141: # define FCC_GL                026
        !           142: # define FCC_GLE       027
        !           143: # define FCC_NGLE      030
        !           144: # define FCC_NGL       031
        !           145: # define FCC_NLE       032
        !           146: # define FCC_NLT       033
        !           147: # define FCC_NGE       034
        !           148: # define FCC_NGT       035
        !           149: # define FCC_SNEQ      036
        !           150: # define FCC_ST                037
        !           151: 
        !           152: /* operand addressing mode bits */
        !           153: 
        !           154: # define AM_DREG       01
        !           155: # define AM_AREG       02
        !           156: # define AM_DEFER      04
        !           157: # define AM_POSTINC    010
        !           158: # define AM_PREDEC     020
        !           159: # define AM_DISPL      040
        !           160: # define AM_INDEX      0100
        !           161: # define AM_ABSS       0200
        !           162: # define AM_ABSL       0400
        !           163: # define AM_IMMED      01000
        !           164: # define AM_PCDISPL    02000
        !           165: # define AM_PCINDEX    04000
        !           166: # define AM_NORMAL     010000
        !           167: # define AM_REG                (AM_DREG|AM_AREG)
        !           168: # define AM_ALL                017777
        !           169: # define AM_FREG       020000
        !           170: # define AM_CCREG      040000
        !           171: # define AM_CTRLREG    0100000
        !           172: # define AM_USPREG     0200000
        !           173: # define AM_PCREG      0400000
        !           174: # define AM_REGPAIR    01000000
        !           175: # define AM_FCTRLREG   02000000
        !           176: # define AM_REGLIST    04000000
        !           177: # define AM_FREGLIST   010000000
        !           178: # define AM_FCREGLIST  020000000
        !           179: 
        !           180: # define AM_AMEM       (AM_DEFER|AM_POSTINC|AM_PREDEC|AM_DISPL|AM_INDEX|AM_ABSS|AM_ABSL|AM_NORMAL)
        !           181: # define AM_ADAT       (AM_AMEM|AM_DREG)
        !           182: # define AM_CTRL       (AM_DEFER|AM_DISPL|AM_INDEX|AM_ABSS|AM_ABSL|AM_NORMAL|AM_PCDISPL|AM_PCINDEX)
        !           183: # define AM_ACTRL      (AM_DEFER|AM_DISPL|AM_INDEX|AM_ABSS|AM_ABSL|AM_NORMAL)
        !           184: # define AM_MEM                (AM_ALL&~AM_REG)
        !           185: # define AM_ADDR       (AM_ALL&~AM_REG&~AM_IMMED)
        !           186: # define AM_DATA       (AM_ALL&~AM_AREG)
        !           187: # define AM_AA         (AM_ALL&~(AM_PCDISPL|AM_PCINDEX|AM_IMMED))
        !           188: 
        !           189: #if C2
        !           190: /* cc set */
        !           191: # define CC0           0
        !           192: # define CC1           1
        !           193: # define CC2           2
        !           194: # define CCX           3
        !           195: # define CCR           0100
        !           196: #endif

unix.superglobalmegacorp.com

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