From f0b568d9d710e329da51213dfd53c98b9e49528b Mon Sep 17 00:00:00 2001 From: Oxore Date: Tue, 9 May 2023 14:25:34 +0300 Subject: Refactor: return node size, remove settings from disasm functions --- disasm.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'disasm.h') diff --git a/disasm.h b/disasm.h index e6ca13c..5a40462 100644 --- a/disasm.h +++ b/disasm.h @@ -5,6 +5,7 @@ #include #include +#include enum class OpCode: uint8_t { kNone = 0, @@ -217,7 +218,13 @@ struct DisasmNode { SizeSpec size_spec{SizeSpec::kNone}; Condition condition{Condition::kT}; ///< For Scc, Bcc and Dbcc Arg args[2]{}; ///< Should replace `arguments` field - void Disasm(const DataBuffer &code, const Settings&); + + /*! Disassembles instruction with arguments + * returns size of whole instruction with arguments in bytes + */ + size_t Disasm(const DataBuffer &code); + int FPrintf(FILE*, const Settings&); + int SNPrintf(char *buf, size_t bufsz, const Settings&); void AddReferencedBy(uint32_t offset, ReferenceType); ~DisasmNode(); private: -- cgit v1.2.3