| e8555c89 Andy McCall |
1 |
#ifndef DASM_HH |
| 2 |
#define DASM_HH |
| 3 |
|
| 4 |
#include "EmuTime.hh" |
| 5 |
|
| 6 |
#include "function_ref.hh" |
| 7 |
|
| 8 |
#include <cstdint> |
| 9 |
#include <functional> |
| 10 |
#include <span> |
| 11 |
#include <string> |
| 12 |
|
| 13 |
namespace openmsx { |
| 14 |
|
| 15 |
class MSXCPUInterface; |
| 16 |
|
| 17 |
void appendAddrAsHex(std::string& output, uint16_t addr); |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
std::optional<unsigned> instructionLength(std::span<const uint8_t> bin); |
| 27 |
|
| 28 |
std::span<uint8_t> fetchInstruction(const MSXCPUInterface& interface, uint16_t addr, |
| 29 |
std::span<uint8_t, 4> buffer, EmuTime time); |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
unsigned dasm(std::span<const uint8_t> opcode, uint16_t pc, std::string& dest, |
| 41 |
function_ref<void(std::string&, uint16_t)> appendAddr = &appendAddrAsHex); |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
unsigned dasm(const MSXCPUInterface& interface, uint16_t pc, std::span<uint8_t, 4> buf, |
| 53 |
std::string& dest, EmuTime time, |
| 54 |
function_ref<void(std::string&, uint16_t)> appendAddr = &appendAddrAsHex); |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
uint16_t instructionBoundary(const MSXCPUInterface& interface, uint16_t addr, |
| 75 |
EmuTime time); |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
uint16_t nInstructionsBefore(const MSXCPUInterface& interface, uint16_t addr, |
| 86 |
EmuTime time, int n); |
| 87 |
|
| 88 |
} |
| 89 |
|
| 90 |
#endif |