openMSX
Dasm.hh
Go to the documentation of this file.
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
13namespace openmsx {
14
15class MSXCPUInterface;
16
17void appendAddrAsHex(std::string& output, uint16_t addr);
18
28unsigned dasm(const MSXCPUInterface& interface, uint16_t pc, std::span<uint8_t, 4> buf,
29 std::string& dest, EmuTime::param time,
30 function_ref<void(std::string&, uint16_t)> appendAddr = &appendAddrAsHex);
31
39unsigned instructionLength(const MSXCPUInterface& interface, uint16_t pc,
40 EmuTime::param time);
41
60uint16_t instructionBoundary(const MSXCPUInterface& interface, uint16_t addr,
61 EmuTime::param time);
62
71uint16_t nInstructionsBefore(const MSXCPUInterface& interface, uint16_t addr,
72 EmuTime::param time, int n);
73
74} // namespace openmsx
75
76#endif
This file implemented 3 utility functions:
Definition Autofire.cc:11
unsigned dasm(const MSXCPUInterface &interface, uint16_t pc, std::span< uint8_t, 4 > buf, std::string &dest, EmuTime::param time, function_ref< void(std::string &, uint16_t)> appendAddr)
Disassemble.
Definition Dasm.cc:26
uint16_t instructionBoundary(const MSXCPUInterface &interface, uint16_t addr, EmuTime::param time)
This is only an heuristic to display instructions in a debugger disassembly view.
Definition Dasm.cc:175
uint16_t nInstructionsBefore(const MSXCPUInterface &interface, uint16_t addr, EmuTime::param time, int n)
Get the start address of the 'n'th instruction before the instruction containing the byte at the give...
Definition Dasm.cc:182
unsigned instructionLength(const MSXCPUInterface &interface, uint16_t pc, EmuTime::param time)
Calculate the length of the instruction at the given address.
Definition Dasm.cc:114
void appendAddrAsHex(std::string &output, uint16_t addr)
Definition Dasm.cc:21