CS350 COS
COS
|
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/kassert.h>
#include <sys/kdebug.h>
Go to the source code of this file.
Data Structures | |
struct | inst |
struct | finst |
struct | i_addr |
Macros | |
#define | DB_STGY_ANY 0 |
#define | DB_STGY_XTRN 1 |
#define | DB_STGY_PROC 2 |
#define | TRUE 1 |
#define | FALSE 0 |
#define | BYTE 0 |
#define | WORD 1 |
#define | LONG 2 |
#define | QUAD 3 |
#define | SNGL 4 |
#define | DBLR 5 |
#define | EXTR 6 |
#define | SDEP 7 |
#define | ADEP 8 |
#define | ESC 9 |
#define | NONE 10 |
#define | REX_B 1 |
#define | REX_X 2 |
#define | REX_R 4 |
#define | REX_W 8 |
#define | REX 0x40 |
#define | E 1 /* general effective address */ |
#define | Eind 2 /* indirect address (jump, call) */ |
#define | Ew 3 /* address, word size */ |
#define | Eb 4 /* address, byte size */ |
#define | R 5 /* register, in 'reg' field */ |
#define | Rw 6 /* word register, in 'reg' field */ |
#define | Rq 39 /* quad register, in 'reg' field */ |
#define | Ri 7 /* register in instruction */ |
#define | S 8 /* segment reg, in 'reg' field */ |
#define | Si 9 /* segment reg, in instruction */ |
#define | A 10 /* accumulator */ |
#define | BX 11 /* (bx) */ |
#define | CL 12 /* cl, for shifts */ |
#define | DX 13 /* dx, for IO */ |
#define | SI 14 /* si */ |
#define | DI 15 /* di */ |
#define | CR 16 /* control register */ |
#define | DR 17 /* debug register */ |
#define | TR 18 /* test register */ |
#define | I 19 /* immediate, unsigned */ |
#define | Is 20 /* immediate, signed */ |
#define | Ib 21 /* byte immediate, unsigned */ |
#define | Ibs 22 /* byte immediate, signed */ |
#define | Iw 23 /* word immediate, unsigned */ |
#define | Ilq 24 /* long/quad immediate, unsigned */ |
#define | O 25 /* direct address */ |
#define | Db 26 /* byte displacement from EIP */ |
#define | Dl 27 /* long displacement from EIP */ |
#define | o1 28 /* constant 1 */ |
#define | o3 29 /* constant 3 */ |
#define | OS 30 /* immediate offset/segment */ |
#define | ST 31 /* FP stack top */ |
#define | STI 32 /* FP stack */ |
#define | X 33 /* extended FP op */ |
#define | XA 34 /* for 'fstcw %ax' */ |
#define | El 35 /* address, long/quad size */ |
#define | Ril 36 /* long register in instruction */ |
#define | Iba 37 /* byte immediate, don't print if 0xa */ |
#define | EL 38 /* address, explicitly long size */ |
#define | op1(x) (x) |
#define | op2(x, y) ((x)|((y)<<8)) |
#define | op3(x, y, z) ((x)|((y)<<8)|((z)<<16)) |
#define | f_mod(rex, byte) ((byte)>>6) |
#define | f_reg(rex, byte) ((((byte)>>3)&0x7) | (rex & REX_R ? 0x8 : 0x0)) |
#define | f_rm(rex, byte) (((byte)&0x7) | (rex & REX_B ? 0x8 : 0x0)) |
#define | sib_ss(rex, byte) ((byte)>>6) |
#define | sib_index(rex, byte) ((((byte)>>3)&0x7) | (rex & REX_X ? 0x8 : 0x0)) |
#define | sib_base(rex, byte) (((byte)&0x7) | (rex & REX_B ? 0x8 : 0x0)) |
#define | get_value_inc(result, loc, size, is_signed) |
Functions | |
static uintptr_t | db_disasm_esc (uintptr_t loc, int inst, int rex, int short_addr, int size, const char *seg) |
static void | db_print_address (const char *seg, int size, int rex, struct i_addr *addrp) |
static uintptr_t | db_read_address (uintptr_t loc, int short_addr, int rex, int regmodrm, struct i_addr *addrp) |
uintptr_t | db_disasm (uintptr_t loc, bool altfmt) |
Variables | |
static const struct inst | db_inst_0f388x [] |
static const struct inst *const | db_inst_0f38 [] |
static const char *const | db_Grp6 [] |
static const char *const | db_Grp7 [] |
static const char *const | db_Grp8 [] |
static const char *const | db_Grp9 [] |
static const char *const | db_Grp15 [] |
static const char *const | db_Grp15b [] |
static const struct inst | db_inst_0f0x [] |
static const struct inst | db_inst_0f2x [] |
static const struct inst | db_inst_0f3x [] |
static const struct inst | db_inst_0f4x [] |
static const struct inst | db_inst_0f7x [] |
static const struct inst | db_inst_0f8x [] |
static const struct inst | db_inst_0f9x [] |
static const struct inst | db_inst_0fax [] |
static const struct inst | db_inst_0fbx [] |
static const struct inst | db_inst_0fcx [] |
static const struct inst *const | db_inst_0f [] |
static const char *const | db_Esc92 [] |
static const char *const | db_Esc94 [] |
static const char *const | db_Esc95 [] |
static const char *const | db_Esc96 [] |
static const char *const | db_Esc97 [] |
static const char *const | db_Esca5 [] |
static const char *const | db_Escb4 [] |
static const char *const | db_Esce3 [] |
static const char *const | db_Escf4 [] |
static const struct finst | db_Esc8 [] |
static const struct finst | db_Esc9 [] |
static const struct finst | db_Esca [] |
static const struct finst | db_Escb [] |
static const struct finst | db_Escc [] |
static const struct finst | db_Escd [] |
static const struct finst | db_Esce [] |
static const struct finst | db_Escf [] |
static const struct finst *const | db_Esc_inst [] |
static const char *const | db_Grp1 [] |
static const char *const | db_Grp2 [] |
static const struct inst | db_Grp3 [] |
static const struct inst | db_Grp4 [] |
static const struct inst | db_Grp5 [] |
static const struct inst | db_inst_table [256] |
static const struct inst | db_bad_inst |
static const char *const | db_reg [2][4][16] |
static const char *const | db_seg_reg [8] |
static const int | db_lengths [] |
struct inst |
struct finst |
struct i_addr |
#define f_reg | ( | rex, | |
byte | |||
) | ((((byte)>>3)&0x7) | (rex & REX_R ? 0x8 : 0x0)) |
#define f_rm | ( | rex, | |
byte | |||
) | (((byte)&0x7) | (rex & REX_B ? 0x8 : 0x0)) |
#define get_value_inc | ( | result, | |
loc, | |||
size, | |||
is_signed | |||
) |
#define sib_base | ( | rex, | |
byte | |||
) | (((byte)&0x7) | (rex & REX_B ? 0x8 : 0x0)) |
#define sib_index | ( | rex, | |
byte | |||
) | ((((byte)>>3)&0x7) | (rex & REX_X ? 0x8 : 0x0)) |
Definition at line 1186 of file disasm.c.
|
static |
Definition at line 1095 of file disasm.c.
|
static |
Definition at line 1067 of file disasm.c.
|
static |
Definition at line 1004 of file disasm.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |