Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* some defines for extracting instruction bit fields from bytes */
  2.  
  3. #define MOD(a)    (((a)>>6)&3)
  4.  
  5. #define REG(a)    (((a)>>3)&7)
  6.  
  7. #define RM(a)     ((a)&7)
  8.  
  9. #define SCALE(a)  (((a)>>6)&3)
  10.  
  11. #define INDEX(a)  (((a)>>3)&7)
  12.  
  13. #define BASE(a)   ((a)&7)
  14.  
  15.  
  16.  
  17. typedef union{
  18.  
  19.   struct{
  20.  
  21.     unsigned short ofs;
  22.  
  23.     unsigned short seg;
  24.  
  25.   }w;
  26.  
  27.   unsigned long dword;
  28.  
  29. }WORD32;
  30.  
  31.  
  32.  
  33. /* prototypes */
  34.  
  35. void ua_str(char *);
  36.  
  37. unsigned char getbyte(void);
  38.  
  39. int modrm();
  40.  
  41. int sib();
  42.  
  43. void uprintf(char *, ...);
  44.  
  45. void uputchar(char );
  46.  
  47. int bytes(char );
  48.  
  49. void outhex(char , int , int , int , int );
  50.  
  51. void reg_name(int , char );
  52.  
  53. void do_sib(int );
  54.  
  55. void do_modrm(char );
  56.  
  57. void floating_point(int );
  58.  
  59. void percent(char , char );
  60.  
  61. void undata(unsigned ofs,unsigned long len,unsigned int type);
  62.  
  63.  
  64.  
  65.