Backport Shrooms2 disassembler
This commit is contained in:
+20
-2
@@ -46,14 +46,21 @@ VBUAPI int vbuCodeSize(VB *sim, uint32_t address) {
|
||||
}
|
||||
|
||||
/* Initialize disassembler options with default settings */
|
||||
VBUAPI VBU_DasmConfig* vbuDasmInit(VBU_DasmConfig *config) {
|
||||
VBUAPI VBU_DasmConfig* vbuDasmDefaults(VBU_DasmConfig *config) {
|
||||
|
||||
/* Error checking */
|
||||
if (config == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Supply default configuration */
|
||||
config->bcondNotation = VBU_JOINED;
|
||||
config->branchNotation = VBU_ABSOLUTE;
|
||||
config->conditionCase = VBU_LOWER;
|
||||
config->conditionCL = VBU_L;
|
||||
config->conditionEZ = VBU_Z;
|
||||
config->conditionNotation = VBU_NAMES;
|
||||
config->hexCase = VBU_UPPER;
|
||||
config->hexNotation = VBU_0X;
|
||||
config->hexNotation = VBU_PREFIX_0X;
|
||||
config->immediateNotation = VBU_NONE;
|
||||
config->memoryNotation = VBU_OUTSIDE;
|
||||
config->mnemonicCase = VBU_UPPER;
|
||||
@@ -69,6 +76,17 @@ VBUAPI VBU_DasmConfig* vbuDasmInit(VBU_DasmConfig *config) {
|
||||
/* Disassemble from a simulation */
|
||||
VBUAPI VBU_DasmLine* vbuDisassemble(VB *sim, uint32_t address,
|
||||
VBU_DasmConfig *config, unsigned length, int line) {
|
||||
VBU_DasmConfig defs; /* Default settings */
|
||||
|
||||
/* Error checking */
|
||||
if (sim == NULL || length == 0)
|
||||
return NULL;
|
||||
|
||||
/* Supply default configuration */
|
||||
if (config == NULL)
|
||||
config = vbuDasmDefaults(&defs);
|
||||
|
||||
/* Disassemble instructions */
|
||||
return dasmDisassemble(sim, address, config, length, line);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user