mdbdis86.c File Reference

#include "mdb.h"
#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include "proto.h"

Include dependency graph for mdbdis86.c:

Go to the source code of this file.

Data Structures

struct  address_s

Defines

#define LINDIRECT   '['
#define RINDIRECT   ']'
#define BASE_MASK   0x07
#define INDEX_MASK   0x38
#define INDEX_SHIFT   3
#define MOD_MASK   0xC0
#define REG_MOD   0xC0
#define MEM0_MOD   0x00
#define MEM1_MOD   0x40
#define MEM2_MOD   0x80
#define REG_MASK   0x38
#define REG_SHIFT   3
#define RM_MASK   0x07
#define RM_SHIFT   0
#define SS_MASK   0xC0
#define SS_SHIFT   6
#define SIGNBIT   0x02
#define WORDBIT   0x01
#define TOREGBIT   0x02
#define MAX_SIGNED_CHAR   0x7F
#define MAX_UNSIGNED_CHAR   0xFF

Typedefs

typedef unsigned opcode_pt
typedef int reg_pt
typedef int su16_t
typedef int su8_pt

Functions

FORWARD _PROTOTYPE (u8_t get8,(void))
FORWARD _PROTOTYPE (u16_t get16,(void))
FORWARD _PROTOTYPE (u32_t get32,(void))
FORWARD _PROTOTYPE (u8_t peek_byte,(off_t addr))
FORWARD _PROTOTYPE (u16_t peek_word,(off_t addr))
FORWARD _PROTOTYPE (int puti,(void))
FORWARD _PROTOTYPE (int outsegaddr,(struct address_s *addr))
FORWARD _PROTOTYPE (void getmodregrm,(void))
FORWARD _PROTOTYPE (void i_00_to_3f,(opcode_pt opc))
FORWARD _PROTOTYPE (void outea,(opcode_pt wordflags))
FORWARD _PROTOTYPE (void outimmed,(opcode_pt signwordflag))
FORWARD _PROTOTYPE (void outpc,(off_t pc))
FORWARD _PROTOTYPE (void oututstr,(char *s))
 _PROTOTYPE (typedef void(*pfv_t),(opcode_pt opc))
PRIVATE su8_pt get8s ()
PRIVATE void getmodregrm ()
PRIVATE void i_00_to_3f (opcode_pt opc)
PRIVATE void i_40_to_5f (opcode_pt opc)
PRIVATE void i_60_to_6f (opcode_pt opc)
PRIVATE void i_70_to_7f (opcode_pt opc)
PRIVATE void i_80 (opcode_pt opc)
PRIVATE void i_88 (opcode_pt opc)
PRIVATE void i_90 (opcode_pt opc)
PRIVATE void i_98 (opcode_pt opc)
PRIVATE void i_a0 (opcode_pt opc)
PRIVATE void i_a8 (opcode_pt opc)
PRIVATE void i_b0 (opcode_pt opc)
PRIVATE void i_b8 (opcode_pt opc)
PRIVATE void i_c0 (opcode_pt opc)
PRIVATE void i_c8 (opcode_pt opc)
PRIVATE void i_d0 (opcode_pt opc)
PRIVATE void i_d8 (opcode_pt opc)
PRIVATE void i_e0 (opcode_pt opc)
PRIVATE void i_e8 (opcode_pt opc)
PRIVATE void i_f0 (opcode_pt opc)
PRIVATE void i_f8 (opcode_pt opc)
PRIVATE void outad (opcode_pt opc)
PRIVATE void outad1 (opcode_pt opc)
PRIVATE void outalorx (opcode_pt opc)
PRIVATE void outax ()
PRIVATE void outbptr ()
PRIVATE void outbwptr (opcode_pt opc)
PRIVATE void outea (opcode_pt wordflags)
PRIVATE void outf1 ()
PRIVATE void outfishy ()
PRIVATE void outgetaddr ()
PRIVATE void outimmed (opcode_pt signwordflag)
PRIVATE void outpc (off_t pc)
PRIVATE void outsegpc ()
PRIVATE void oututstr (char *s)
PRIVATE void outword ()
PRIVATE void outwptr ()
PRIVATE void outwsize ()
PRIVATE void pagef ()
PRIVATE int puti ()
PRIVATE void shift (opcode_pt opc)
PRIVATE void checkmemory ()
PRIVATE void CL ()
PRIVATE void Eb ()
PRIVATE void Ev ()
PRIVATE void EvGv ()
PRIVATE void EvIb ()
PRIVATE void Ew ()
PRIVATE void EwRw ()
PRIVATE void Gv ()
PRIVATE void Gv1 ()
PRIVATE void GvEv ()
PRIVATE void GvEw ()
PRIVATE void GvM ()
PRIVATE void GvMa ()
PRIVATE void GvMp ()
PRIVATE void Ib ()
PRIVATE void Iw ()
PRIVATE void Iv ()
PRIVATE void Jb ()
PRIVATE void Jv ()
PRIVATE void Ms ()
PUBLIC long dasm (long addr, int count, int symflg)
PRIVATE int show1instruction ()
PRIVATE u8_t get8 ()
PRIVATE u16_t get16 ()
PRIVATE u32_t get32 ()
PRIVATE int outsegaddr (struct address_s *addr)
PRIVATE int outssegaddr (struct address_s *addr)
PRIVATE u8_t peek_byte (off_t addr)
PRIVATE u16_t peek_word (off_t addr)

Variables

PRIVATE int bits32
PRIVATE struct address_s uptr
PRIVATE pfv_t optable []
PRIVATE char fishy [] = "???"
PRIVATE char movtab [] = "mov\t"
PRIVATE char * genreg []
PRIVATE char * segreg []
PRIVATE char * indreg []
PRIVATE char * str_00_to_3f []
PRIVATE char * sstr_00_to_3f []
PRIVATE char * sstr_0f []
PRIVATE char * ssstr_0f []
PRIVATE char * str_40_to_5f []
PRIVATE char * str_60_to_6f []
PRIVATE char * str_flags []
PRIVATE char * str_98 []
PRIVATE char * str_a0 []
PRIVATE char * str_a8 []
PRIVATE char * str_c0 []
PRIVATE char * str_c8 []
PRIVATE char * str_d0 []
PRIVATE char * sstr_d0 []
PRIVATE char * str_d8 []
PRIVATE char * str1_d8 []
PRIVATE unsigned char size_d8 []
PRIVATE char * sstr_d8 []
PRIVATE char * str_e0 []
PRIVATE char * str_e8 []
PRIVATE char * str_f0 []
PRIVATE char * sstr_f0 []
PRIVATE char * str_f8 []
PRIVATE char * sstr_f8 []
PRIVATE int data_seg
PRIVATE unsigned hasize
PRIVATE unsigned hdefsize
PRIVATE unsigned hosize
PRIVATE opcode_pt mod
PRIVATE off_t offtable [2]
PRIVATE off_toffptr
PRIVATE off_toff1ptr
PRIVATE opcode_pt reg
PRIVATE opcode_pt rm


Define Documentation

#define BASE_MASK   0x07
 

Definition at line 37 of file mdbdis86.c.

Referenced by outea().

#define INDEX_MASK   0x38
 

Definition at line 38 of file mdbdis86.c.

Referenced by outea().

#define INDEX_SHIFT   3
 

Definition at line 39 of file mdbdis86.c.

Referenced by outea().

#define LINDIRECT   '['
 

Definition at line 34 of file mdbdis86.c.

Referenced by outea().

#define MAX_SIGNED_CHAR   0x7F
 

Definition at line 56 of file mdbdis86.c.

Referenced by get8s().

#define MAX_UNSIGNED_CHAR   0xFF
 

Definition at line 57 of file mdbdis86.c.

Referenced by get8s().

#define MEM0_MOD   0x00
 

Definition at line 42 of file mdbdis86.c.

Referenced by i_a0(), and outea().

#define MEM1_MOD   0x40
 

Definition at line 43 of file mdbdis86.c.

Referenced by outea().

#define MEM2_MOD   0x80
 

Definition at line 44 of file mdbdis86.c.

Referenced by outea().

#define MOD_MASK   0xC0
 

Definition at line 40 of file mdbdis86.c.

Referenced by getmodregrm().

#define REG_MASK   0x38
 

Definition at line 45 of file mdbdis86.c.

Referenced by getmodregrm().

#define REG_MOD   0xC0
 

Definition at line 41 of file mdbdis86.c.

Referenced by checkmemory(), i_d8(), outbwptr(), outea(), and pagef().

#define REG_SHIFT   3
 

Definition at line 46 of file mdbdis86.c.

Referenced by getmodregrm().

#define RINDIRECT   ']'
 

Definition at line 35 of file mdbdis86.c.

Referenced by outea().

#define RM_MASK   0x07
 

Definition at line 47 of file mdbdis86.c.

Referenced by getmodregrm().

#define RM_SHIFT   0
 

Definition at line 48 of file mdbdis86.c.

Referenced by getmodregrm().

#define SIGNBIT   0x02
 

Definition at line 52 of file mdbdis86.c.

Referenced by i_60_to_6f(), i_80(), outea(), and outimmed().

#define SS_MASK   0xC0
 

Definition at line 49 of file mdbdis86.c.

Referenced by outea().

#define SS_SHIFT   6
 

Definition at line 50 of file mdbdis86.c.

Referenced by outea().

#define TOREGBIT   0x02
 

Definition at line 54 of file mdbdis86.c.

Referenced by i_88(), i_a0(), i_e8(), outad1(), and pagef().

#define WORDBIT   0x01
 

Definition at line 53 of file mdbdis86.c.

Referenced by Ev(), i_60_to_6f(), i_c0(), i_f0(), outad1(), outalorx(), outbwptr(), outea(), outimmed(), and pagef().


Typedef Documentation

typedef unsigned opcode_pt
 

Definition at line 59 of file mdbdis86.c.

typedef int reg_pt
 

Definition at line 61 of file mdbdis86.c.

typedef int su16_t
 

Definition at line 62 of file mdbdis86.c.

typedef int su8_pt
 

Definition at line 63 of file mdbdis86.c.


Function Documentation

_PROTOTYPE typedef void *  pfv_t,
(opcode_pt opc) 
 

FORWARD _PROTOTYPE void  oututstr,
(char *s
 

FORWARD _PROTOTYPE void  outpc,
(off_t pc
 

FORWARD _PROTOTYPE void  outimmed,
(opcode_pt signwordflag) 
 

FORWARD _PROTOTYPE void  outea,
(opcode_pt wordflags) 
 

FORWARD _PROTOTYPE void  i_00_to_3f,
(opcode_pt opc) 
 

FORWARD _PROTOTYPE void  getmodregrm,
(void) 
 

FORWARD _PROTOTYPE int  outsegaddr,
(struct address_s *addr) 
 

FORWARD _PROTOTYPE int  puti,
(void) 
 

FORWARD _PROTOTYPE u16_t  peek_word,
(off_t addr) 
 

FORWARD _PROTOTYPE u8_t  peek_byte,
(off_t addr) 
 

FORWARD _PROTOTYPE u32_t  get32,
(void) 
 

FORWARD _PROTOTYPE u16_t  get16,
(void) 
 

FORWARD _PROTOTYPE u8_t  get8,
(void) 
 

PRIVATE void checkmemory  ) 
 

Definition at line 1289 of file mdbdis86.c.

References outfishy(), and REG_MOD.

Referenced by GvM(), and Ms().

PRIVATE void CL  ) 
 

Definition at line 1295 of file mdbdis86.c.

References outustr().

PUBLIC long dasm long  addr,
int  count,
int  symflg
 

Definition at line 1423 of file mdbdis86.c.

References address_s::base, bits32, FALSE, address_s::off, show1instruction(), TRUE, and uptr.

Referenced by c_status(), command(), display(), modify(), and tstart().

PRIVATE void Eb  ) 
 

Definition at line 1300 of file mdbdis86.c.

References outea().

Referenced by pagef().

PRIVATE void Ev  ) 
 

Definition at line 1305 of file mdbdis86.c.

References outea(), and WORDBIT.

Referenced by EvGv(), EvIb(), Ew(), GvEv(), i_88(), Ms(), and pagef().

PRIVATE void EvGv  ) 
 

Definition at line 1310 of file mdbdis86.c.

References Ev(), getmodregrm(), Gv1(), and outcomma().

Referenced by EwRw(), and pagef().

PRIVATE void EvIb  ) 
 

Definition at line 1318 of file mdbdis86.c.

References Ev(), Ib(), and outcomma().

Referenced by pagef().

PRIVATE void Ew  ) 
 

Definition at line 1325 of file mdbdis86.c.

References Ev().

Referenced by GvEw(), and pagef().

PRIVATE void EwRw  ) 
 

Definition at line 1331 of file mdbdis86.c.

References EvGv().

Referenced by i_60_to_6f().

PRIVATE u16_t get16  ) 
 

Definition at line 1495 of file mdbdis86.c.

References address_s::base, address_s::off, peek_word(), and uptr.

Referenced by Iw(), Jv(), outgetaddr(), and outsegpc().

PRIVATE u32_t get32  ) 
 

Definition at line 1506 of file mdbdis86.c.

References address_s::base, address_s::off, peek_dword(), and uptr.

Referenced by Iv(), Jv(), outgetaddr(), and outsegpc().

PRIVATE u8_t get8  ) 
 

Definition at line 1484 of file mdbdis86.c.

References address_s::base, address_s::off, peek_byte(), and uptr.

Referenced by get8s(), getmodregrm(), i_d0(), Ib(), outea(), pagef(), puti(), and show1instruction().

PRIVATE su8_pt get8s  ) 
 

Definition at line 375 of file mdbdis86.c.

References get8(), MAX_SIGNED_CHAR, and MAX_UNSIGNED_CHAR.

Referenced by Jb(), and outimmed().

PRIVATE void getmodregrm  ) 
 

Definition at line 384 of file mdbdis86.c.

References get8(), MOD_MASK, REG_MASK, REG_SHIFT, RM_MASK, and RM_SHIFT.

Referenced by EvGv(), Gv(), i_80(), i_88(), i_c0(), i_d8(), i_f0(), i_f8(), outad(), pagef(), and shift().

PRIVATE void Gv  ) 
 

Definition at line 1337 of file mdbdis86.c.

References getmodregrm(), and Gv1().

Referenced by GvEv(), GvEw(), and pagef().

PRIVATE void Gv1  ) 
 

Definition at line 1343 of file mdbdis86.c.

References outustr().

Referenced by EvGv(), Gv(), and outad1().

PRIVATE void GvEv  ) 
 

Definition at line 1348 of file mdbdis86.c.

References Ev(), Gv(), and outcomma().

Referenced by GvM(), i_60_to_6f(), and pagef().

PRIVATE void GvEw  ) 
 

Definition at line 1355 of file mdbdis86.c.

References Ew(), Gv(), and outcomma().

Referenced by pagef().

PRIVATE void GvM  ) 
 

Definition at line 1362 of file mdbdis86.c.

References checkmemory(), and GvEv().

Referenced by GvMa(), GvMp(), and i_88().

PRIVATE void GvMa  ) 
 

Definition at line 1368 of file mdbdis86.c.

References GvM().

Referenced by i_60_to_6f().

PRIVATE void GvMp  ) 
 

Definition at line 1373 of file mdbdis86.c.

References GvM().

Referenced by i_c0(), and pagef().

PRIVATE void i_00_to_3f opcode_pt  opc  ) 
 

Definition at line 394 of file mdbdis86.c.

References Ib(), Iv(), outad(), outax(), outcomma(), outustr(), oututstr(), and pagef().

PRIVATE void i_40_to_5f opcode_pt  opc  ) 
 

Definition at line 427 of file mdbdis86.c.

References outustr().

PRIVATE void i_60_to_6f opcode_pt  opc  ) 
 

Definition at line 434 of file mdbdis86.c.

References EwRw(), GvEv(), GvMa(), Iv(), outcomma(), outimmed(), outustr(), outword(), outwsize(), SIGNBIT, and WORDBIT.

PRIVATE void i_70_to_7f opcode_pt  opc  ) 
 

Definition at line 488 of file mdbdis86.c.

References Jb(), outustr(), and oututstr().

PRIVATE void i_80 opcode_pt  opc  ) 
 

Definition at line 496 of file mdbdis86.c.

References getmodregrm(), outad(), outbwptr(), outcomma(), outea(), outfishy(), outimmed(), outustr(), oututstr(), and SIGNBIT.

PRIVATE void i_88 opcode_pt  opc  ) 
 

Definition at line 522 of file mdbdis86.c.

References Ev(), getmodregrm(), GvM(), outad(), outcomma(), outfishy(), outustr(), oututstr(), outwptr(), and TOREGBIT.

PRIVATE void i_90 opcode_pt  opc  ) 
 

Definition at line 562 of file mdbdis86.c.

References outax(), outcomma(), and outustr().

PRIVATE void i_98 opcode_pt  opc  ) 
 

Definition at line 576 of file mdbdis86.c.

References outsegpc(), and outustr().

PRIVATE void i_a0 opcode_pt  opc  ) 
 

Definition at line 584 of file mdbdis86.c.

References MEM0_MOD, outad1(), outustr(), outwsize(), and TOREGBIT.

PRIVATE void i_a8 opcode_pt  opc  ) 
 

Definition at line 602 of file mdbdis86.c.

References outalorx(), outcomma(), outimmed(), outustr(), and outwsize().

PRIVATE void i_b0 opcode_pt  opc  ) 
 

Definition at line 616 of file mdbdis86.c.

References Ib(), outcomma(), and outustr().

PRIVATE void i_b8 opcode_pt  opc  ) 
 

Definition at line 625 of file mdbdis86.c.

References Iv(), outcomma(), and outustr().

PRIVATE void i_c0 opcode_pt  opc  ) 
 

Definition at line 634 of file mdbdis86.c.

References getmodregrm(), GvMp(), Iv(), outbwptr(), outcomma(), outea(), outfishy(), outimmed(), outustr(), shift, and WORDBIT.

PRIVATE void i_c8 opcode_pt  opc  ) 
 

Definition at line 657 of file mdbdis86.c.

References Ib(), Iv(), Iw(), outcomma(), outustr(), and outwsize().

PRIVATE void i_d0 opcode_pt  opc  ) 
 

Definition at line 675 of file mdbdis86.c.

References get8(), outfishy(), outh8(), outtab(), outustr(), and shift.

PRIVATE void i_d8 opcode_pt  opc  ) 
 

Definition at line 694 of file mdbdis86.c.

References esc, escape(), getmodregrm(), NULL, outbptr(), outcomma(), outea(), outf1(), outh8(), outtab(), outustr(), oututstr(), outwptr(), and REG_MOD.

PRIVATE void i_e0 opcode_pt  opc  ) 
 

Definition at line 749 of file mdbdis86.c.

References Ib(), Jb(), outalorx(), outcomma(), and outustr().

PRIVATE void i_e8 opcode_pt  opc  ) 
 

Definition at line 769 of file mdbdis86.c.

References Jb(), Jv(), outalorx(), outcomma(), outsegpc(), outustr(), and TOREGBIT.

PRIVATE void i_f0 opcode_pt  opc  ) 
 

Definition at line 796 of file mdbdis86.c.

References getmodregrm(), outbwptr(), outcomma(), outea(), outimmed(), outustr(), and WORDBIT.

PRIVATE void i_f8 opcode_pt  opc  ) 
 

Definition at line 815 of file mdbdis86.c.

References getmodregrm(), outbwptr(), outea(), and outustr().

PRIVATE void Ib  ) 
 

Definition at line 1378 of file mdbdis86.c.

References get8(), and outh8().

Referenced by EvIb(), i_00_to_3f(), i_b0(), i_c8(), i_e0(), outimmed(), pagef(), and shift().

PRIVATE void Iv  ) 
 

Definition at line 1388 of file mdbdis86.c.

References get32(), Iw(), and outh32().

Referenced by i_00_to_3f(), i_60_to_6f(), i_b8(), i_c0(), i_c8(), and outimmed().

PRIVATE void Iw  ) 
 

Definition at line 1383 of file mdbdis86.c.

References get16(), and outh16().

Referenced by i_c8(), and Iv().

PRIVATE void Jb  ) 
 

Definition at line 1396 of file mdbdis86.c.

References get8s(), address_s::off, outpc(), and uptr.

Referenced by i_70_to_7f(), i_e0(), and i_e8().

PRIVATE void Jv  ) 
 

Definition at line 1404 of file mdbdis86.c.

References get16(), get32(), address_s::off, outpc(), and uptr.

Referenced by i_e8(), and pagef().

PRIVATE void Ms  ) 
 

Definition at line 1415 of file mdbdis86.c.

References checkmemory(), and Ev().

Referenced by pagef().

PRIVATE void outad opcode_pt  opc  ) 
 

Definition at line 832 of file mdbdis86.c.

References getmodregrm(), and outad1().

Referenced by i_00_to_3f(), i_80(), and i_88().

PRIVATE void outad1 opcode_pt  opc  ) 
 

Definition at line 839 of file mdbdis86.c.

References Gv1(), outcomma(), outea(), outustr(), TOREGBIT, and WORDBIT.

Referenced by i_a0(), and outad().

PRIVATE void outalorx opcode_pt  opc  ) 
 

Definition at line 858 of file mdbdis86.c.

References outax(), outustr(), and WORDBIT.

Referenced by i_a8(), i_e0(), and i_e8().

PRIVATE void outax  ) 
 

Definition at line 867 of file mdbdis86.c.

References outustr().

Referenced by i_00_to_3f(), i_90(), and outalorx().

PRIVATE void outbptr  ) 
 

Definition at line 872 of file mdbdis86.c.

References outustr().

Referenced by i_d8(), and outbwptr().

PRIVATE void outbwptr opcode_pt  opc  ) 
 

Definition at line 877 of file mdbdis86.c.

References outbptr(), outwptr(), REG_MOD, and WORDBIT.

Referenced by i_80(), i_c0(), i_f0(), i_f8(), pagef(), and shift().

PRIVATE void outea opcode_pt  wordflags  ) 
 

Definition at line 889 of file mdbdis86.c.

References base, BASE_MASK, get8(), index(), INDEX_MASK, INDEX_SHIFT, LINDIRECT, MEM0_MOD, MEM1_MOD, MEM2_MOD, outbyte(), outfishy(), outgetaddr(), outimmed(), outstr(), outustr(), REG_MOD, RINDIRECT, SIGNBIT, SS_MASK, SS_SHIFT, and WORDBIT.

Referenced by Eb(), Ev(), i_80(), i_c0(), i_d8(), i_f0(), i_f8(), outad1(), and shift().

PRIVATE void outf1  ) 
 

Definition at line 946 of file mdbdis86.c.

References outbyte(), and outustr().

Referenced by i_d8().

PRIVATE void outfishy  ) 
 

Definition at line 968 of file mdbdis86.c.

References outustr().

Referenced by checkmemory(), i_80(), i_88(), i_c0(), i_d0(), outea(), and pagef().

PRIVATE void outgetaddr  ) 
 

Definition at line 973 of file mdbdis86.c.

References finds_data(), get16(), get32(), outh16(), and outh32().

Referenced by outea().

PRIVATE void outimmed opcode_pt  signwordflag  ) 
 

Definition at line 990 of file mdbdis86.c.

References get8s(), Ib(), Iv(), outbyte(), outh8(), SIGNBIT, and WORDBIT.

Referenced by i_60_to_6f(), i_80(), i_a8(), i_c0(), i_f0(), and outea().

PRIVATE void outpc off_t  pc  ) 
 

Definition at line 1015 of file mdbdis86.c.

References finds_pc(), outh16(), and outh32().

Referenced by Jb(), Jv(), and outsegpc().

PRIVATE int outsegaddr struct address_s addr  ) 
 

Definition at line 1518 of file mdbdis86.c.

References outbyte(), outh16(), outh32(), and outsegreg().

Referenced by outssegaddr().

PRIVATE void outsegpc  ) 
 

Definition at line 1029 of file mdbdis86.c.

References address_s::base, get16(), get32(), outbyte(), outh16(), outpc(), pc, and uptr.

Referenced by i_98(), and i_e8().

PRIVATE int outssegaddr struct address_s addr  ) 
 

Definition at line 1541 of file mdbdis86.c.

References outsegaddr(), and outspace().

Referenced by show1instruction().

PRIVATE void oututstr char *  s  ) 
 

Definition at line 1046 of file mdbdis86.c.

References outtab(), and outustr().

Referenced by i_00_to_3f(), i_70_to_7f(), i_80(), i_88(), i_d8(), pagef(), and shift().

PRIVATE void outword  ) 
 

Definition at line 1053 of file mdbdis86.c.

References outustr().

Referenced by i_60_to_6f(), outwptr(), and wdump().

PRIVATE void outwptr  ) 
 

Definition at line 1058 of file mdbdis86.c.

References outustr(), and outword().

Referenced by i_88(), i_d8(), and outbwptr().

PRIVATE void outwsize  ) 
 

Definition at line 1064 of file mdbdis86.c.

References outustr().

Referenced by i_60_to_6f(), i_a0(), i_a8(), and i_c8().

PRIVATE void pagef  ) 
 

Definition at line 1072 of file mdbdis86.c.

References CL, Eb(), Ev(), EvGv(), EvIb(), Ew(), FALSE, get8(), getmodregrm(), Gv(), GvEv(), GvEw(), GvMp(), Ib(), Jv(), Ms(), outbwptr(), outbyte(), outcomma(), outfishy(), outstr(), outustr(), oututstr(), REG_MOD, TOREGBIT, TRUE, and WORDBIT.

Referenced by i_00_to_3f().

PRIVATE u8_t peek_byte off_t  addr  ) 
 

Definition at line 1554 of file mdbdis86.c.

References peek_dword().

Referenced by get8().

PRIVATE u16_t peek_word off_t  addr  ) 
 

Definition at line 1560 of file mdbdis86.c.

References peek_dword().

Referenced by get16().

PRIVATE int puti  ) 
 

Definition at line 1217 of file mdbdis86.c.

References bits32, DSEG, get8(), outbyte(), outh16(), outh32(), outspace(), outtab(), and stringtab().

Referenced by doprnt(), puti(), and show1instruction().

PRIVATE void shift opcode_pt  opc  ) 
 

Definition at line 1273 of file mdbdis86.c.

References CL, getmodregrm(), Ib(), outbwptr(), outbyte(), outcomma(), outea(), and oututstr().

PRIVATE int show1instruction  ) 
 

Definition at line 1440 of file mdbdis86.c.

References bits32, closestring(), column, get8(), maxcol, address_s::off, openstring(), outbyte(), outh8(), outssegaddr(), outstr(), outtab(), puti(), stringpos(), text_symbol(), TRUE, and uptr.

Referenced by dasm().


Variable Documentation

PRIVATE int bits32
 

Definition at line 18 of file mdbdis86.c.

Referenced by dasm(), puti(), and show1instruction().

PRIVATE int data_seg
 

Definition at line 363 of file mdbdis86.c.

PRIVATE char fishy[] = "???"
 

Definition at line 167 of file mdbdis86.c.

PRIVATE char* genreg[]
 

Initial value:

{
 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
}

Definition at line 170 of file mdbdis86.c.

PRIVATE unsigned hasize
 

Definition at line 364 of file mdbdis86.c.

PRIVATE unsigned hdefsize
 

Definition at line 365 of file mdbdis86.c.

PRIVATE unsigned hosize
 

Definition at line 366 of file mdbdis86.c.

PRIVATE char* indreg[]
 

Initial value:

{
 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx",
}

Definition at line 182 of file mdbdis86.c.

PRIVATE opcode_pt mod
 

Definition at line 368 of file mdbdis86.c.

Referenced by imhand(), long2str(), mtrans(), regsub(), test34a(), and test34b().

PRIVATE char movtab[] = "mov\t"
 

Definition at line 168 of file mdbdis86.c.

PRIVATE off_t* off1ptr
 

Definition at line 371 of file mdbdis86.c.

PRIVATE off_t* offptr
 

Definition at line 370 of file mdbdis86.c.

PRIVATE off_t offtable[2]
 

Definition at line 369 of file mdbdis86.c.

PRIVATE pfv_t optable[]
 

Definition at line 131 of file mdbdis86.c.

static char * reg
 

Definition at line 372 of file mdbdis86.c.

Referenced by complete_bars(), cylinderalign(), getAddressing(), isregister(), mtrans(), printregions(), record_bar(), record_bars(), regatom(), regcomp(), scribble_region(), and select_region().

PRIVATE opcode_pt rm
 

Definition at line 373 of file mdbdis86.c.

Referenced by imhand(), and mtrans().

PRIVATE char* segreg[]
 

Initial value:

{
 "es", "cs", "ss", "ds", "fs", "gs", "?s", "?s",
}

Definition at line 177 of file mdbdis86.c.

PRIVATE unsigned char size_d8[]
 

Initial value:

{
 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 14-28, 2, 14-28, 2,
 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 0, 10, 0, 10,
 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 8, 8, 94-108, 0, 94-108, 2,
 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 10, 8, 10, 8,
}

Definition at line 295 of file mdbdis86.c.

PRIVATE char* ssstr_0f[]
 

Initial value:

{
 "sldt\t", "str\t", "lldt\t", "ltr\t", "verr\t", "verw\t", fishy, fishy,
 "sgdt\t", "sidt\t", "lgdt\t", "lidt\t", "smsw\t", fishy, "lmsw\t", fishy,
 fishy, fishy, fishy, fishy, "bt\t", "bts\t", "btr\t", "btc\t",
}

Definition at line 209 of file mdbdis86.c.

PRIVATE char* sstr_00_to_3f[]
 

Initial value:

{
 
 "push\tes", "pop\tes", "push\tcs", "pop\tcs",
 "push\tss", "pop\tss", "push\tds", "pop\tds",
 "es:", "daa", "cs:", "das", "ss:", "aaa", "ds:", "aas",
}

Definition at line 193 of file mdbdis86.c.

PRIVATE char* sstr_0f[]
 

Initial value:

{
 "push\tfs", "pop\tfs", fishy, "bt\t", "shld\t", "shld\t", fishy, fishy,
 "push\tgs", "pop\tgs", fishy, "bts\t", "shrd\t", "shrd\t", fishy, "imul\t",
 fishy, fishy, "lss\t", "btr\t", "lfs\t", "lgs\t", "movzx\t", "movzx\t",
 fishy, fishy, "", "btc\t", "bsf\t", "bsr\t", "movsx\t", "movsx\t",
}

Definition at line 201 of file mdbdis86.c.

PRIVATE char* sstr_d0[]
 

Initial value:

{
 "rol", "ror", "rcl", "rcr", "shl", "shr", fishy, "sar",
}

Definition at line 266 of file mdbdis86.c.

PRIVATE char* sstr_d8[]
 

Initial value:

{
 "fnop", NULL, NULL, NULL,                      
 NULL, NULL, NULL, NULL,
 "fchs", "fabs", NULL, NULL,                    
 "ftst", "fxam", NULL, NULL,
 "fld1", "fldl2t", "fldl2e", "fldpi",           
 "fldlg2", "fldln2", "fldz", NULL,
 "f2xm1", "fyl2x", "fptan", "fpatan",           
 "fxtract", "fprem1", "fdecstp", "fincstp",
 "fprem", "fyl2xp1", "fsqrt", "fsincos",        
 "frndint", "fscale", "fsin", "fcos",
 NULL, "fucompp", NULL, NULL,                   
 NULL, NULL, NULL, NULL,
 "feni", "fdisi", "fclex", "finit",             
 "fsetpm", NULL, NULL, NULL,
 NULL, "fcompp", NULL, NULL,                    
 NULL, NULL, NULL, NULL,
 NULL, NULL, NULL, NULL,                        
 "fstsw\tax", NULL, NULL, NULL,
}

Definition at line 303 of file mdbdis86.c.

PRIVATE char* sstr_f0[]
 

Initial value:

{
 "test\t", fishy, "not\t", "neg\t",
 "mul\t", "imul\t", "div\t", "idiv\t",
}

Definition at line 344 of file mdbdis86.c.

PRIVATE char* sstr_f8[]
 

Initial value:

{
 "inc\t", "dec\t", "call\t", "call\tfar ",
 "jmp\t", "jmp\tfar ", "push\t", "???\t",
}

Definition at line 357 of file mdbdis86.c.

PRIVATE char* str1_d8[]
 

Initial value:

{
 "fadd", "fmul", "fcom", "fcomp", "fsub", "fsubr", "fdiv", "fdivr",
 "fld", "fxch", "\0\0", NULL, "\0\10", "\0\20", "\0\30", "\0\40",
 NULL, NULL, NULL, NULL, NULL, "\0\50", NULL, NULL,
 NULL, NULL, NULL, NULL, "\0\60", NULL, NULL, NULL,
 "fadd", "fmul", NULL, NULL, "fsubr", "fsub", "fdivr", "fdiv",
 "ffree", NULL, "fst", "fstp", "fucom", "fucomp", NULL, NULL,
 "faddp", "fmulp", NULL, "\0\70", "fsubrp", "fsubp", "fdivrp", "fdivp",
 NULL, NULL, NULL, NULL, "\0\100", NULL, NULL, NULL,
}

Definition at line 283 of file mdbdis86.c.

PRIVATE char* str_00_to_3f[]
 

Initial value:

{
 
 "add", "or", "adc", "sbb", "and", "sub", "xor", "cmp",
}

Definition at line 187 of file mdbdis86.c.

PRIVATE char* str_40_to_5f[]
 

Initial value:

{
 
 "inc\t", "dec\t", "push\t", "pop\t",
}

Definition at line 216 of file mdbdis86.c.

PRIVATE char* str_60_to_6f[]
 

Initial value:

{
 "pusha", "popa", "bound\t", "arpl\t", "fs:", "gs:", "os:", "as:",
 "push\t", "imul\t", "push\t", "imul\t", "insb", "ins", "outsb", "outs",
}

Definition at line 222 of file mdbdis86.c.

PRIVATE char* str_98[]
 

Initial value:

{
 "cbw", "cwd", "call\t", "wait", "pushf", "popf", "sahf", "lahf",
 "cwde", "cdq", "call\t", "wait", "pushfd", "popfd", "sahf", "lahf",
}

Definition at line 235 of file mdbdis86.c.

PRIVATE char* str_a0[]
 

Initial value:

{
 movtab, movtab, movtab, movtab, "movsb", "movs", "cmpsb", "cmps",
}

Definition at line 241 of file mdbdis86.c.

PRIVATE char* str_a8[]
 

Initial value:

{
 "test\t", "test\t", "stosb", "stos", "lodsb", "lods", "scasb", "scas",
}

Definition at line 246 of file mdbdis86.c.

PRIVATE char* str_c0[]
 

Initial value:

{
 "", "", "ret\t", "ret", "les\t", "lds\t", movtab, movtab,
}

Definition at line 251 of file mdbdis86.c.

PRIVATE char* str_c8[]
 

Initial value:

{
 "enter\t", "leave", "retf\t", "retf", "int\t3", "int\t", "into", "iret",
}

Definition at line 256 of file mdbdis86.c.

PRIVATE char* str_d0[]
 

Initial value:

{
 "aam", "aad", "db\td6", "xlat",
}

Definition at line 261 of file mdbdis86.c.

PRIVATE char* str_d8[]
 

Initial value:

{
 "fadd", "fmul", "fcom", "fcomp", "fsub", "fsubr", "fdiv", "fdivr",
 "fld", NULL, "fst", "fstp", "fldenv", "fldcw", "fstenv", "fstcw",
 "fiadd", "fimul", "ficom", "ficomp", "fisub", "fisubr", "fidiv", "fidivr",
 "fild", NULL, "fist", "fistp", NULL, "fld", NULL, "fstp",
 "fadd", "fmul", "fcom", "fcomp", "fsub", "fsubr", "fdiv", "fdivr",
 "fld", NULL, "fst", "fstp", "frstor", NULL, "fsave", "fstsw",
 "fiadd", "fimul", "ficom", "ficomp", "fisub", "fisubr", "fidiv", "fidivr",
 "fild", NULL, "fist", "fistp", "fbld", "fild", "fbstp", "fistp",
}

Definition at line 271 of file mdbdis86.c.

PRIVATE char* str_e0[]
 

Initial value:

{
 "loopnz\t", "loopz\t", "loop\t", "jcxz\t",
 "in\t", "in\t", "out\t", "out\t",
}

Definition at line 325 of file mdbdis86.c.

PRIVATE char* str_e8[]
 

Initial value:

{
 "call\t", "jmp\t", "jmp\t", "jmp\t",
 "in\t", "in\t", "out\t", "out\t",
}

Definition at line 331 of file mdbdis86.c.

PRIVATE char* str_f0[]
 

Initial value:

{
 "lock\t", "db\tf1", "repnz\t", "repz\t",
 "hlt", "cmc",
 
}

Definition at line 337 of file mdbdis86.c.

PRIVATE char* str_f8[]
 

Initial value:

{
 "clc", "stc", "cli", "sti",
 "cld", "std",
 
}

Definition at line 350 of file mdbdis86.c.

PRIVATE char* str_flags[]
 

Initial value:

{
 
 "o", "no", "b", "nb", "z", "nz", "be", "a",
 "s", "ns", "pe", "po", "l", "ge", "le", "g",
}

Definition at line 228 of file mdbdis86.c.

PRIVATE struct address_s uptr
 

Definition at line 19 of file mdbdis86.c.

Referenced by dasm(), get16(), get32(), get8(), Jb(), Jv(), outsegpc(), and show1instruction().


Generated on Fri Apr 14 23:05:25 2006 for minix by  doxygen 1.4.6