Mercurial > repos > blastem
diff upd78k2_dis.h @ 2717:04007ac9ee3b
Add upd78k2 disassembler
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 16 Jul 2025 07:36:01 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/upd78k2_dis.h Wed Jul 16 07:36:01 2025 -0700 @@ -0,0 +1,28 @@ +#ifndef UPD78K2_DIS_H_ +#define UPD78K2_DIS_H_ +#include <stdint.h> +#include "disasm.h" + +enum { + UPD_REF_NONE, + UPD_REF_OP, + UPD_REF_2OP, + UPD_REF_BRANCH, + UPD_REF_COND_BRANCH, + UPD_REF_OP_BRANCH, + UPD_REF_CALL, + UPD_REF_CALL_TABLE +}; + +typedef struct { + uint16_t address; + uint16_t address2; + uint8_t ref_type; +} upd_address_ref; + +typedef uint8_t (*upd_fetch_fun)(uint16_t address, void *data); + +uint16_t upd78k2_disasm(char *dst, upd_address_ref *ref, uint16_t address, upd_fetch_fun fetch, void *data, disasm_context *context); + + +#endif //UPD78K2_DIS_H_