//--- // fxos.disassembly: Disassembler //--- #ifndef LIBFXOS_DISASSEMBLY_H #define LIBFXOS_DISASSEMBLY_H #include #include #include #include namespace FxOS { /* Register an instruction. @inst Instruction with [opcode] set to the binary pattern Typically this is called by loader functions from data tables describing instructions with parameters, not manually. See . */ void register_instruction(Instruction ins); /* A loaded instruction with all relevant information, and more. */ class LoadedInstruction { private: /* What instruction it is */ Instruction &m_inst; /* Operands for arguments, if they have been determined */ std::vector> args; /* Jump targets, used for jump instructions only. The first jmp is for unconditional jumps; jmpt and jmpf are for conditional jumps. In many situations the jump is forced on a general instruction by a preceding branch due to the delay slot mechanism. */ union { uint32_t jmp, jmpt; }; uint32_t jmpf; }; } /* namespace FxOS */ #endif /* LIBFXOS_DISASSEMBLY_H */