42 .after_relative = operand.as_ff(),
43 .resolved_operand = operand,
58 bool has_relative_address =
false;
61 has_relative_address =
true;
68 bool base_address_invalid =
false;
70 if (has_relative_address) {
71 base_address =
memory.get(0);
72 event.base_address = *base_address;
74 if (!
memory.is_valid_address(*base_address)) {
75 base_address_invalid =
true;
83 auto& resolution_info =
event.resolution_info[i];
98 if (base_address_invalid) {
109 auto offset =
static_cast<uint64_t
>(resolution_info.after_relative);
114 resolution_info.after_relative =
FF(
offset);
134 const auto after_relative_address =
static_cast<MemoryAddress>(resolution_info.after_relative);
135 resolution_info.resolved_operand =
Operand::from(after_relative_address);
137 resolution_info.resolved_operand =
memory.get(after_relative_address);
139 if (!
memory.is_valid_address(resolution_info.resolved_operand)) {
150 debug(
"Base address: ",
event.base_address.to_string());
151 debug(
"After relative: ", resolution_info.after_relative);
152 debug(
"Resolved operand: ", resolution_info.resolved_operand.to_string());
153 resolution_info.error = e;
160 if (std::ranges::any_of(
event.resolution_info, [](
const auto&
info) { return info.error.has_value(); })) {
168 resolved_operands.reserve(
event.resolution_info.size());
169 for (
const auto&
info :
event.resolution_info) {
170 resolved_operands.push_back(
info.resolved_operand);
172 return resolved_operands;
std::vector< Operand > resolve(const Instruction &instruction, MemoryInterface &memory) override
Resolve the operands of an instruction. If the operands are non-addresses, they are returned as is....