NASM 0.95
[platform/upstream/nasm.git] / names.c
1 /* names.c   included source file defining instruction and register
2  *           names for the Netwide [Dis]Assembler
3  *
4  * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
5  * Julian Hall. All rights reserved. The software is
6  * redistributable under the licence given in the file "Licence"
7  * distributed in the NASM archive.
8  */
9
10 static char *reg_names[] = {           /* register names, as strings */
11     "\0", "ah", "al", "ax", "bh", "bl", "bp", "bx", "ch", "cl",
12     "cr0", "cr2", "cr3", "cr4", "cs", "cx", "dh", "di", "dl", "dr0",
13     "dr1", "dr2", "dr3", "dr6", "dr7", "ds", "dx", "eax", "ebp",
14     "ebx", "ecx", "edi", "edx", "es", "esi", "esp", "fs", "gs",
15     "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", "si",
16     "sp", "ss", "st0", "st1", "st2", "st3", "st4", "st5", "st6",
17     "st7", "tr3", "tr4", "tr5", "tr6", "tr7"
18 };
19
20 static char *insn_names[] = {          /* instruction names, as strings */
21     "aaa", "aad", "aam", "aas", "adc", "add", "and", "arpl",
22     "bound", "bsf", "bsr", "bswap", "bt", "btc", "btr", "bts",
23     "call", "cbw", "cdq", "clc", "cld", "cli", "clts", "cmc", "cmp",
24     "cmpsb", "cmpsd", "cmpsw", "cmpxchg", "cmpxchg486", "cmpxchg8b",
25     "cpuid", "cwd", "cwde", "daa", "das", "db", "dd", "dec", "div",
26     "dq", "dt", "dw", "emms", "enter", "equ", "f2xm1", "fabs",
27     "fadd", "faddp", "fbld", "fbstp", "fchs", "fclex", "fcmovb",
28     "fcmovbe", "fcmove", "fcmovnb", "fcmovnbe", "fcmovne",
29     "fcmovnu", "fcmovu", "fcom", "fcomi", "fcomip", "fcomp",
30     "fcompp", "fcos", "fdecstp", "fdisi", "fdiv", "fdivp", "fdivr",
31     "fdivrp", "feni", "ffree", "fiadd", "ficom", "ficomp", "fidiv",
32     "fidivr", "fild", "fimul", "fincstp", "finit", "fist", "fistp",
33     "fisub", "fisubr", "fld", "fld1", "fldcw", "fldenv", "fldl2e",
34     "fldl2t", "fldlg2", "fldln2", "fldpi", "fldz", "fmul", "fmulp",
35     "fnop", "fpatan", "fprem", "fprem1", "fptan", "frndint",
36     "frstor", "fsave", "fscale", "fsetpm", "fsin", "fsincos",
37     "fsqrt", "fst", "fstcw", "fstenv", "fstp", "fstsw", "fsub",
38     "fsubp", "fsubr", "fsubrp", "ftst", "fucom", "fucomi",
39     "fucomip", "fucomp", "fucompp", "fxam", "fxch", "fxtract",
40     "fyl2x", "fyl2xp1", "hlt", "ibts", "icebp", "idiv", "imul",
41     "in", "inc", "incbin", "insb", "insd", "insw", "int", "int1",
42     "int01", "int3", "into", "invd", "invlpg", "iret", "iretd",
43     "iretw", "jcxz", "jecxz", "jmp", "lahf", "lar", "lds", "lea",
44     "leave", "les", "lfs", "lgdt", "lgs", "lidt", "lldt", "lmsw",
45     "loadall", "loadall286", "lodsb", "lodsd", "lodsw", "loop",
46     "loope", "loopne", "loopnz", "loopz", "lsl", "lss", "ltr",
47     "mov", "movd", "movq", "movsb", "movsd", "movsw", "movsx",
48     "movzx", "mul", "neg", "nop", "not", "or", "out", "outsb",
49     "outsd", "outsw", "packssdw", "packsswb", "packuswb", "paddb",
50     "paddd", "paddsb", "paddsw", "paddusb", "paddusw", "paddw",
51     "pand", "pandn", "pcmpeqb", "pcmpeqd", "pcmpeqw", "pcmpgtb",
52     "pcmpgtd", "pcmpgtw", "pmaddwd", "pmulhw", "pmullw", "pop",
53     "popa", "popad", "popaw", "popf", "popfd", "popfw", "por",
54     "pslld", "psllq", "psllw", "psrad", "psraw", "psrld", "psrlq",
55     "psrlw", "psubb", "psubd", "psubsb", "psubsw", "psubusb",
56     "psubusw", "psubw", "punpckhbw", "punpckhdq", "punpckhwd",
57     "punpcklbw", "punpckldq", "punpcklwd", "push", "pusha",
58     "pushad", "pushaw", "pushf", "pushfd", "pushfw", "pxor", "rcl",
59     "rcr", "rdmsr", "rdpmc", "rdtsc", "resb", "resd", "resq",
60     "rest", "resw", "ret", "retf", "retn", "rol", "ror", "rsm",
61     "sahf", "sal", "salc", "sar", "sbb", "scasb", "scasd", "scasw",
62     "sgdt", "shl", "shld", "shr", "shrd", "sidt", "sldt", "smi",
63     "smsw", "stc", "std", "sti", "stosb", "stosd", "stosw", "str",
64     "sub", "test", "umov", "verr", "verw", "wait", "wbinvd",
65     "wrmsr", "xadd", "xbts", "xchg", "xlatb", "xor"
66 };
67
68 static char *icn[] = {                 /* conditional instructions */
69     "cmov", "j", "set"
70 };
71
72 static int ico[] = {                   /* and the corresponding opcodes */
73     I_CMOVcc, I_Jcc, I_SETcc
74 };
75
76 static char *conditions[] = {          /* condition code names */
77     "a", "ae", "b", "be", "c", "e", "g", "ge", "l", "le", "na", "nae",
78     "nb", "nbe", "nc", "ne", "ng", "nge", "nl", "nle", "no", "np",
79     "ns", "nz", "o", "p", "pe", "po", "s", "z"
80 };