From dc752c3b87cb998f194ab81f6f8fbdf490374474 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 20 May 2023 14:42:01 +0300 Subject: Impl data references, debuting with LEA --- disasm.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'disasm.h') diff --git a/disasm.h b/disasm.h index 925925c..1b0dd7a 100644 --- a/disasm.h +++ b/disasm.h @@ -297,7 +297,7 @@ struct Arg { int SNPrint( char *buf, size_t bufsz, - unsigned ref_kinds = 0, + RefKindMask ref_kinds = 0, uint32_t self_addr = 0, uint32_t ref_addr = 0) const; }; @@ -314,8 +314,10 @@ constexpr size_t kArgsBufferSize = 80; enum class ReferenceType { kUnknown = 0, - kBranch, kCall, + kBranch, + kRead, + kWrite, }; struct ReferenceRecord { @@ -350,9 +352,10 @@ struct Op { } int FPrint( FILE *, - unsigned ref_kinds = 0, + RefKindMask ref_kinds = 0, uint32_t self_addr = 0, - uint32_t ref_addr = 0) const; + uint32_t ref1_addr = 0, + uint32_t ref2_addr = 0) const; }; struct DisasmNode { @@ -362,12 +365,11 @@ struct DisasmNode { /// Instruction size in bytes size_t size{kInstructionSizeStepBytes}; /// Indicates whether `ref_addr` should be interpreted and how - bool has_ref{}; - /// Absolute address of where to branch to - uint32_t ref_addr{}; - /// Indicates whether instruction is a call (BSR, JSR) or just a branch - /// (Bcc, JMP) if `has_branch_addr` is set - bool is_call{}; + RefKindMask ref_kinds{}; + /// Absolute address of reference + uint32_t ref1_addr{}; + /// Absolute address of reference + uint32_t ref2_addr{}; ReferenceNode *ref_by{}; ReferenceNode *last_ref_by{}; Op op{}; -- cgit v1.2.3