cpu/{arm|thumb}(chore): change how branch disassembly happens
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include "cpu/arm/instruction.hh"
|
||||
#include "util/bits.hh"
|
||||
#include <format>
|
||||
#include <string>
|
||||
|
||||
namespace matar::arm {
|
||||
std::string
|
||||
@@ -13,9 +12,11 @@ Instruction::disassemble() {
|
||||
[condition](BranchAndExchange& data) {
|
||||
return std::format("BX{} R{:d}", condition, data.rn);
|
||||
},
|
||||
[condition](Branch& data) {
|
||||
return std::format(
|
||||
"B{}{} 0x{:06X}", (data.link ? "L" : ""), condition, data.offset);
|
||||
[condition](Branch& data) {
|
||||
return std::format("B{}{} {:#06x}",
|
||||
(data.link ? "L" : ""),
|
||||
condition,
|
||||
static_cast<int32_t>(data.offset + 2 * INSTRUCTION_SIZE));
|
||||
},
|
||||
[condition](Multiply& data) {
|
||||
if (data.acc) {
|
||||
|
||||
Reference in New Issue
Block a user