summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-08-08 10:58:50 +0000
committertg <tg@FreeBSD.org>2001-08-08 10:58:50 +0000
commit6348c039baa1f511ba2ac6fdaa35a20dc70660a0 (patch)
tree4d66598b3d4764d3b099fb706b641b607fb600c2 /usr.bin
parent2143008ac012ce21897ff583fc00d6fd7691f90d (diff)
downloadFreeBSD-src-6348c039baa1f511ba2ac6fdaa35a20dc70660a0.zip
FreeBSD-src-6348c039baa1f511ba2ac6fdaa35a20dc70660a0.tar.gz
Silence some more warnings, mostly from `-W -Wwrite-strings'.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/doscmd/callback.c4
-rw-r--r--usr.bin/doscmd/callback.h14
-rw-r--r--usr.bin/doscmd/cwd.c2
-rw-r--r--usr.bin/doscmd/debug.c8
-rw-r--r--usr.bin/doscmd/dos.c8
-rw-r--r--usr.bin/doscmd/dos.h2
-rw-r--r--usr.bin/doscmd/doscmd.12
-rw-r--r--usr.bin/doscmd/doscmd.c12
-rw-r--r--usr.bin/doscmd/doscmd.h7
-rw-r--r--usr.bin/doscmd/ems.c21
-rw-r--r--usr.bin/doscmd/i386-pinsn.c1309
-rw-r--r--usr.bin/doscmd/int14.c4
-rw-r--r--usr.bin/doscmd/intff.c5
-rw-r--r--usr.bin/doscmd/trace.c13
-rw-r--r--usr.bin/doscmd/tty.c2
-rw-r--r--usr.bin/doscmd/tty.h2
-rw-r--r--usr.bin/doscmd/video.h2
-rw-r--r--usr.bin/doscmd/xms.c10
18 files changed, 778 insertions, 649 deletions
diff --git a/usr.bin/doscmd/callback.c b/usr.bin/doscmd/callback.c
index b495788..0e36d08 100644
--- a/usr.bin/doscmd/callback.c
+++ b/usr.bin/doscmd/callback.c
@@ -16,7 +16,7 @@ struct callback {
LIST_ENTRY(callback) chain;
u_long vec;
callback_t func;
- char *name;
+ const char *name;
};
LIST_HEAD(cbhead , callback) cbhead[127];
@@ -27,7 +27,7 @@ LIST_HEAD(cbhead , callback) cbhead[127];
** Register (func) as a handler for (vec)
*/
void
-register_callback(u_long vec, callback_t func, char *name)
+register_callback(u_long vec, callback_t func, const char *name)
{
struct cbhead *head;
struct callback *elm;
diff --git a/usr.bin/doscmd/callback.h b/usr.bin/doscmd/callback.h
index d3c656f..b1ab3d7 100644
--- a/usr.bin/doscmd/callback.h
+++ b/usr.bin/doscmd/callback.h
@@ -3,11 +3,11 @@
**
** $FreeBSD$
*/
-typedef void (*callback_t)(regcontext_t *REGS);
+typedef void (*callback_t)(regcontext_t *);
-extern void register_callback(u_long vec, callback_t func, char *name);
-extern callback_t find_callback(u_long vec);
-extern u_long insert_generic_trampoline(size_t len, u_char *p);
-extern u_long insert_softint_trampoline(void);
-extern u_long insert_hardint_trampoline(void);
-extern u_long insert_null_trampoline(void);
+void register_callback(u_long, callback_t, const char *);
+callback_t find_callback(u_long);
+u_long insert_generic_trampoline(size_t, u_char *);
+u_long insert_softint_trampoline(void);
+u_long insert_hardint_trampoline(void);
+u_long insert_null_trampoline(void);
diff --git a/usr.bin/doscmd/cwd.c b/usr.bin/doscmd/cwd.c
index 1a1f7a2..85269b9 100644
--- a/usr.bin/doscmd/cwd.c
+++ b/usr.bin/doscmd/cwd.c
@@ -835,7 +835,7 @@ to_dos_fcb(u_char *p, u_char *expr)
** We allocate a single search structure, and recycle it if find_first()
** is called before a search ends.
*/
-static search_t dir_search = {dp : NULL};
+static search_t dir_search;
/*
* Find the first file on drive which matches the path with the given
diff --git a/usr.bin/doscmd/debug.c b/usr.bin/doscmd/debug.c
index 16c5419..b68f690 100644
--- a/usr.bin/doscmd/debug.c
+++ b/usr.bin/doscmd/debug.c
@@ -81,13 +81,13 @@ debug_isset(int x)
** debugging mode.
*/
void
-debug (int flags, char *fmt, ...)
+debug(int flags, const char *fmt, ...)
{
va_list args;
if (flags & (debug_flags & ~0xff)) {
if ((debug_flags & 0xff) == 0
- && (flags & (D_ITRAPS|D_TRAPS))
+ && (flags & (D_ITRAPS | D_TRAPS))
&& !debug_isset(flags & 0xff))
return;
va_start (args, fmt);
@@ -100,7 +100,7 @@ debug (int flags, char *fmt, ...)
** Emit a terminal error message and exit
*/
void
-fatal (char *fmt, ...)
+fatal(const char *fmt, ...)
{
va_list args;
@@ -108,7 +108,7 @@ fatal (char *fmt, ...)
if (xmode) {
char buf[1024];
- char *m;
+ const char *m;
va_start (args, fmt);
vfprintf (debugf, fmt, args);
diff --git a/usr.bin/doscmd/dos.c b/usr.bin/doscmd/dos.c
index 5c6904b..975c3b8 100644
--- a/usr.bin/doscmd/dos.c
+++ b/usr.bin/doscmd/dos.c
@@ -309,9 +309,9 @@ static u_char magic[0x7e] = {
0x0f, 0x0f, 0x0f, 0x0f, 0x04, 0x0f,
};
-#define isvalid(x) ((magic[x] & 0x01) != 0)
-#define issep(x) ((magic[x] & 0x02) == 0)
-#define iswhite(x) ((magic[x] & 0x04) == 0)
+#define isvalid(x) ((magic[(int)(x)] & 0x01) != 0)
+#define issep(x) ((magic[(int)(x)] & 0x02) == 0)
+#define iswhite(x) ((magic[(int)(x)] & 0x04) == 0)
static char *
skipwhite(char *p)
@@ -2429,7 +2429,7 @@ static struct intfunc_table int21_table [] = {
static int int21_fastlookup[256];
-char *dos_return[] = {
+const char *dos_return[] = {
"OK",
"FUNC_NUM_IVALID",
"FILE_NOT_FOUND",
diff --git a/usr.bin/doscmd/dos.h b/usr.bin/doscmd/dos.h
index 561457c..cc770f7 100644
--- a/usr.bin/doscmd/dos.h
+++ b/usr.bin/doscmd/dos.h
@@ -374,7 +374,7 @@ to_dos_attr(int mode)
/* prototypes */
-extern char *dos_return[]; /* names of DOS return codes */
+extern const char *dos_return[]; /* names of DOS return codes */
extern const int dos_ret_size; /* length of above */
extern char *InDOS;
extern int diskdrive; /* current drive */
diff --git a/usr.bin/doscmd/doscmd.1 b/usr.bin/doscmd/doscmd.1
index 34f0215..5ec1a01 100644
--- a/usr.bin/doscmd/doscmd.1
+++ b/usr.bin/doscmd/doscmd.1
@@ -443,7 +443,7 @@ only refers to part of a disk.
Assign the tty or pty specified by
.Ar path
to be used as the specified com port.
-It's base address will be emulated at
+Its base address will be emulated at
.Ar port
at interrupt specified by
.Ar irq .
diff --git a/usr.bin/doscmd/doscmd.c b/usr.bin/doscmd/doscmd.c
index 43a71b8..3bc58f6 100644
--- a/usr.bin/doscmd/doscmd.c
+++ b/usr.bin/doscmd/doscmd.c
@@ -96,7 +96,7 @@ static int open_name(char *name, char *ext);
static int zflag = 0;
/* DOS environment emulation */
-static int ecnt = 0;
+static unsigned ecnt = 0;
static char *envs[256];
/* Search path and command name */
@@ -377,10 +377,10 @@ setup_command(int argc, char *argv[], regcontext_t *REGS)
{
FILE *fp;
u_short param[7] = {0, 0, 0, 0, 0, 0, 0};
- char *p;
+ const char *p;
char prog[1024];
char buffer[PATH_MAX];
- int i;
+ unsigned i;
int fd;
fp = find_doscmdrc(); /* dig up a doscmdrc */
@@ -776,7 +776,7 @@ open_prog(char *name)
** append a value to the DOS environment
*/
void
-put_dosenv(char *value)
+put_dosenv(const char *value)
{
if (ecnt < sizeof(envs)/sizeof(envs[0])) {
if ((envs[ecnt++] = strdup(value)) == NULL) {
@@ -819,11 +819,11 @@ squirrel_fd(int fd)
** XXX belongs somewhere else perhaps
*/
void
-done (regcontext_t *REGS, int val)
+done(regcontext_t *REGS, int val)
{
if (curpsp < 2) {
if (xmode) {
- char *m;
+ const char *m;
tty_move(24, 0);
for (m = "END OF PROGRAM"; *m; ++m)
diff --git a/usr.bin/doscmd/doscmd.h b/usr.bin/doscmd/doscmd.h
index 46dafa7..2269708 100644
--- a/usr.bin/doscmd/doscmd.h
+++ b/usr.bin/doscmd/doscmd.h
@@ -160,8 +160,8 @@ extern int debug_flags;
void unknown_int2(int, int, regcontext_t *);
void unknown_int3(int, int, int, regcontext_t *);
void unknown_int4(int, int, int, int, regcontext_t *);
-void fatal(char *, ...) __printflike(1, 2);
-void debug(int, char *, ...) __printflike(2, 3);
+void fatal(const char *, ...) __printflike(1, 2);
+void debug(int, const char *, ...) __printflike(2, 3);
void dump_regs(regcontext_t *);
void debug_set(int);
void debug_unset(int);
@@ -186,6 +186,7 @@ void call_on_quit(void (*)(void *), void *);
void done(regcontext_t *, int);
void iomap_port(int, int);
int open_prog(char *);
+void put_dosenv(const char *);
void quit(int);
int squirrel_fd(int);
@@ -305,5 +306,3 @@ extern u_long pending[]; /* pending interrupts */
extern int n_pending;
extern int nmice;
-
-void put_dosenv(char *value);
diff --git a/usr.bin/doscmd/ems.c b/usr.bin/doscmd/ems.c
index db16bc6..a27f23a 100644
--- a/usr.bin/doscmd/ems.c
+++ b/usr.bin/doscmd/ems.c
@@ -141,7 +141,7 @@ static u_long move_ems_to_ems(u_short, u_short, u_short, u_short,
int
ems_init()
{
- int i;
+ unsigned i;
if (ems_max_size == 0)
return 0;
@@ -400,7 +400,7 @@ ems_entry(regcontext_t *REGS)
case GET_PAGES_FOR_ALL:
{
EMShandlepage *ehp;
- int safecount;
+ unsigned safecount;
int i;
debug(D_EMS, "EMS: Get pages for all\n");
@@ -417,7 +417,8 @@ ems_entry(regcontext_t *REGS)
for (i = 0; i < 255; i++) {
if (ems_handle[i] != NULL) {
if (safecount > (ems_alloc_handles+1))
- fatal("EMS: ems_alloc_handles is wrong, cannot continue\n");
+ fatal("EMS: ems_alloc_handles is wrong, "
+ "cannot continue\n");
ehp->handle = i;
ehp->npages = ems_handle[i]->npages;
ehp++;
@@ -1121,7 +1122,7 @@ init_mapfile()
if (mmap((caddr_t)ems_frame_addr, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_ANON | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- -1, 0) < 0) {
+ -1, 0) == MAP_FAILED) {
debug(D_ALWAYS, "Could not map EMS page frame, ");
goto fail;
}
@@ -1169,14 +1170,14 @@ map_page(u_long pagenum, u_char position, short handle, int unmaponly)
if (mmap((caddr_t)ems_frame_addr, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_ANON | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- -1, 0) < 0)
+ -1, 0) == MAP_FAILED)
fatal("Could not map EMS page frame during unmap only\n");
return;
}
if (mmap(map_addr, len,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_FILE | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- mapfile_fd, file_offs) < 0) {
+ mapfile_fd, file_offs) == MAP_FAILED) {
fatal("EMS mapping error: %s\nCannot recover\n", strerror(errno));
}
ems_mapping_context.pos_mapped[position] = 1;
@@ -1297,7 +1298,7 @@ free_handle(short handle)
static void
allocate_pages_to_handle(u_short handle, long npages)
{
- int syspagenum;
+ unsigned syspagenum;
int pages_to_alloc = npages;
int allocpagenum = 0;
@@ -1330,9 +1331,9 @@ allocate_pages_to_handle(u_short handle, long npages)
static void
reallocate_pages_to_handle(u_short handle, long npages)
{
- int syspagenum;
+ unsigned allocpagenum;
+ unsigned syspagenum;
int pages_to_alloc;
- int allocpagenum;
long delta;
size_t dynsize;
EMS_handle *emp;
@@ -1406,7 +1407,7 @@ static void
free_pages_of_handle(short handle)
{
int allocpagenum;
- int syspagenum;
+ unsigned syspagenum;
int npages;
/* sanity */
diff --git a/usr.bin/doscmd/i386-pinsn.c b/usr.bin/doscmd/i386-pinsn.c
index afb29d7..5a7eff7 100644
--- a/usr.bin/doscmd/i386-pinsn.c
+++ b/usr.bin/doscmd/i386-pinsn.c
@@ -50,8 +50,8 @@ static void append_prefix(void);
static void dofloat(void);
static int get16(void);
static int get32(void);
-static void oappend(char *);
-static void putop(char *);
+static void oappend(const char *);
+static void putop(const char *);
#define Eb OP_E, b_mode
#define indirEb OP_indirE, b_mode
@@ -67,7 +67,7 @@ static void putop(char *);
#define Rw OP_rm, w_mode
#define Rd OP_rm, d_mode
#define Ib OP_I, b_mode
-#define sIb OP_sI, b_mode /* sign extened byte */
+#define sIb OP_sI, b_mode /* sign extended byte */
#define Iv OP_I, v_mode
#define Iw OP_I, w_mode
#define Jb OP_J, b_mode
@@ -155,28 +155,30 @@ static void putop(char *);
#define indir_dx_reg 150
-#define GRP1b NULL, NULL, 0
-#define GRP1S NULL, NULL, 1
-#define GRP1Ss NULL, NULL, 2
-#define GRP2b NULL, NULL, 3
-#define GRP2S NULL, NULL, 4
-#define GRP2b_one NULL, NULL, 5
-#define GRP2S_one NULL, NULL, 6
-#define GRP2b_cl NULL, NULL, 7
-#define GRP2S_cl NULL, NULL, 8
-#define GRP3b NULL, NULL, 9
-#define GRP3S NULL, NULL, 10
-#define GRP4 NULL, NULL, 11
-#define GRP5 NULL, NULL, 12
-#define GRP6 NULL, NULL, 13
-#define GRP7 NULL, NULL, 14
-#define GRP8 NULL, NULL, 15
+#define NOFUNC NULL, 0
+
+#define GRP1b NULL, NULL, 0, NOFUNC, NOFUNC
+#define GRP1S NULL, NULL, 1, NOFUNC, NOFUNC
+#define GRP1Ss NULL, NULL, 2, NOFUNC, NOFUNC
+#define GRP2b NULL, NULL, 3, NOFUNC, NOFUNC
+#define GRP2S NULL, NULL, 4, NOFUNC, NOFUNC
+#define GRP2b_one NULL, NULL, 5, NOFUNC, NOFUNC
+#define GRP2S_one NULL, NULL, 6, NOFUNC, NOFUNC
+#define GRP2b_cl NULL, NULL, 7, NOFUNC, NOFUNC
+#define GRP2S_cl NULL, NULL, 8, NOFUNC, NOFUNC
+#define GRP3b NULL, NULL, 9, NOFUNC, NOFUNC
+#define GRP3S NULL, NULL, 10, NOFUNC, NOFUNC
+#define GRP4 NULL, NULL, 11, NOFUNC, NOFUNC
+#define GRP5 NULL, NULL, 12, NOFUNC, NOFUNC
+#define GRP6 NULL, NULL, 13, NOFUNC, NOFUNC
+#define GRP7 NULL, NULL, 14, NOFUNC, NOFUNC
+#define GRP8 NULL, NULL, 15, NOFUNC, NOFUNC
#define FLOATCODE 50
-#define FLOAT NULL, NULL, FLOATCODE
+#define FLOAT NULL, NULL, FLOATCODE, NOFUNC, NOFUNC
struct dis386 {
- char *name;
+ const char *name;
void (*op1)(int);
int bytemode1;
void (*op2)(int);
@@ -187,248 +189,248 @@ struct dis386 {
struct dis386 dis386[] = {
/* 00 */
- { "addb", Eb, Gb },
- { "addS", Ev, Gv },
- { "addb", Gb, Eb },
- { "addS", Gv, Ev },
- { "addb", AL, Ib },
- { "addS", eAX, Iv },
- { "pushl", es },
- { "popl", es },
+ { "addb", Eb, Gb, NOFUNC },
+ { "addS", Ev, Gv, NOFUNC },
+ { "addb", Gb, Eb, NOFUNC },
+ { "addS", Gv, Ev, NOFUNC },
+ { "addb", AL, Ib, NOFUNC },
+ { "addS", eAX, Iv, NOFUNC },
+ { "pushl", es, NOFUNC, NOFUNC },
+ { "popl", es, NOFUNC, NOFUNC },
/* 08 */
- { "orb", Eb, Gb },
- { "orS", Ev, Gv },
- { "orb", Gb, Eb },
- { "orS", Gv, Ev },
- { "orb", AL, Ib },
- { "orS", eAX, Iv },
- { "pushl", cs },
- { "(bad)" }, /* 0x0f extended opcode escape */
+ { "orb", Eb, Gb, NOFUNC },
+ { "orS", Ev, Gv, NOFUNC },
+ { "orb", Gb, Eb, NOFUNC },
+ { "orS", Gv, Ev, NOFUNC },
+ { "orb", AL, Ib, NOFUNC },
+ { "orS", eAX, Iv, NOFUNC },
+ { "pushl", cs, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* extended opcode escape */
/* 10 */
- { "adcb", Eb, Gb },
- { "adcS", Ev, Gv },
- { "adcb", Gb, Eb },
- { "adcS", Gv, Ev },
- { "adcb", AL, Ib },
- { "adcS", eAX, Iv },
- { "pushl", ss },
- { "popl", ss },
+ { "adcb", Eb, Gb, NOFUNC },
+ { "adcS", Ev, Gv, NOFUNC },
+ { "adcb", Gb, Eb, NOFUNC },
+ { "adcS", Gv, Ev, NOFUNC },
+ { "adcb", AL, Ib, NOFUNC },
+ { "adcS", eAX, Iv, NOFUNC },
+ { "pushl", ss, NOFUNC, NOFUNC },
+ { "popl", ss, NOFUNC, NOFUNC },
/* 18 */
- { "sbbb", Eb, Gb },
- { "sbbS", Ev, Gv },
- { "sbbb", Gb, Eb },
- { "sbbS", Gv, Ev },
- { "sbbb", AL, Ib },
- { "sbbS", eAX, Iv },
- { "pushl", ds },
- { "popl", ds },
+ { "sbbb", Eb, Gb, NOFUNC },
+ { "sbbS", Ev, Gv, NOFUNC },
+ { "sbbb", Gb, Eb, NOFUNC },
+ { "sbbS", Gv, Ev, NOFUNC },
+ { "sbbb", AL, Ib, NOFUNC },
+ { "sbbS", eAX, Iv, NOFUNC },
+ { "pushl", ds, NOFUNC, NOFUNC },
+ { "popl", ds, NOFUNC, NOFUNC },
/* 20 */
- { "andb", Eb, Gb },
- { "andS", Ev, Gv },
- { "andb", Gb, Eb },
- { "andS", Gv, Ev },
- { "andb", AL, Ib },
- { "andS", eAX, Iv },
- { "(bad)" }, /* SEG ES prefix */
- { "daa" },
+ { "andb", Eb, Gb, NOFUNC },
+ { "andS", Ev, Gv, NOFUNC },
+ { "andb", Gb, Eb, NOFUNC },
+ { "andS", Gv, Ev, NOFUNC },
+ { "andb", AL, Ib, NOFUNC },
+ { "andS", eAX, Iv, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC}, /* SEG ES prefix */
+ { "daa", NOFUNC, NOFUNC, NOFUNC },
/* 28 */
- { "subb", Eb, Gb },
- { "subS", Ev, Gv },
- { "subb", Gb, Eb },
- { "subS", Gv, Ev },
- { "subb", AL, Ib },
- { "subS", eAX, Iv },
- { "(bad)" }, /* SEG CS prefix */
- { "das" },
+ { "subb", Eb, Gb, NOFUNC },
+ { "subS", Ev, Gv, NOFUNC },
+ { "subb", Gb, Eb, NOFUNC },
+ { "subS", Gv, Ev, NOFUNC },
+ { "subb", AL, Ib, NOFUNC },
+ { "subS", eAX, Iv, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* SEG CS prefix */
+ { "das", NOFUNC, NOFUNC, NOFUNC },
/* 30 */
- { "xorb", Eb, Gb },
- { "xorS", Ev, Gv },
- { "xorb", Gb, Eb },
- { "xorS", Gv, Ev },
- { "xorb", AL, Ib },
- { "xorS", eAX, Iv },
- { "(bad)" }, /* SEG SS prefix */
- { "aaa" },
+ { "xorb", Eb, Gb, NOFUNC },
+ { "xorS", Ev, Gv, NOFUNC },
+ { "xorb", Gb, Eb, NOFUNC },
+ { "xorS", Gv, Ev, NOFUNC },
+ { "xorb", AL, Ib, NOFUNC },
+ { "xorS", eAX, Iv, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* SEG SS prefix */
+ { "aaa", NOFUNC, NOFUNC, NOFUNC },
/* 38 */
- { "cmpb", Eb, Gb },
- { "cmpS", Ev, Gv },
- { "cmpb", Gb, Eb },
- { "cmpS", Gv, Ev },
- { "cmpb", AL, Ib },
- { "cmpS", eAX, Iv },
- { "(bad)" }, /* SEG DS prefix */
- { "aas" },
+ { "cmpb", Eb, Gb, NOFUNC },
+ { "cmpS", Ev, Gv, NOFUNC },
+ { "cmpb", Gb, Eb, NOFUNC },
+ { "cmpS", Gv, Ev, NOFUNC },
+ { "cmpb", AL, Ib, NOFUNC },
+ { "cmpS", eAX, Iv, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* SEG DS prefix */
+ { "aas", NOFUNC, NOFUNC, NOFUNC },
/* 40 */
- { "incS", eAX },
- { "incS", eCX },
- { "incS", eDX },
- { "incS", eBX },
- { "incS", eSP },
- { "incS", eBP },
- { "incS", eSI },
- { "incS", eDI },
+ { "incS", eAX, NOFUNC, NOFUNC },
+ { "incS", eCX, NOFUNC, NOFUNC },
+ { "incS", eDX, NOFUNC, NOFUNC },
+ { "incS", eBX, NOFUNC, NOFUNC },
+ { "incS", eSP, NOFUNC, NOFUNC },
+ { "incS", eBP, NOFUNC, NOFUNC },
+ { "incS", eSI, NOFUNC, NOFUNC },
+ { "incS", eDI, NOFUNC, NOFUNC },
/* 48 */
- { "decS", eAX },
- { "decS", eCX },
- { "decS", eDX },
- { "decS", eBX },
- { "decS", eSP },
- { "decS", eBP },
- { "decS", eSI },
- { "decS", eDI },
+ { "decS", eAX, NOFUNC, NOFUNC },
+ { "decS", eCX, NOFUNC, NOFUNC },
+ { "decS", eDX, NOFUNC, NOFUNC },
+ { "decS", eBX, NOFUNC, NOFUNC },
+ { "decS", eSP, NOFUNC, NOFUNC },
+ { "decS", eBP, NOFUNC, NOFUNC },
+ { "decS", eSI, NOFUNC, NOFUNC },
+ { "decS", eDI, NOFUNC, NOFUNC },
/* 50 */
- { "pushS", eAX },
- { "pushS", eCX },
- { "pushS", eDX },
- { "pushS", eBX },
- { "pushS", eSP },
- { "pushS", eBP },
- { "pushS", eSI },
- { "pushS", eDI },
+ { "pushS", eAX, NOFUNC, NOFUNC },
+ { "pushS", eCX, NOFUNC, NOFUNC },
+ { "pushS", eDX, NOFUNC, NOFUNC },
+ { "pushS", eBX, NOFUNC, NOFUNC },
+ { "pushS", eSP, NOFUNC, NOFUNC },
+ { "pushS", eBP, NOFUNC, NOFUNC },
+ { "pushS", eSI, NOFUNC, NOFUNC },
+ { "pushS", eDI, NOFUNC, NOFUNC },
/* 58 */
- { "popS", eAX },
- { "popS", eCX },
- { "popS", eDX },
- { "popS", eBX },
- { "popS", eSP },
- { "popS", eBP },
- { "popS", eSI },
- { "popS", eDI },
+ { "popS", eAX, NOFUNC, NOFUNC },
+ { "popS", eCX, NOFUNC, NOFUNC },
+ { "popS", eDX, NOFUNC, NOFUNC },
+ { "popS", eBX, NOFUNC, NOFUNC },
+ { "popS", eSP, NOFUNC, NOFUNC },
+ { "popS", eBP, NOFUNC, NOFUNC },
+ { "popS", eSI, NOFUNC, NOFUNC },
+ { "popS", eDI, NOFUNC, NOFUNC },
/* 60 */
- { "pusha" },
- { "popa" },
- { "boundS", Gv, Ma },
- { "arpl", Ew, Gw },
- { "(bad)" }, /* seg fs */
- { "(bad)" }, /* seg gs */
- { "(bad)" }, /* op size prefix */
- { "(bad)" }, /* adr size prefix */
+ { "pusha", NOFUNC, NOFUNC, NOFUNC },
+ { "popa", NOFUNC, NOFUNC, NOFUNC },
+ { "boundS", Gv, Ma, NOFUNC },
+ { "arpl", Ew, Gw, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* seg fs */
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* seg gs */
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* op size prefix */
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* adr size prefix */
/* 68 */
- { "pushS", Iv }, /* 386 book wrong */
+ { "pushS", Iv, NOFUNC, NOFUNC }, /* 386 book wrong */
{ "imulS", Gv, Ev, Iv },
- { "pushl", sIb }, /* push of byte really pushes 4 bytes */
+ { "pushl", sIb, NOFUNC, NOFUNC }, /* push of byte really pushes 4 bytes */
{ "imulS", Gv, Ev, Ib },
- { "insb", Yb, indirDX },
- { "insS", Yv, indirDX },
- { "outsb", indirDX, Xb },
- { "outsS", indirDX, Xv },
+ { "insb", Yb, indirDX, NOFUNC },
+ { "insS", Yv, indirDX, NOFUNC },
+ { "outsb", indirDX, Xb, NOFUNC },
+ { "outsS", indirDX, Xv, NOFUNC },
/* 70 */
- { "jo", Jb },
- { "jno", Jb },
- { "jb", Jb },
- { "jae", Jb },
- { "je", Jb },
- { "jne", Jb },
- { "jbe", Jb },
- { "ja", Jb },
+ { "jo", Jb, NOFUNC, NOFUNC },
+ { "jno", Jb, NOFUNC, NOFUNC },
+ { "jb", Jb, NOFUNC, NOFUNC },
+ { "jae", Jb, NOFUNC, NOFUNC },
+ { "je", Jb, NOFUNC, NOFUNC },
+ { "jne", Jb, NOFUNC, NOFUNC },
+ { "jbe", Jb, NOFUNC, NOFUNC },
+ { "ja", Jb, NOFUNC, NOFUNC },
/* 78 */
- { "js", Jb },
- { "jns", Jb },
- { "jp", Jb },
- { "jnp", Jb },
- { "jl", Jb },
- { "jnl", Jb },
- { "jle", Jb },
- { "jg", Jb },
+ { "js", Jb, NOFUNC, NOFUNC },
+ { "jns", Jb, NOFUNC, NOFUNC },
+ { "jp", Jb, NOFUNC, NOFUNC },
+ { "jnp", Jb, NOFUNC, NOFUNC },
+ { "jl", Jb, NOFUNC, NOFUNC },
+ { "jnl", Jb, NOFUNC, NOFUNC },
+ { "jle", Jb, NOFUNC, NOFUNC },
+ { "jg", Jb, NOFUNC, NOFUNC },
/* 80 */
{ GRP1b },
{ GRP1S },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ GRP1Ss },
- { "testb", Eb, Gb },
- { "testS", Ev, Gv },
- { "xchgb", Eb, Gb },
- { "xchgS", Ev, Gv },
+ { "testb", Eb, Gb, NOFUNC },
+ { "testS", Ev, Gv, NOFUNC },
+ { "xchgb", Eb, Gb, NOFUNC },
+ { "xchgS", Ev, Gv, NOFUNC },
/* 88 */
- { "movb", Eb, Gb },
- { "movS", Ev, Gv },
- { "movb", Gb, Eb },
- { "movS", Gv, Ev },
- { "movw", Ew, Sw },
- { "leaS", Gv, M },
- { "movw", Sw, Ew },
- { "popS", Ev },
+ { "movb", Eb, Gb, NOFUNC },
+ { "movS", Ev, Gv, NOFUNC },
+ { "movb", Gb, Eb, NOFUNC },
+ { "movS", Gv, Ev, NOFUNC },
+ { "movw", Ew, Sw, NOFUNC },
+ { "leaS", Gv, M, NOFUNC },
+ { "movw", Sw, Ew, NOFUNC },
+ { "popS", Ev, NOFUNC, NOFUNC },
/* 90 */
- { "nop" },
- { "xchgS", eCX, eAX },
- { "xchgS", eDX, eAX },
- { "xchgS", eBX, eAX },
- { "xchgS", eSP, eAX },
- { "xchgS", eBP, eAX },
- { "xchgS", eSI, eAX },
- { "xchgS", eDI, eAX },
+ { "nop", NOFUNC, NOFUNC, NOFUNC },
+ { "xchgS", eCX, eAX, NOFUNC },
+ { "xchgS", eDX, eAX, NOFUNC },
+ { "xchgS", eBX, eAX, NOFUNC },
+ { "xchgS", eSP, eAX, NOFUNC },
+ { "xchgS", eBP, eAX, NOFUNC },
+ { "xchgS", eSI, eAX, NOFUNC },
+ { "xchgS", eDI, eAX, NOFUNC },
/* 98 */
- { "cwtl" },
- { "cltd" },
- { "lcall", Ap },
- { "(bad)" }, /* fwait */
- { "pushf" },
- { "popf" },
- { "sahf" },
- { "lahf" },
+ { "cwtl", NOFUNC, NOFUNC, NOFUNC },
+ { "cltd", NOFUNC, NOFUNC, NOFUNC },
+ { "lcall", Ap, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* fwait */
+ { "pushf", NOFUNC, NOFUNC, NOFUNC },
+ { "popf", NOFUNC, NOFUNC, NOFUNC },
+ { "sahf", NOFUNC, NOFUNC, NOFUNC },
+ { "lahf", NOFUNC, NOFUNC, NOFUNC },
/* a0 */
- { "movb", AL, Ob },
- { "movS", eAX, Ov },
- { "movb", Ob, AL },
- { "movS", Ov, eAX },
- { "movsb", Yb, Xb },
- { "movsS", Yv, Xv },
- { "cmpsb", Xb, Yb },
- { "cmpsS", Xv, Yv },
+ { "movb", AL, Ob, NOFUNC },
+ { "movS", eAX, Ov, NOFUNC },
+ { "movb", Ob, AL, NOFUNC },
+ { "movS", Ov, eAX, NOFUNC },
+ { "movsb", Yb, Xb, NOFUNC },
+ { "movsS", Yv, Xv, NOFUNC },
+ { "cmpsb", Xb, Yb, NOFUNC },
+ { "cmpsS", Xv, Yv, NOFUNC },
/* a8 */
- { "testb", AL, Ib },
- { "testS", eAX, Iv },
- { "stosb", Yb, AL },
- { "stosS", Yv, eAX },
- { "lodsb", AL, Xb },
- { "lodsS", eAX, Xv },
- { "scasb", AL, Yb },
- { "scasS", eAX, Yv },
+ { "testb", AL, Ib, NOFUNC },
+ { "testS", eAX, Iv, NOFUNC },
+ { "stosb", Yb, AL, NOFUNC },
+ { "stosS", Yv, eAX, NOFUNC },
+ { "lodsb", AL, Xb, NOFUNC },
+ { "lodsS", eAX, Xv, NOFUNC },
+ { "scasb", AL, Yb, NOFUNC },
+ { "scasS", eAX, Yv, NOFUNC },
/* b0 */
- { "movb", AL, Ib },
- { "movb", CL, Ib },
- { "movb", DL, Ib },
- { "movb", BL, Ib },
- { "movb", AH, Ib },
- { "movb", CH, Ib },
- { "movb", DH, Ib },
- { "movb", BH, Ib },
+ { "movb", AL, Ib, NOFUNC },
+ { "movb", CL, Ib, NOFUNC },
+ { "movb", DL, Ib, NOFUNC },
+ { "movb", BL, Ib, NOFUNC },
+ { "movb", AH, Ib, NOFUNC },
+ { "movb", CH, Ib, NOFUNC },
+ { "movb", DH, Ib, NOFUNC },
+ { "movb", BH, Ib, NOFUNC },
/* b8 */
- { "movS", eAX, Iv },
- { "movS", eCX, Iv },
- { "movS", eDX, Iv },
- { "movS", eBX, Iv },
- { "movS", eSP, Iv },
- { "movS", eBP, Iv },
- { "movS", eSI, Iv },
- { "movS", eDI, Iv },
+ { "movS", eAX, Iv, NOFUNC },
+ { "movS", eCX, Iv, NOFUNC },
+ { "movS", eDX, Iv, NOFUNC },
+ { "movS", eBX, Iv, NOFUNC },
+ { "movS", eSP, Iv, NOFUNC },
+ { "movS", eBP, Iv, NOFUNC },
+ { "movS", eSI, Iv, NOFUNC },
+ { "movS", eDI, Iv, NOFUNC },
/* c0 */
{ GRP2b },
{ GRP2S },
- { "ret", Iw },
- { "ret" },
- { "lesS", Gv, Mp },
- { "ldsS", Gv, Mp },
- { "movb", Eb, Ib },
- { "movS", Ev, Iv },
+ { "ret", Iw, NOFUNC, NOFUNC },
+ { "ret", NOFUNC, NOFUNC, NOFUNC },
+ { "lesS", Gv, Mp, NOFUNC },
+ { "ldsS", Gv, Mp, NOFUNC },
+ { "movb", Eb, Ib, NOFUNC },
+ { "movS", Ev, Iv, NOFUNC },
/* c8 */
- { "enter", Iw, Ib },
- { "leave" },
- { "lret", Iw },
- { "lret" },
- { "int3" },
- { "int", Ib },
- { "into" },
- { "iret" },
+ { "enter", Iw, Ib, NOFUNC },
+ { "leave", NOFUNC, NOFUNC, NOFUNC },
+ { "lret", Iw, NOFUNC, NOFUNC },
+ { "lret", NOFUNC, NOFUNC, NOFUNC },
+ { "int3", NOFUNC, NOFUNC, NOFUNC },
+ { "int", Ib, NOFUNC, NOFUNC },
+ { "into", NOFUNC, NOFUNC, NOFUNC },
+ { "iret", NOFUNC, NOFUNC, NOFUNC },
/* d0 */
{ GRP2b_one },
{ GRP2S_one },
{ GRP2b_cl },
{ GRP2S_cl },
- { "aam", Ib },
- { "aad", Ib },
- { "(bad)" },
- { "xlat" },
+ { "aam", Ib, NOFUNC, NOFUNC },
+ { "aad", Ib, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "xlat", NOFUNC, NOFUNC, NOFUNC },
/* d8 */
{ FLOAT },
{ FLOAT },
@@ -439,39 +441,39 @@ struct dis386 dis386[] = {
{ FLOAT },
{ FLOAT },
/* e0 */
- { "loopne", Jb },
- { "loope", Jb },
- { "loop", Jb },
- { "jCcxz", Jb },
- { "inb", AL, Ib },
- { "inS", eAX, Ib },
- { "outb", Ib, AL },
- { "outS", Ib, eAX },
+ { "loopne", Jb, NOFUNC, NOFUNC },
+ { "loope", Jb, NOFUNC, NOFUNC },
+ { "loop", Jb, NOFUNC, NOFUNC },
+ { "jCcxz", Jb, NOFUNC, NOFUNC },
+ { "inb", AL, Ib, NOFUNC },
+ { "inS", eAX, Ib, NOFUNC },
+ { "outb", Ib, AL, NOFUNC },
+ { "outS", Ib, eAX, NOFUNC },
/* e8 */
- { "call", Av },
- { "jmp", Jv },
- { "ljmp", Ap },
- { "jmp", Jb },
- { "inb", AL, indirDX },
- { "inS", eAX, indirDX },
- { "outb", indirDX, AL },
- { "outS", indirDX, eAX },
+ { "call", Av, NOFUNC, NOFUNC },
+ { "jmp", Jv, NOFUNC, NOFUNC },
+ { "ljmp", Ap, NOFUNC, NOFUNC },
+ { "jmp", Jb, NOFUNC, NOFUNC },
+ { "inb", AL, indirDX, NOFUNC },
+ { "inS", eAX, indirDX, NOFUNC },
+ { "outb", indirDX, AL, NOFUNC },
+ { "outS", indirDX, eAX, NOFUNC },
/* f0 */
- { "(bad)" }, /* lock prefix */
- { "(bad)" },
- { "(bad)" }, /* repne */
- { "(bad)" }, /* repz */
- { "hlt" },
- { "cmc" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* lock prefix */
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* repne */
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }, /* repz */
+ { "hlt", NOFUNC, NOFUNC, NOFUNC },
+ { "cmc", NOFUNC, NOFUNC, NOFUNC },
{ GRP3b },
{ GRP3S },
/* f8 */
- { "clc" },
- { "stc" },
- { "cli" },
- { "sti" },
- { "cld" },
- { "std" },
+ { "clc", NOFUNC, NOFUNC, NOFUNC },
+ { "stc", NOFUNC, NOFUNC, NOFUNC },
+ { "cli", NOFUNC, NOFUNC, NOFUNC },
+ { "sti", NOFUNC, NOFUNC, NOFUNC },
+ { "cld", NOFUNC, NOFUNC, NOFUNC },
+ { "std", NOFUNC, NOFUNC, NOFUNC },
{ GRP4 },
{ GRP5 },
};
@@ -480,160 +482,292 @@ struct dis386 dis386_twobyte[] = {
/* 00 */
{ GRP6 },
{ GRP7 },
- { "larS", Gv, Ew },
- { "lslS", Gv, Ew },
- { "(bad)" },
- { "(bad)" },
- { "clts" },
- { "(bad)" },
+ { "larS", Gv, Ew, NOFUNC },
+ { "lslS", Gv, Ew, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "clts", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 08 */
- { "invd" }, { "wbinvd" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "invd", NOFUNC, NOFUNC, NOFUNC },
+ { "wbinvd", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 10 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 18 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 20 */
/* these are all backward in appendix A of the intel book */
- { "movl", Rd, Cd },
- { "movl", Rd, Dd },
- { "movl", Cd, Rd },
- { "movl", Dd, Rd },
- { "movl", Rd, Td },
- { "(bad)" },
- { "movl", Td, Rd },
- { "(bad)" },
+ { "movl", Rd, Cd, NOFUNC },
+ { "movl", Rd, Dd, NOFUNC },
+ { "movl", Cd, Rd, NOFUNC },
+ { "movl", Dd, Rd, NOFUNC },
+ { "movl", Rd, Td, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "movl", Td, Rd, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 28 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 30 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 38 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 40 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 48 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 50 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 58 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 60 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 68 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 70 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 78 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* 80 */
- { "jo", Jv },
- { "jno", Jv },
- { "jb", Jv },
- { "jae", Jv },
- { "je", Jv },
- { "jne", Jv },
- { "jbe", Jv },
- { "ja", Jv },
+ { "jo", Jv, NOFUNC, NOFUNC },
+ { "jno", Jv, NOFUNC, NOFUNC },
+ { "jb", Jv, NOFUNC, NOFUNC },
+ { "jae", Jv, NOFUNC, NOFUNC },
+ { "je", Jv, NOFUNC, NOFUNC },
+ { "jne", Jv, NOFUNC, NOFUNC },
+ { "jbe", Jv, NOFUNC, NOFUNC },
+ { "ja", Jv, NOFUNC, NOFUNC },
/* 88 */
- { "js", Jv },
- { "jns", Jv },
- { "jp", Jv },
- { "jnp", Jv },
- { "jl", Jv },
- { "jge", Jv },
- { "jle", Jv },
- { "jg", Jv },
+ { "js", Jv, NOFUNC, NOFUNC },
+ { "jns", Jv, NOFUNC, NOFUNC },
+ { "jp", Jv, NOFUNC, NOFUNC },
+ { "jnp", Jv, NOFUNC, NOFUNC },
+ { "jl", Jv, NOFUNC, NOFUNC },
+ { "jge", Jv, NOFUNC, NOFUNC },
+ { "jle", Jv, NOFUNC, NOFUNC },
+ { "jg", Jv, NOFUNC, NOFUNC },
/* 90 */
- { "seto", Eb },
- { "setno", Eb },
- { "setb", Eb },
- { "setae", Eb },
- { "sete", Eb },
- { "setne", Eb },
- { "setbe", Eb },
- { "seta", Eb },
+ { "seto", Eb, NOFUNC, NOFUNC },
+ { "setno", Eb, NOFUNC, NOFUNC },
+ { "setb", Eb, NOFUNC, NOFUNC },
+ { "setae", Eb, NOFUNC, NOFUNC },
+ { "sete", Eb, NOFUNC, NOFUNC },
+ { "setne", Eb, NOFUNC, NOFUNC },
+ { "setbe", Eb, NOFUNC, NOFUNC },
+ { "seta", Eb, NOFUNC, NOFUNC },
/* 98 */
- { "sets", Eb },
- { "setns", Eb },
- { "setp", Eb },
- { "setnp", Eb },
- { "setl", Eb },
- { "setge", Eb },
- { "setle", Eb },
- { "setg", Eb },
+ { "sets", Eb, NOFUNC, NOFUNC },
+ { "setns", Eb, NOFUNC, NOFUNC },
+ { "setp", Eb, NOFUNC, NOFUNC },
+ { "setnp", Eb, NOFUNC, NOFUNC },
+ { "setl", Eb, NOFUNC, NOFUNC },
+ { "setge", Eb, NOFUNC, NOFUNC },
+ { "setle", Eb, NOFUNC, NOFUNC },
+ { "setg", Eb, NOFUNC, NOFUNC },
/* a0 */
- { "pushl", fs },
- { "popl", fs },
- { "(bad)" },
- { "btS", Ev, Gv },
- { "shldS", Ev, Gv, Ib },
- { "shldS", Ev, Gv, CL },
- { "(bad)" },
- { "(bad)" },
+ { "pushl", fs, NOFUNC, NOFUNC },
+ { "popl", fs, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "btS", Ev, Gv, NOFUNC },
+ { "shldS", Ev, Gv, Ib },
+ { "shldS", Ev, Gv, CL },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* a8 */
- { "pushl", gs },
- { "popl", gs },
- { "(bad)" },
- { "btsS", Ev, Gv },
- { "shrdS", Ev, Gv, Ib },
- { "shrdS", Ev, Gv, CL },
- { "(bad)" },
- { "imulS", Gv, Ev },
+ { "pushl", gs, NOFUNC, NOFUNC },
+ { "popl", gs, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "btsS", Ev, Gv, NOFUNC },
+ { "shrdS", Ev, Gv, Ib },
+ { "shrdS", Ev, Gv, CL },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "imulS", Gv, Ev, NOFUNC },
/* b0 */
- { "(bad)" },
- { "(bad)" },
- { "lssS", Gv, Mp }, /* 386 lists only Mp */
- { "btrS", Ev, Gv },
- { "lfsS", Gv, Mp }, /* 386 lists only Mp */
- { "lgsS", Gv, Mp }, /* 386 lists only Mp */
- { "movzbS", Gv, Eb },
- { "movzwS", Gv, Ew },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "lssS", Gv, Mp, NOFUNC }, /* 386 lists only Mp */
+ { "btrS", Ev, Gv, NOFUNC },
+ { "lfsS", Gv, Mp, NOFUNC }, /* 386 lists only Mp */
+ { "lgsS", Gv, Mp, NOFUNC }, /* 386 lists only Mp */
+ { "movzbS", Gv, Eb, NOFUNC },
+ { "movzwS", Gv, Ew, NOFUNC },
/* b8 */
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ GRP8 },
- { "btcS", Ev, Gv },
- { "bsfS", Gv, Ev },
- { "bsrS", Gv, Ev },
- { "movsbS", Gv, Eb },
- { "movswS", Gv, Ew },
+ { "btcS", Ev, Gv, NOFUNC },
+ { "bsfS", Gv, Ev, NOFUNC },
+ { "bsrS", Gv, Ev, NOFUNC },
+ { "movsbS", Gv, Eb, NOFUNC },
+ { "movswS", Gv, Ew, NOFUNC },
/* c0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* c8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* d0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* d8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* e0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* e8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* f0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
/* f8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
};
static char obuf[100];
@@ -645,198 +779,198 @@ static int mod;
static int rm;
static int reg;
-static char *names32[]={
+static const char *names32[]={
"%eax","%ecx","%edx","%ebx", "%esp","%ebp","%esi","%edi",
};
-static char *names16[] = {
+static const char *names16[] = {
"%ax","%cx","%dx","%bx","%sp","%bp","%si","%di",
};
-static char *names8[] = {
+static const char *names8[] = {
"%al","%cl","%dl","%bl","%ah","%ch","%dh","%bh",
};
-static char *names_seg[] = {
+static const char *names_seg[] = {
"%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
};
-static char *names16_pairs[] = {
+static const char *names16_pairs[] = {
"%bx+%si","%bx+%di","%bp+%si","%bp+%di","%si","%di","%bp","%bx",
};
struct dis386 grps[][8] = {
/* GRP1b */
{
- { "addb", Eb, Ib },
- { "orb", Eb, Ib },
- { "adcb", Eb, Ib },
- { "sbbb", Eb, Ib },
- { "andb", Eb, Ib },
- { "subb", Eb, Ib },
- { "xorb", Eb, Ib },
- { "cmpb", Eb, Ib }
+ { "addb", Eb, Ib, NOFUNC },
+ { "orb", Eb, Ib, NOFUNC },
+ { "adcb", Eb, Ib, NOFUNC },
+ { "sbbb", Eb, Ib, NOFUNC },
+ { "andb", Eb, Ib, NOFUNC },
+ { "subb", Eb, Ib, NOFUNC },
+ { "xorb", Eb, Ib, NOFUNC },
+ { "cmpb", Eb, Ib, NOFUNC }
},
/* GRP1S */
{
- { "addS", Ev, Iv },
- { "orS", Ev, Iv },
- { "adcS", Ev, Iv },
- { "sbbS", Ev, Iv },
- { "andS", Ev, Iv },
- { "subS", Ev, Iv },
- { "xorS", Ev, Iv },
- { "cmpS", Ev, Iv }
+ { "addS", Ev, Iv, NOFUNC },
+ { "orS", Ev, Iv, NOFUNC },
+ { "adcS", Ev, Iv, NOFUNC },
+ { "sbbS", Ev, Iv, NOFUNC },
+ { "andS", Ev, Iv, NOFUNC },
+ { "subS", Ev, Iv, NOFUNC },
+ { "xorS", Ev, Iv, NOFUNC },
+ { "cmpS", Ev, Iv, NOFUNC }
},
/* GRP1Ss */
{
- { "addS", Ev, sIb },
- { "orS", Ev, sIb },
- { "adcS", Ev, sIb },
- { "sbbS", Ev, sIb },
- { "andS", Ev, sIb },
- { "subS", Ev, sIb },
- { "xorS", Ev, sIb },
- { "cmpS", Ev, sIb }
+ { "addS", Ev, sIb, NOFUNC },
+ { "orS", Ev, sIb, NOFUNC },
+ { "adcS", Ev, sIb, NOFUNC },
+ { "sbbS", Ev, sIb, NOFUNC },
+ { "andS", Ev, sIb, NOFUNC },
+ { "subS", Ev, sIb, NOFUNC },
+ { "xorS", Ev, sIb, NOFUNC },
+ { "cmpS", Ev, sIb, NOFUNC }
},
/* GRP2b */
{
- { "rolb", Eb, Ib },
- { "rorb", Eb, Ib },
- { "rclb", Eb, Ib },
- { "rcrb", Eb, Ib },
- { "shlb", Eb, Ib },
- { "shrb", Eb, Ib },
- { "(bad)" },
- { "sarb", Eb, Ib },
+ { "rolb", Eb, Ib, NOFUNC },
+ { "rorb", Eb, Ib, NOFUNC },
+ { "rclb", Eb, Ib, NOFUNC },
+ { "rcrb", Eb, Ib, NOFUNC },
+ { "shlb", Eb, Ib, NOFUNC },
+ { "shrb", Eb, Ib, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "sarb", Eb, Ib, NOFUNC },
},
/* GRP2S */
{
- { "rolS", Ev, Ib },
- { "rorS", Ev, Ib },
- { "rclS", Ev, Ib },
- { "rcrS", Ev, Ib },
- { "shlS", Ev, Ib },
- { "shrS", Ev, Ib },
- { "(bad)" },
- { "sarS", Ev, Ib },
+ { "rolS", Ev, Ib, NOFUNC },
+ { "rorS", Ev, Ib, NOFUNC },
+ { "rclS", Ev, Ib, NOFUNC },
+ { "rcrS", Ev, Ib, NOFUNC },
+ { "shlS", Ev, Ib, NOFUNC },
+ { "shrS", Ev, Ib, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "sarS", Ev, Ib, NOFUNC },
},
/* GRP2b_one */
{
- { "rolb", Eb },
- { "rorb", Eb },
- { "rclb", Eb },
- { "rcrb", Eb },
- { "shlb", Eb },
- { "shrb", Eb },
- { "(bad)" },
- { "sarb", Eb },
+ { "rolb", Eb, NOFUNC, NOFUNC },
+ { "rorb", Eb, NOFUNC, NOFUNC },
+ { "rclb", Eb, NOFUNC, NOFUNC },
+ { "rcrb", Eb, NOFUNC, NOFUNC },
+ { "shlb", Eb, NOFUNC, NOFUNC },
+ { "shrb", Eb, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "sarb", Eb, NOFUNC, NOFUNC },
},
/* GRP2S_one */
{
- { "rolS", Ev },
- { "rorS", Ev },
- { "rclS", Ev },
- { "rcrS", Ev },
- { "shlS", Ev },
- { "shrS", Ev },
- { "(bad)" },
- { "sarS", Ev },
+ { "rolS", Ev, NOFUNC, NOFUNC },
+ { "rorS", Ev, NOFUNC, NOFUNC },
+ { "rclS", Ev, NOFUNC, NOFUNC },
+ { "rcrS", Ev, NOFUNC, NOFUNC },
+ { "shlS", Ev, NOFUNC, NOFUNC },
+ { "shrS", Ev, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "sarS", Ev, NOFUNC, NOFUNC },
},
/* GRP2b_cl */
{
- { "rolb", Eb, CL },
- { "rorb", Eb, CL },
- { "rclb", Eb, CL },
- { "rcrb", Eb, CL },
- { "shlb", Eb, CL },
- { "shrb", Eb, CL },
- { "(bad)" },
- { "sarb", Eb, CL },
+ { "rolb", Eb, CL, NOFUNC },
+ { "rorb", Eb, CL, NOFUNC },
+ { "rclb", Eb, CL, NOFUNC },
+ { "rcrb", Eb, CL, NOFUNC },
+ { "shlb", Eb, CL, NOFUNC },
+ { "shrb", Eb, CL, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "sarb", Eb, CL, NOFUNC },
},
/* GRP2S_cl */
{
- { "rolS", Ev, CL },
- { "rorS", Ev, CL },
- { "rclS", Ev, CL },
- { "rcrS", Ev, CL },
- { "shlS", Ev, CL },
- { "shrS", Ev, CL },
- { "(bad)" },
- { "sarS", Ev, CL }
+ { "rolS", Ev, CL, NOFUNC },
+ { "rorS", Ev, CL, NOFUNC },
+ { "rclS", Ev, CL, NOFUNC },
+ { "rcrS", Ev, CL, NOFUNC },
+ { "shlS", Ev, CL, NOFUNC },
+ { "shrS", Ev, CL, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "sarS", Ev, CL, NOFUNC }
},
/* GRP3b */
{
- { "testb", Eb, Ib },
- { "(bad)", Eb },
- { "notb", Eb },
- { "negb", Eb },
- { "mulb", AL, Eb },
- { "imulb", AL, Eb },
- { "divb", AL, Eb },
- { "idivb", AL, Eb }
+ { "testb", Eb, Ib, NOFUNC },
+ { "(bad)", Eb, NOFUNC, NOFUNC },
+ { "notb", Eb, NOFUNC, NOFUNC },
+ { "negb", Eb, NOFUNC, NOFUNC },
+ { "mulb", AL, Eb, NOFUNC },
+ { "imulb", AL, Eb, NOFUNC },
+ { "divb", AL, Eb, NOFUNC },
+ { "idivb", AL, Eb, NOFUNC }
},
/* GRP3S */
{
- { "testS", Ev, Iv },
- { "(bad)" },
- { "notS", Ev },
- { "negS", Ev },
- { "mulS", eAX, Ev },
- { "imulS", eAX, Ev },
- { "divS", eAX, Ev },
- { "idivS", eAX, Ev },
+ { "testS", Ev, Iv, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "notS", Ev, NOFUNC, NOFUNC },
+ { "negS", Ev, NOFUNC, NOFUNC },
+ { "mulS", eAX, Ev, NOFUNC },
+ { "imulS", eAX, Ev, NOFUNC },
+ { "divS", eAX, Ev, NOFUNC },
+ { "idivS", eAX, Ev, NOFUNC },
},
/* GRP4 */
{
- { "incb", Eb },
- { "decb", Eb },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "incb", Eb, NOFUNC, NOFUNC },
+ { "decb", Eb, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
/* GRP5 */
{
- { "incS", Ev },
- { "decS", Ev },
- { "call", indirEv },
- { "lcall", indirEv },
- { "jmp", indirEv },
- { "ljmp", indirEv },
- { "pushS", Ev },
- { "(bad)" },
+ { "incS", Ev, NOFUNC, NOFUNC },
+ { "decS", Ev, NOFUNC, NOFUNC },
+ { "call", indirEv, NOFUNC, NOFUNC },
+ { "lcall", indirEv, NOFUNC, NOFUNC },
+ { "jmp", indirEv, NOFUNC, NOFUNC },
+ { "ljmp", indirEv, NOFUNC, NOFUNC },
+ { "pushS", Ev, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
/* GRP6 */
{
- { "sldt", Ew },
- { "str", Ew },
- { "lldt", Ew },
- { "ltr", Ew },
- { "verr", Ew },
- { "verw", Ew },
- { "(bad)" },
- { "(bad)" }
+ { "sldt", Ew, NOFUNC, NOFUNC },
+ { "str", Ew, NOFUNC, NOFUNC },
+ { "lldt", Ew, NOFUNC, NOFUNC },
+ { "ltr", Ew, NOFUNC, NOFUNC },
+ { "verr", Ew, NOFUNC, NOFUNC },
+ { "verw", Ew, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC }
},
/* GRP7 */
{
- { "sgdt", Ew },
- { "sidt", Ew },
- { "lgdt", Ew },
- { "lidt", Ew },
- { "smsw", Ew },
- { "(bad)" },
- { "lmsw", Ew },
- { "(bad)" },
+ { "sgdt", Ew, NOFUNC, NOFUNC },
+ { "sidt", Ew, NOFUNC, NOFUNC },
+ { "lgdt", Ew, NOFUNC, NOFUNC },
+ { "lidt", Ew, NOFUNC, NOFUNC },
+ { "smsw", Ew, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "lmsw", Ew, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
/* GRP8 */
{
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "btS", Ev, Ib },
- { "btsS", Ev, Ib },
- { "btrS", Ev, Ib },
- { "btcS", Ev, Ib },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "btS", Ev, Ib, NOFUNC },
+ { "btsS", Ev, Ib, NOFUNC },
+ { "btrS", Ev, Ib, NOFUNC },
+ { "btcS", Ev, Ib, NOFUNC },
}
};
@@ -926,11 +1060,8 @@ static unsigned long start_pc;
* The function returns the length of this instruction in bytes.
*/
int
-i386dis (ucs, uip, inbuf, outbuf, mode)
- unsigned short ucs;
- unsigned short uip;
- unsigned char *inbuf;
- char *outbuf;
+i386dis (unsigned short ucs, unsigned short uip, unsigned char *inbuf,
+ char *outbuf, int mode)
{
struct dis386 *dp;
int i;
@@ -973,7 +1104,6 @@ i386dis (ucs, uip, inbuf, outbuf, mode)
}
/* these would be initialized to 0 if disassembling for 8086 or 286 */
- /* these would be initialized to 0 if disassembling for 8086 or 286 */
if (mode) {
dflag = 1;
aflag = 1;
@@ -1068,7 +1198,7 @@ i386dis (ucs, uip, inbuf, outbuf, mode)
return (codep - inbuf);
}
-char *float_mem[] = {
+const char *float_mem[] = {
/* d8 */
"fadds",
"fmuls",
@@ -1146,34 +1276,34 @@ char *float_mem[] = {
#define ST OP_ST, 0
#define STi OP_STi, 0
-#define FGRPd9_2 NULL, NULL, 0
-#define FGRPd9_4 NULL, NULL, 1
-#define FGRPd9_5 NULL, NULL, 2
-#define FGRPd9_6 NULL, NULL, 3
-#define FGRPd9_7 NULL, NULL, 4
-#define FGRPda_5 NULL, NULL, 5
-#define FGRPdb_4 NULL, NULL, 6
-#define FGRPde_3 NULL, NULL, 7
-#define FGRPdf_4 NULL, NULL, 8
+#define FGRPd9_2 NULL, NULL, 0, NOFUNC, NOFUNC
+#define FGRPd9_4 NULL, NULL, 1, NOFUNC, NOFUNC
+#define FGRPd9_5 NULL, NULL, 2, NOFUNC, NOFUNC
+#define FGRPd9_6 NULL, NULL, 3, NOFUNC, NOFUNC
+#define FGRPd9_7 NULL, NULL, 4, NOFUNC, NOFUNC
+#define FGRPda_5 NULL, NULL, 5, NOFUNC, NOFUNC
+#define FGRPdb_4 NULL, NULL, 6, NOFUNC, NOFUNC
+#define FGRPde_3 NULL, NULL, 7, NOFUNC, NOFUNC
+#define FGRPdf_4 NULL, NULL, 8, NOFUNC, NOFUNC
struct dis386 float_reg[][8] = {
/* d8 */
{
- { "fadd", ST, STi },
- { "fmul", ST, STi },
- { "fcom", STi },
- { "fcomp", STi },
- { "fsub", ST, STi },
- { "fsubr", ST, STi },
- { "fdiv", ST, STi },
- { "fdivr", ST, STi },
+ { "fadd", ST, STi, NOFUNC },
+ { "fmul", ST, STi, NOFUNC },
+ { "fcom", STi, NOFUNC, NOFUNC },
+ { "fcomp", STi, NOFUNC, NOFUNC },
+ { "fsub", ST, STi, NOFUNC },
+ { "fsubr", ST, STi, NOFUNC },
+ { "fdiv", ST, STi, NOFUNC },
+ { "fdivr", ST, STi, NOFUNC },
},
/* d9 */
{
- { "fld", STi },
- { "fxch", STi },
+ { "fld", STi, NOFUNC, NOFUNC },
+ { "fxch", STi, NOFUNC, NOFUNC },
{ FGRPd9_2 },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ FGRPd9_4 },
{ FGRPd9_5 },
{ FGRPd9_6 },
@@ -1181,74 +1311,74 @@ struct dis386 float_reg[][8] = {
},
/* da */
{
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ FGRPda_5 },
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
/* db */
{
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ FGRPdb_4 },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
/* dc */
{
- { "fadd", STi, ST },
- { "fmul", STi, ST },
- { "(bad)" },
- { "(bad)" },
- { "fsub", STi, ST },
- { "fsubr", STi, ST },
- { "fdiv", STi, ST },
- { "fdivr", STi, ST },
+ { "fadd", STi, ST, NOFUNC },
+ { "fmul", STi, ST, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "fsub", STi, ST, NOFUNC },
+ { "fsubr", STi, ST, NOFUNC },
+ { "fdiv", STi, ST, NOFUNC },
+ { "fdivr", STi, ST, NOFUNC },
},
/* dd */
{
- { "ffree", STi },
- { "(bad)" },
- { "fst", STi },
- { "fstp", STi },
- { "fucom", STi },
- { "fucomp", STi },
- { "(bad)" },
- { "(bad)" },
+ { "ffree", STi, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "fst", STi, NOFUNC, NOFUNC },
+ { "fstp", STi, NOFUNC, NOFUNC },
+ { "fucom", STi, NOFUNC, NOFUNC },
+ { "fucomp", STi, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
/* de */
{
- { "faddp", STi, ST },
- { "fmulp", STi, ST },
- { "(bad)" },
+ { "faddp", STi, ST, NOFUNC },
+ { "fmulp", STi, ST, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ FGRPde_3 },
- { "fsubp", STi, ST },
- { "fsubrp", STi, ST },
- { "fdivp", STi, ST },
- { "fdivrp", STi, ST },
+ { "fsubp", STi, ST, NOFUNC },
+ { "fsubrp", STi, ST, NOFUNC },
+ { "fdivp", STi, ST, NOFUNC },
+ { "fdivrp", STi, ST, NOFUNC },
},
/* df */
{
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
{ FGRPdf_4 },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
+ { "(bad)", NOFUNC, NOFUNC, NOFUNC },
},
};
-char *fgrps[][8] = {
+const char *fgrps[][8] = {
/* d9_2 0 */
{
"fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
@@ -1335,13 +1465,13 @@ dofloat ()
}
static void
-OP_ST(int arg)
+OP_ST(int dummy)
{
oappend ("%st");
}
static void
-OP_STi(int arg)
+OP_STi(int dummy)
{
sprintf (scratchbuf, "%%st(%d)", rm);
oappend (scratchbuf);
@@ -1350,10 +1480,9 @@ OP_STi(int arg)
/* capital letters in template are macros */
static void
-putop (template)
- char *template;
+putop(const char *template)
{
- char *p;
+ const char *p;
for (p = template; *p; p++)
{
@@ -1383,7 +1512,7 @@ putop (template)
}
static void
-oappend(char *s)
+oappend(const char *s)
{
strcpy (obufp, s);
obufp += strlen (s);
@@ -1511,7 +1640,7 @@ OP_E(int bytemode)
break;
}
- if (mod != 0 || (aflag && rm == 5 || (havesib && base == 5))
+ if (mod != 0 || ((aflag && rm == 5) || (havesib && base == 5))
|| (!aflag && rm == 6)) {
sprintf (scratchbuf, "0x%x", disp);
oappend (scratchbuf);
@@ -1584,7 +1713,7 @@ get16()
static void
OP_REG(int code)
{
- char *s;
+ const char *s;
switch (code)
{
@@ -1707,7 +1836,7 @@ append_pc(unsigned long pc)
static void
OP_SEG(int dummy)
{
- static char *sreg[] = {
+ static const char *sreg[] = {
"%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
};
@@ -1751,7 +1880,7 @@ OP_DIR(int size)
}
static void
-OP_OFF(int bytemode)
+OP_OFF(int dummy)
{
int off;
diff --git a/usr.bin/doscmd/int14.c b/usr.bin/doscmd/int14.c
index 409c88f..56c9576 100644
--- a/usr.bin/doscmd/int14.c
+++ b/usr.bin/doscmd/int14.c
@@ -373,8 +373,8 @@ com_port_in(int port)
rs = LS_X_SHFT_E | LS_X_HOLD_E;
/* if (queue_not_empty(cdsp->com_queue)) */
ioctl(cdsp->fd, FIONREAD, &nbytes);
- if (nbytes > 0);
- rs |= LS_RCV_DATA_RD;
+ if (nbytes > 0)
+ rs |= LS_RCV_DATA_RD;
break;
/* 0x03FE - modem status register */
diff --git a/usr.bin/doscmd/intff.c b/usr.bin/doscmd/intff.c
index 6ec7e0a..7e608cf 100644
--- a/usr.bin/doscmd/intff.c
+++ b/usr.bin/doscmd/intff.c
@@ -476,7 +476,8 @@ int2f11_lseek(regcontext_t *REGS)
static int
int2f11_fnqual(regcontext_t *REGS)
{
- char *fname,*tname;
+ char *fname;
+ const char *tname;
int savedrive;
int error;
@@ -578,7 +579,7 @@ static int
int2f11_validate(regcontext_t *REGS)
{
int func = R_AL;
- char *path = NULL;
+ const char *path = NULL;
int doit = 0;
/* defaults may help trap problems */
diff --git a/usr.bin/doscmd/trace.c b/usr.bin/doscmd/trace.c
index 368b068..20517e8 100644
--- a/usr.bin/doscmd/trace.c
+++ b/usr.bin/doscmd/trace.c
@@ -196,12 +196,6 @@ printtrace(regcontext_t *REGS, char *buf)
#if BIG_DEBUG
u_char *addr = (u_char *)MAKEPTR(R_CS, R_IP);
#endif
- char *bigfmt = "%04x:%04x "
-#if BIG_DEBUG
- "%02x %02x %02x %02x %02x %02x "
-#endif
- "%-30s "
- "%04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x ";
if (first) {
fprintf(debugf, "%4s:%4s "
@@ -217,7 +211,12 @@ printtrace(regcontext_t *REGS, char *buf)
first = 0;
}
- fprintf(debugf, bigfmt,
+ fprintf(debugf, "%04x:%04x "
+#if BIG_DEBUG
+ "%02x %02x %02x %02x %02x %02x "
+#endif
+ "%-30s "
+ "%04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x ",
R_CS, R_IP,
#if BIG_DEBUG
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
diff --git a/usr.bin/doscmd/tty.c b/usr.bin/doscmd/tty.c
index e3bd830..23486cc 100644
--- a/usr.bin/doscmd/tty.c
+++ b/usr.bin/doscmd/tty.c
@@ -86,7 +86,7 @@ static u_short scan_code = 0x00;
int height;
int width;
int vattr;
-char *xfont = 0;
+const char *xfont = 0;
#ifndef NO_X
Display *dpy;
diff --git a/usr.bin/doscmd/tty.h b/usr.bin/doscmd/tty.h
index 660b44c..16ec477 100644
--- a/usr.bin/doscmd/tty.h
+++ b/usr.bin/doscmd/tty.h
@@ -31,7 +31,7 @@ int redirect0;
int redirect1;
int redirect2;
extern int kbd_fd;
-extern char *xfont;
+extern const char *xfont;
int KbdEmpty(void);
u_short KbdPeek(void);
diff --git a/usr.bin/doscmd/video.h b/usr.bin/doscmd/video.h
index e765d2a..25cf753 100644
--- a/usr.bin/doscmd/video.h
+++ b/usr.bin/doscmd/video.h
@@ -347,7 +347,7 @@ typedef struct {
int numpages; /* Number of display pages */
int vrescode; /* 0 = 200, 1 = 350, 2 = 400, 3 = 480 */
u_int32_t vmemaddr; /* Video memory address */
- char *fontname; /* Font name */
+ const char *fontname; /* Font name */
} vmode_t;
/* Types. 'NOMODE' is one of the 'forbidden' internal modes. */
diff --git a/usr.bin/doscmd/xms.c b/usr.bin/doscmd/xms.c
index bd56fb5..912631b 100644
--- a/usr.bin/doscmd/xms.c
+++ b/usr.bin/doscmd/xms.c
@@ -361,7 +361,7 @@ void initHMA()
if (mmap((caddr_t)0x000000, 0x100000,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_ANON | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- -1, 0) < 0) {
+ -1, 0) == MAP_FAILED) {
perror("Error mapping HMA, HMA disabled: ");
HMA_a20 = -1;
close(HMA_fd_off);
@@ -371,7 +371,7 @@ void initHMA()
if (mmap((caddr_t)0x000000, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_FILE | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- HMA_fd_off, 0) < 0) {
+ HMA_fd_off, 0) == MAP_FAILED) {
perror("Error mapping HMA, HMA disabled: ");
HMA_a20 = -1;
close(HMA_fd_off);
@@ -381,7 +381,7 @@ void initHMA()
if (mmap((caddr_t)0x100000, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_FILE | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- HMA_fd_off, 0) < 0) {
+ HMA_fd_off, 0) == MAP_FAILED) {
perror("Error mapping HMA, HMA disabled: ");
HMA_a20 = -1;
close(HMA_fd_off);
@@ -412,7 +412,7 @@ static void enable_a20()
if (mmap((caddr_t)0x100000, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_FILE | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- HMA_fd_on, 0) < 0) {
+ HMA_fd_on, 0) == MAP_FAILED) {
fatal("HMA mapping error: %s\nCannot recover\n", strerror(errno));
}
}
@@ -432,7 +432,7 @@ static void disable_a20()
if (mmap((caddr_t)0x100000, 64 * 1024,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_FILE | MAP_FIXED | MAP_INHERIT | MAP_SHARED,
- HMA_fd_off, 0) < 0) {
+ HMA_fd_off, 0) == MAP_FAILED) {
fatal("HMA mapping error: %s\nCannot recover\n", strerror(errno));
}
}
OpenPOWER on IntegriCloud