#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdarg.h>#include <ctype.h>#include <stdint.h>#include "starcpu.h"#include "cpudebug.h"Macros | |
| #define | byte uint8_t |
| #define | word uit16_t |
| #define | dword uint32_t |
| #define | int08 int8_t |
| #define | int16 int16_t |
| #define | int32 int32_t |
| #define | ea eacalc[inst&0x3F]() |
| #define | hex08 "%02X" |
| #define | hex16 "%04X" |
| #define | hex32 "%08X" |
| #define | hexlong "%06X" |
| #define | isregister ((inst&0x0030)==0x0000) |
| #define | isaddressr ((inst&0x0038)==0x0008) |
| #define | eacalc_drd(n, r) static void n(void){sprintf(eabuffer,"d%d",r);} |
| #define | eacalc_ard(n, r) static void n(void){sprintf(eabuffer,"a%d",r);} |
| #define | eacalc_ari(n, r) static void n(void){sprintf(eabuffer,"(a%d)",r);} |
| #define | eacalc_ari_inc(n, r) static void n(void){sprintf(eabuffer,"(a%d)+",r);} |
| #define | eacalc_ari_dec(n, r) static void n(void){sprintf(eabuffer,"-(a%d)",r);} |
| #define | eacalc_ari_dis(n, r) |
| #define | eacalc_ari_ind(n, r) |
| #define | bittest_st(name, dump) |
| #define | conditional_branch(name, dump) |
| #define | scc_dbcc(name, dump1, dump2) |
| #define | negate_ea(name, dump) |
| #define | im_to_ea(name, type, hextype, fetchtype, dump, r) |
| #define | ea_to_dn(name, dump) |
| #define | ea_to_an(name, dump) |
| #define | support_addsubx(name, dump) |
| #define | support_bcd(name, dump) |
| #define | support_cmpm(name, dump) |
| #define | dn_to_ea(name, dump, s_cond, s_routine) |
| #define | qn_to_ea(name, dump1) |
| #define | ea_to_ea(name, dump) |
| #define | movem_mem(name, dumpm, dumpx) |
| #define | movem_reg(name, dump) |
| #define | regshift(name, sizedump) |
Functions | |
| static void | cpudebug_gets (char *s, int n) |
| static void | cpudebug_putc (char c) |
| static void | cpudebug_printf (const char *fmt,...) |
| int | cpudebug_disabled (void) |
| static word | fetch (void) |
| static dword | fetchl (void) |
| eacalc_drd (ea_0_0, 0) | |
| static void | eacalcspecial_abslong (void) |
| static void | eacalcspecial_immdata (void) |
| static void | eacalcspecial_pci_dis (void) |
| static void | eacalcspecial_pci_ind (void) |
| static void | eacalcspecial_unknown (void) |
| static void | eacalc (void) |
| static void | m68unsupported (void) |
| static void | m68_unrecog_x (void) |
| static void | m68_bitopdn_x (void) |
| bittest_st (m68_btst_st_x,"btst") | |
| static void | m68_jsr_____x (void) |
| static void | m68_bsr_____x (void) |
| static void | m68_tas_____b (void) |
| static void | m68_lea___n_l (void) |
| static void | m68_pea_____l (void) |
| negate_ea (m68_neg_____b,"neg.b ") | |
| static void | m68support_exg_diff (void) |
| dn_to_ea (m68_add_e_n_b,"add.b", dn_to_ea(isregister, m68support_addx_b) | |
| ea_to_ea (m68_move____b,"move.b") | |
| static void | getreglistb (word mask, char *rl) |
| movem_mem (m68_movem___w,"movem ","ext ") | |
| static void | m68_movefsr_w (void) |
| static void | m68_move2cc_w (void) |
| static void | m68_movefcc_w (void) |
| static void | m68_rts_____x (void) |
| regshift (m68_shl_r_n_b,"l.b") | |
| static void | m68_link_an_w (void) |
| static void | m68_unlk_an_x (void) |
| static void | m68_stop____x (void) |
| static void | m68_rte_____x (void) |
| static void | m68_rtr_____x (void) |
| static void | m68_reset___x (void) |
| static void | m68_rtd_____x (void) |
| static void | m68_divu__n_w (void) |
| static void | m68_divs__n_w (void) |
| static void | m68_mulu__n_w (void) |
| static void | m68_muls__n_w (void) |
| static void | m68_asr_m___w (void) |
| static void | m68_asl_m___w (void) |
| static void | m68_lsr_m___w (void) |
| static void | m68_lsl_m___w (void) |
| static void | m68_roxr_m__w (void) |
| static void | m68_roxl_m__w (void) |
| static void | m68_ror_m___w (void) |
| static void | m68_rol_m___w (void) |
| static void | m68_nbcd____b (void) |
| static void | m68_chk___n_w (void) |
| static void | m68_trap_nn_x (void) |
| static void | m68_move_2u_l (void) |
| static void | m68_move_fu_l (void) |
| static void | m68_trapv___x (void) |
| static char * | specialregister (unsigned short int code) |
| static void | m68_movec_r_x (void) |
| static void | m68_movec_c_x (void) |
| static void | debugspecialmap (void) |
| static void | m68_special_x (void) |
| static void | debugmap (void) |
| static void | cpudebug_disassemble (int n) |
| static void | cpudebug_hexdump (void) |
| static void | cpudebug_registerdump (void) |
| int | cpudebug_interactive (int cpun, void(*put)(const char *), void(*get)(char *, int), void(*execstep)(void), void(*dump)(void)) |
Variables | |
| void(* | cpudebug_get )(char *, int) |
| void(* | cpudebug_put )(const char *) |
| static char | eabuffer [20] |
| static char | sdebug [80] |
| static dword | debugpc |
| static dword | hexaddr |
| static int | isize |
| static word | inst |
| static int08 | opsize [1024] |
| #define bittest_st | ( | name, | |
| dump | |||
| ) |
| #define byte uint8_t |
| #define conditional_branch | ( | name, | |
| dump | |||
| ) |
| #define dn_to_ea | ( | name, | |
| dump, | |||
| s_cond, | |||
| s_routine | |||
| ) |
| #define dword uint32_t |
| #define ea_to_an | ( | name, | |
| dump | |||
| ) |
| #define ea_to_dn | ( | name, | |
| dump | |||
| ) |
| #define ea_to_ea | ( | name, | |
| dump | |||
| ) |
| #define eacalc_ard | ( | n, | |
| r | |||
| ) | static void n(void){sprintf(eabuffer,"a%d",r);} |
| #define eacalc_ari | ( | n, | |
| r | |||
| ) | static void n(void){sprintf(eabuffer,"(a%d)",r);} |
| #define eacalc_ari_dec | ( | n, | |
| r | |||
| ) | static void n(void){sprintf(eabuffer,"-(a%d)",r);} |
| #define eacalc_ari_dis | ( | n, | |
| r | |||
| ) |
| #define eacalc_ari_inc | ( | n, | |
| r | |||
| ) | static void n(void){sprintf(eabuffer,"(a%d)+",r);} |
| #define eacalc_ari_ind | ( | n, | |
| r | |||
| ) |
| #define eacalc_drd | ( | n, | |
| r | |||
| ) | static void n(void){sprintf(eabuffer,"d%d",r);} |
| #define hex08 "%02X" |
| #define hex16 "%04X" |
| #define hex32 "%08X" |
| #define hexlong "%06X" |
| #define int08 int8_t |
| #define int16 int16_t |
| #define int32 int32_t |
| #define isaddressr ((inst&0x0038)==0x0008) |
| #define isregister ((inst&0x0030)==0x0000) |
| #define movem_mem | ( | name, | |
| dumpm, | |||
| dumpx | |||
| ) |
| #define movem_reg | ( | name, | |
| dump | |||
| ) |
| #define negate_ea | ( | name, | |
| dump | |||
| ) |
| #define qn_to_ea | ( | name, | |
| dump1 | |||
| ) |
| #define regshift | ( | name, | |
| sizedump | |||
| ) |
| #define scc_dbcc | ( | name, | |
| dump1, | |||
| dump2 | |||
| ) |
| #define support_addsubx | ( | name, | |
| dump | |||
| ) |
| #define support_bcd | ( | name, | |
| dump | |||
| ) |
| #define support_cmpm | ( | name, | |
| dump | |||
| ) |
| #define word uit16_t |
| bittest_st | ( | m68_btst_st_x | , |
| "btst" | |||
| ) |
| int cpudebug_disabled | ( | void | ) |
|
static |
|
static |
|
static |
| int cpudebug_interactive | ( | int | cpun, |
| void(*)(const char *) | put, | ||
| void(*)(char *, int) | get, | ||
| void(*)(void) | execstep, | ||
| void(*)(void) | dump | ||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| dn_to_ea | ( | m68_add_e_n_b | , |
| "add.b" | , | ||
| dn_to_ea( | isregister, | ||
| m68support_addx_b | |||
| ) |
| ea_to_ea | ( | m68_move____b | , |
| "move.b" | |||
| ) |
|
static |
| eacalc_drd | ( | ea_0_0 | , |
| 0 | |||
| ) |
|
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 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| movem_mem | ( | m68_movem___w | , |
| "movem " | , | ||
| "ext " | |||
| ) |
| negate_ea | ( | m68_neg_____b | , |
| "neg.b " | |||
| ) |
| regshift | ( | m68_shl_r_n_b | , |
| "l.b" | |||
| ) |
|
static |
| void(* cpudebug_get)(char *, int) |
| void(* cpudebug_put)(const char *) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
1.8.1.1