Add vbuCodeSize()
This commit is contained in:
@@ -38,6 +38,12 @@ static int32_t SignExtend(int32_t value, int32_t bits) {
|
||||
|
||||
/******************************* API Commands ********************************/
|
||||
|
||||
/* Determine the size in bytes of an instruction */
|
||||
VBUAPI int vbuCodeSize(VB *sim, uint32_t address) {
|
||||
int opcode = vbRead(sim, address, VB_U16) >> 10 & 63;
|
||||
return opcode < 0x20 || opcode == 0x32 || opcode == 0x36 ? 2 : 4;
|
||||
}
|
||||
|
||||
/* Initialize disassembler options with default settings */
|
||||
VBUAPI VBU_DasmConfig* vbuDasmInit(VBU_DasmConfig *config) {
|
||||
config->bcondNotation = VBU_JOINED;
|
||||
|
||||
Reference in New Issue
Block a user