summaryrefslogtreecommitdiff
path: root/disasm.h
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-05-20 14:42:01 +0300
committerOxore <oxore@protonmail.com>2023-05-20 14:42:01 +0300
commitdc752c3b87cb998f194ab81f6f8fbdf490374474 (patch)
tree7fbaedf8c5fdf6e11f237d565dc050fc3f6b2a37 /disasm.h
parent935f386f61b63267bd6516a1888cf939b8eef238 (diff)
Impl data references, debuting with LEA
Diffstat (limited to 'disasm.h')
-rw-r--r--disasm.h22
1 files changed, 12 insertions, 10 deletions
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{};