ack/mach/i386/as/mach3.c

282 lines
6.9 KiB
C

/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#define RCSID3 "$Header$"
/*
* INTEL 80386 keywords
*
* No system registers for now ...
*/
0, R32, 0, "ax",
0, R32, 1, "cx",
0, R32, 2, "dx",
0, R32, 3, "bx",
0, R32, 4, "sp",
0, R32, 5, "bp",
0, R32, 6, "si",
0, R32, 7, "di",
0, R32, 0, "eax",
0, R32, 1, "ecx",
0, R32, 2, "edx",
0, R32, 3, "ebx",
0, R32, 4, "esp",
0, R32, 5, "ebp",
0, R32, 6, "esi",
0, R32, 7, "edi",
0, R8, 0, "al",
0, R8, 1, "cl",
0, R8, 2, "dl",
0, R8, 3, "bl",
0, R8, 4, "ah",
0, R8, 5, "ch",
0, R8, 6, "dh",
0, R8, 7, "bh",
0, RSEG, 0, "es",
0, RSEG, 1, "cs",
0, RSEG, 2, "ss",
0, RSEG, 3, "ds",
0, RSEG, 4, "fs",
0, RSEG, 5, "gs",
0, RSYSCR, 0, "cr0",
0, RSYSCR, 2, "cr2",
0, RSYSCR, 3, "cr3",
0, RSYSDR, 0, "dr0",
0, RSYSDR, 1, "dr1",
0, RSYSDR, 2, "dr2",
0, RSYSDR, 3, "dr3",
0, RSYSDR, 6, "dr6",
0, RSYSDR, 7, "dr7",
0, RSYSTR, 6, "tr6",
0, RSYSTR, 7, "tr7",
0, ADDOP, 000, "addb",
0, ADDOP, 001, "add",
0, ADDOP, 010, "orb",
0, ADDOP, 011, "or",
0, ADDOP, 020, "adcb",
0, ADDOP, 021, "adc",
0, ADDOP, 030, "sbbb",
0, ADDOP, 031, "sbb",
0, ADDOP, 040, "andb",
0, ADDOP, 041, "and",
0, ADDOP, 050, "subb",
0, ADDOP, 051, "sub",
0, ADDOP, 060, "xorb",
0, ADDOP, 061, "xor",
0, ADDOP, 070, "cmpb",
0, ADDOP, 071, "cmp",
0, BITTEST, 04, "bt",
0, BITTEST, 05, "bts",
0, BITTEST, 06, "btr",
0, BITTEST, 07, "btc",
0, CALFOP, 030+(0232<<8), "callf",
0, CALFOP, 050+(0352<<8), "jmpf",
0, CALLOP, 020+(0350<<8), "call",
0, CALLOP, 040+(0351<<8), "jmp",
0, ENTER, 0310, "enter",
0, EXTEND, 0267, "movzx",
0, EXTEND, 0266, "movzxb",
0, EXTEND, 0277, "movsx",
0, EXTEND, 0276, "movsxb",
0, EXTOP, 0002, "lar",
0, EXTOP, 0003, "lsl",
0, EXTOP, 0274, "bsf",
0, EXTOP, 0275, "bsr",
0, EXTOP1, 0000, "sldt",
0, EXTOP1, 0001, "sgdt",
0, EXTOP1, 0010, "str",
0, EXTOP1, 0011, "sidt",
0, EXTOP1, 0020, "lldt",
0, EXTOP1, 0021, "lgdt",
0, EXTOP1, 0030, "ltr",
0, EXTOP1, 0031, "lidt",
0, EXTOP1, 0040, "verr",
0, EXTOP1, 0041, "smsw",
0, EXTOP1, 0050, "verw",
0, EXTOP1, 0061, "lmsw",
0, IMUL, 00, "imul",
0, IMULB, 01, "imulb",
0, INCOP, 000, "incb",
0, INCOP, 001, "inc",
0, INCOP, 010, "decb",
0, INCOP, 011, "dec",
0, INT, 0, "int",
0, IOOP, 0344, "inb",
0, IOOP, 0345, "in",
0, IOOP, 0346, "outb",
0, IOOP, 0347, "out",
0, JOP, 0340, "loopne",
0, JOP, 0340, "loopnz",
0, JOP, 0341, "loope",
0, JOP, 0341, "loopz",
0, JOP, 0342, "loop",
0, JOP, 0343, "jcxz",
0, JOP, 0343, "jecxz",
0, JOP2, 0000, "jo",
0, JOP2, 0001, "jno",
0, JOP2, 0002, "jb",
0, JOP2, 0002, "jnae",
0, JOP2, 0003, "jae",
0, JOP2, 0003, "jnb",
0, JOP2, 0004, "je",
0, JOP2, 0004, "jz",
0, JOP2, 0005, "jne",
0, JOP2, 0005, "jnz",
0, JOP2, 0006, "jbe",
0, JOP2, 0006, "jna",
0, JOP2, 0007, "ja",
0, JOP2, 0007, "jnbe",
0, JOP2, 0010, "js",
0, JOP2, 0011, "jns",
0, JOP2, 0012, "jp",
0, JOP2, 0012, "jpe",
0, JOP2, 0013, "jnp",
0, JOP2, 0013, "jpo",
0, JOP2, 0014, "jl",
0, JOP2, 0014, "jnge",
0, JOP2, 0015, "jge",
0, JOP2, 0015, "jnl",
0, JOP2, 0016, "jle",
0, JOP2, 0016, "jng",
0, JOP2, 0017, "jg",
0, JOP2, 0017, "jnle",
0, LEAOP, 0142, "bound",
0, LEAOP, 0215, "lea",
0, LEAOP, 0304, "les",
0, LEAOP, 0305, "lds",
0, LEAOP2, 0262, "lss",
0, LEAOP2, 0264, "lfs",
0, LEAOP2, 0265, "lgs",
0, LSHFT, 0244, "shld",
0, LSHFT, 0254, "shrd",
0, MOV, 0, "movb",
0, MOV, 1, "mov",
0, NOOP_1, 0140, "pusha",
0, NOOP_1, 0140, "pushad",
0, NOOP_1, 0141, "popa",
0, NOOP_1, 0141, "popad",
0, NOOP_1, 0156, "outsb",
0, NOOP_1, 0157, "outs",
0, NOOP_1, 0220, "nop",
0, NOOP_1, 0230, "cbw",
0, NOOP_1, 0230, "cwde", /* same opcode as cbw! */
0, NOOP_1, 0231, "cdq", /* same opcode as cwd! */
0, NOOP_1, 0231, "cwd",
0, NOOP_1, 0233, "wait",
0, NOOP_1, 0234, "pushf",
0, NOOP_1, 0235, "popf",
0, NOOP_1, 0236, "sahf",
0, NOOP_1, 0237, "lahf",
0, NOOP_1, 0244, "movsb",
0, NOOP_1, 0245, "movs",
0, NOOP_1, 0246, "cmpsb",
0, NOOP_1, 0246, "insb",
0, NOOP_1, 0247, "cmps",
0, NOOP_1, 0247, "ins",
0, NOOP_1, 0252, "stosb",
0, NOOP_1, 0253, "stos",
0, NOOP_1, 0254, "lodsb",
0, NOOP_1, 0255, "lods",
0, NOOP_1, 0256, "scasb",
0, NOOP_1, 0257, "scas",
0, NOOP_1, 0311, "leave",
0, NOOP_1, 0316, "into",
0, NOOP_1, 0317, "iret",
0, NOOP_1, 0317, "iretd",
0, NOOP_1, 0327, "xlat",
0, NOOP_1, 0364, "hlt",
0, NOOP_1, 0365, "cmc",
0, NOOP_1, 0370, "clc",
0, NOOP_1, 0371, "stc",
0, NOOP_1, 0372, "cli",
0, NOOP_1, 0373, "sti",
0, NOOP_1, 0374, "cld",
0, NOOP_1, 0375, "std",
0, NOOP_1, 047, "daa",
0, NOOP_1, 057, "das",
0, NOOP_1, 067, "aaa",
0, NOOP_1, 077, "aas",
0, NOOP_2, 017+06<<8, "clts",
0, NOOP_2, 0324+012<<8, "aam",
0, NOOP_2, 0325+012<<8, "aad",
0, NOTOP, 020, "notb",
0, NOTOP, 021, "not",
0, NOTOP, 030, "negb",
0, NOTOP, 031, "neg",
0, NOTOP, 040, "mulb",
0, NOTOP, 041, "mul",
0, NOTOP, 060, "divb",
0, NOTOP, 061, "div",
0, NOTOP, 070, "idivb",
0, NOTOP, 071, "idiv",
0, PREFIX, 0144, "fseg",
0, PREFIX, 0145, "gseg",
0, PREFIX, 0146, "o16", /* operand size toggle */
0, PREFIX, 0146, "o32", /* operand size toggle */
0, PREFIX, 0147, "a16", /* address size toggle */
0, PREFIX, 0147, "a32", /* address size toggle */
0, PREFIX, 0360, "lock",
0, PREFIX, 0362, "rep",
0, PREFIX, 0362, "repne",
0, PREFIX, 0362, "repnz",
0, PREFIX, 0363, "repe",
0, PREFIX, 0363, "repz",
0, PREFIX, 046, "eseg",
0, PREFIX, 056, "cseg",
0, PREFIX, 066, "sseg",
0, PREFIX, 076, "dseg",
0, PUSHOP, 0, "push",
0, PUSHOP, 1, "pop",
0, RET, 0303, "ret",
0, RET, 0313, "retf",
0, ROLOP, 000, "rolb",
0, ROLOP, 001, "rol",
0, ROLOP, 010, "rorb",
0, ROLOP, 011, "ror",
0, ROLOP, 020, "rclb",
0, ROLOP, 021, "rcl",
0, ROLOP, 030, "rcrb",
0, ROLOP, 031, "rcr",
0, ROLOP, 040, "salb",
0, ROLOP, 040, "shlb",
0, ROLOP, 041, "sal",
0, ROLOP, 041, "shl",
0, ROLOP, 050, "shrb",
0, ROLOP, 051, "shr",
0, ROLOP, 070, "sarb",
0, ROLOP, 071, "sar",
0, SETCC, 0000, "seto",
0, SETCC, 0001, "setno",
0, SETCC, 0002, "setb",
0, SETCC, 0002, "setnae",
0, SETCC, 0003, "setae",
0, SETCC, 0003, "setnb",
0, SETCC, 0004, "sete",
0, SETCC, 0004, "setz",
0, SETCC, 0005, "setne",
0, SETCC, 0005, "setnz",
0, SETCC, 0006, "setbe",
0, SETCC, 0006, "setna",
0, SETCC, 0007, "seta",
0, SETCC, 0007, "setnbe",
0, SETCC, 0010, "sets",
0, SETCC, 0011, "setns",
0, SETCC, 0012, "setp",
0, SETCC, 0012, "setpe",
0, SETCC, 0013, "setnp",
0, SETCC, 0013, "setpo",
0, SETCC, 0014, "setl",
0, SETCC, 0014, "setnge",
0, SETCC, 0015, "setge",
0, SETCC, 0015, "setnl",
0, SETCC, 0016, "setle",
0, SETCC, 0016, "setng",
0, SETCC, 0017, "setg",
0, SETCC, 0017, "setnle",
0, TEST, 0, "testb",
0, TEST, 1, "test",
0, XCHG, 0, "xchgb",
0, XCHG, 1, "xchg",