⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ops.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
#define O_CMPW 0xB1		/* compare word */#define O_MCOMW 0xB2		/* move complemented word */#define O_BITW 0xB3		/* bit test word */#define O_CLRW 0xB4		/* clear word */#define O_TSTW 0xB5		/* test word */#define O_INCW 0xB6		/* increment word */#define O_DECW 0xB7		/* decrement word */#define O_BISPSW 0xB8		/* bit set processor status word */#define O_BICPSW 0xB9		/* bit clear processor status word */#define O_POPR 0xBA		/* pop register */#define O_PUSHR 0xBB		/* push register */#define O_CHMK 0xBC		/* change mode to kernel */#define O_CHME 0xBD		/* change mode to executive */#define O_CHMS 0xBE		/* change mode to supervisor */#define O_CHMU 0xBF		/* change mode to user */#define O_ADDL2 0xC0		/* add long 2 operand */#define O_ADDL3 0xC1		/* add long 3 operand */#define O_SUBL2 0xC2		/* subtract long 2 operand */#define O_SUBL3 0xC3		/* subtract long 3 operand */#define O_MULL2 0xC4		/* multiply long 2 operand */#define O_MULL3 0xC5		/* multiply long 3 operand */#define O_DIVL2 0xC6		/* divide long 2 operand */#define O_DIVL3 0xC7		/* divide long 3 operand */#define O_BISL2 0xC8		/* bit set long 2 operand */#define O_BISL3 0xC9		/* bit set long 3 operand */#define O_BICL2 0xCA		/* bit clear long 2 operand */#define O_BICL3 0xCB		/* bit clear long 3 operand */#define O_XORL2 0xCC		/* exclusive or long 2 operand */#define O_XORL3 0xCD		/* exclusive or long 3 operand */#define O_MNEGL 0xCE		/* move negated long */#define O_CASEL 0xCF		/* case long */#define O_MOVL 0xD0		/* move long */#define O_CMPL 0xD1		/* compare long */#define O_MCOML 0xD2		/* move complemented long */#define O_BITL 0xD3		/* bit test long */#define O_CLRL 0xD4		/* clear long (also CLRF) */#define O_TSTL 0xD5		/* test long */#define O_INCL 0xD6		/* increment long */#define O_DECL 0xD7		/* decrement long */#define O_ADWC 0xD8		/* add with carry */#define O_SBWC 0xD9		/* subtrace with carry */#define O_MTPR 0xDA		/* move to processor register */#define O_MFPR 0xDB		/* move from processor register */#define O_MOVPSL 0xDC		/* move processor status longword */#define O_PUSHL 0xDD		/* push long */#define O_MOVAL 0xDE		/* move address of long (also MOVAF) */#define O_PUSHAL 0xDF		/* push address of long (also PUSHAF) */#define O_BBS 0xE0		/* branch on bit set */#define O_BBC 0xE1		/* branch on bit clear */#define O_BBSS 0xE2		/* branch on bit set and set */#define O_BBCS 0xE3		/* branch on bit clear and set */#define O_BBSC 0xE4		/* branch on bit set and clear */#define O_BBCC 0xE5		/* branch on bit clear and clear */#define O_BBSSI 0xE6		/* branch on bit set and set interlocked */#define O_BBCCI 0xE7		/* branch on bit clear and clear interlocked */#define O_BLBS 0xE8		/* branch on low bit set */#define O_BLBC 0xE9		/* branch on low bit clear */#define O_FFS 0xEA		/* find first set bit */#define O_FFC 0xEB		/* find first clear bit */#define O_CMPV 0xEC		/* compare field */#define O_CMPZV 0xED		/* compare zero-extended field */#define O_EXTV 0xEE		/* extract field */#define O_EXTZV 0xEF		/* extract zero-extended field */#define O_INSV 0xF0		/* insert field */#define O_ACBL 0xF1		/* add compare and branch long */#define O_AOBLSS 0xF2		/* add one and branch on less */#define O_AOBLEQ 0xF3		/* add one and branch on less or equal */#define O_SOBGEQ 0xF4		/* subtract one and branch on gtr or equal */#define O_SOBGTR 0xF5		/* subtract one and branch on greater */#define O_CVTLB 0xF6		/* convert long to byte */#define O_CVTLW 0xF7		/* convert long to word */#define O_ASHP 0xF8		/* arithmetic shift and round packed */#define O_CVTLP 0xF9		/* convert long to packed */#define O_CALLG 0xFA		/* call with general argument list */#define O_CALLS 0xFB		/* call with stack */#define O_XFC 0xFC		/* extended function call */#define O_ESCD 0xFD		/* ESCD to DIGITAL */#define O_ESCE 0xFE		/* ESCE to DIGITAL */#define O_ESCF 0xFF		/* ESCF to DIGITAL *//* * Opcode definitions. * * Much of this was taken from the assembler. *//* * Argument access types. */#define ACCA    0100    /* address only */#define ACCR    010	/* read */#define ACCW    020	/* write */#define ACCM    030	/* modify */#define ACCB    040	/* branch displacement */#define ACCI    050	/* variable field *//* * Argument lengths. */#define TYPB    0	/* byte */#define TYPW    01	/* word */#define TYPL    02	/* long */#define TYPQ    03	/* quad */#define TYPF    04	/* floating */#define TYPD    05	/* double floating *//* * Addressing modes. */#define LITSHORT    0x0	/* short literals */#define LITUPTO31   0x1#define LITUPTO47   0x2#define LITUPTO63   0x3#define INDEX       0x4 /* i[r] */#define REG	    0x5 /* r */#define REGDEF      0x6 /* (r) */#define AUTODEC     0x7 /* -(r) */#define AUTOINC     0x8 /* (r)+ */#define AUTOINCDEF  0x9 /* *(r)+ */#define BYTEDISP    0xA /* BD(r) */#define BYTEDISPDEF 0xB /* *BD(r) */#define WORDDISP    0xC /* WD(r) */#define WORDDISPDEF 0xD /* *WD(r) */#define LONGDISP    0xE /* LD(r) */#define LONGDISPDEF 0xF /* *LD(r) */#define is_branch_disp(arg) ((arg & ACCB) != 0)#define typelen(arg)        (arg & 07)#define regnm(mode)	    (mode & 0xF)#define addrmode(mode)      (mode >> 4)/* * Operator information structure. */typedef struct {    char *iname;    char val;    char numargs;    char argtype[6];} Optab;#endifpublic Optab optab[] = {    {"halt", 0x00, 0, 0, 0, 0, 0, 0, 0},     {"nop", 0x01, 0, 0, 0, 0, 0, 0, 0},     {"rei", 0x02, 0, 0, 0, 0, 0, 0, 0},     {"bpt", 0x03, 0, 0, 0, 0, 0, 0, 0},     {"ret", 0x04, 0, 0, 0, 0, 0, 0, 0},     {"rsb", 0x05, 0, 0, 0, 0, 0, 0, 0},     {"ldpctx", 0x06, 0, 0, 0, 0, 0, 0, 0},     {"svpctx", 0x07, 0, 0, 0, 0, 0, 0, 0},     {"cvtps", 0x08, 4, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"cvtsp", 0x09, 4, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"index", 0x0a, 6, ACCR+TYPL, ACCR+TYPL, ACCR+TYPL, ACCR+TYPL, ACCR+TYPL, ACCW+TYPL},     {"crc", 0x0b, 4, ACCA+TYPB, ACCR+TYPL, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"prober", 0x0c, 3, ACCR+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0, 0},     {"probew", 0x0d, 3, ACCR+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0, 0},     {"insque", 0x0e, 2, ACCA+TYPB, ACCA+TYPB, 0, 0, 0, 0},     {"remque", 0x0f, 2, ACCA+TYPB, ACCW+TYPL, 0, 0, 0, 0},     {"bsbb", 0x10, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"brb", 0x11, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bneq", 0x12, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"beql", 0x13, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bgtr", 0x14, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bleq", 0x15, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"jsb", 0x16, 1, ACCA+TYPB, 0, 0, 0, 0, 0},     {"jmp", 0x17, 1, ACCA+TYPB, 0, 0, 0, 0, 0},     {"bgeq", 0x18, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"blss", 0x19, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bgtru", 0x1a, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"blequ", 0x1b, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bvc", 0x1c, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bvs", 0x1d, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bcc", 0x1e, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"bcs", 0x1f, 1, ACCB+TYPB, 0, 0, 0, 0, 0},     {"addp4", 0x20, 4, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"addp6", 0x21, 6, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB},     {"subp4", 0x22, 4, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"subp6", 0x23, 6, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB},     {"cvtpt", 0x24, 5, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0},     {"mulp", 0x25, 6, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB},     {"cvttp", 0x26, 5, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0},     {"divp", 0x27, 6, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB},     {"movc3", 0x28, 3, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, 0, 0, 0},     {"cmpc3", 0x29, 3, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, 0, 0, 0},     {"scanc", 0x2a, 4, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, ACCR+TYPB, 0, 0},     {"spanc", 0x2b, 4, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, ACCR+TYPB, 0, 0},     {"movc5", 0x2c, 5, ACCR+TYPW, ACCA+TYPB, ACCR+TYPB, ACCR+TYPW, ACCA+TYPB, 0},     {"cmpc5", 0x2d, 5, ACCR+TYPW, ACCA+TYPB, ACCR+TYPB, ACCR+TYPW, ACCA+TYPB, 0},     {"movtc", 0x2e, 6, ACCR+TYPW, ACCA+TYPB, ACCR+TYPB, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB},     {"movtuc", 0x2f, 6, ACCR+TYPW, ACCA+TYPB, ACCR+TYPB, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB},     {"bsbw", 0x30, 1, ACCB+TYPW, 0, 0, 0, 0, 0},     {"brw", 0x31, 1, ACCB+TYPW, 0, 0, 0, 0, 0},     {"cvtwl", 0x32, 2, ACCR+TYPW, ACCW+TYPL, 0, 0, 0, 0},     {"cvtwb", 0x33, 2, ACCR+TYPW, ACCW+TYPB, 0, 0, 0, 0},     {"movp", 0x34, 3, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, 0, 0, 0},     {"cmpp3", 0x35, 3, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, 0, 0, 0},     {"cvtpl", 0x36, 3, ACCR+TYPW, ACCA+TYPB, ACCW+TYPL, 0, 0, 0},     {"cmpp4", 0x37, 4, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"editpc", 0x38, 4, ACCR+TYPW, ACCA+TYPB, ACCA+TYPB, ACCA+TYPB, 0, 0},     {"matchc", 0x39, 4, ACCR+TYPW, ACCA+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0},     {"locc", 0x3a, 3, ACCR+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0, 0},     {"skpc", 0x3b, 3, ACCR+TYPB, ACCR+TYPW, ACCA+TYPB, 0, 0, 0},     {"movzwl", 0x3c, 2, ACCR+TYPW, ACCW+TYPL, 0, 0, 0, 0},     {"acbw", 0x3d, 4, ACCR+TYPW, ACCR+TYPW, ACCM+TYPW, ACCB+TYPW, 0, 0},     {"movaw", 0x3e, 2, ACCA+TYPW, ACCW+TYPL, 0, 0, 0, 0},     {"pushaw", 0x3f, 1, ACCA+TYPW, 0, 0, 0, 0, 0},     {"addf2", 0x40, 2, ACCR+TYPF, ACCM+TYPF, 0, 0, 0, 0},     {"addf3", 0x41, 3, ACCR+TYPF, ACCR+TYPF, ACCW+TYPF, 0, 0, 0},     {"subf2", 0x42, 2, ACCR+TYPF, ACCM+TYPF, 0, 0, 0, 0}, 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -