libvm68k API

Data types

Header <vm68k/data> defines fundamental data types on the VM68000 architecture.

class byte

This represents byte data on the VM68000 architecture. A byte is 8-bit wide.

This type is trivial and standard-layout.

using int_type = std::int8_t
using uint_type = std::uint8_t

Signed and unsigned integer types this class can store values, respectively.

static constexpr std::size_t size() noexcept

Returns the size of a byte value on the architecture, which is always 1.

byte() = default

Constructs a byte object with its default value.

This constructor is explicitly defaulted.

explicit constexpr byte(std::uint8_t value) noexcept

Constructs a byte object with an initial value.

void swap(byte &other) noexcept

This function swaps the value of the object with another one.

constexpr std::int8_t to_int() const noexcept
constexpr std::uint8_t to_uint() const noexcept

These functions return the interpretations of the object as signed and unsigned integers respectively.

template<class Iterator>
Iterator serialize(Iterator i) const

This function serializes the value of the object to a sequence of bytes.

template<class Iterator>
Iterator deserialize(Iterator i)

This function deserializes the value of the object from a sequence of bytes.

bool operator==(byte x, byte y) noexcept
bool operator!=(byte x, byte y) noexcept

Tests equality of byte values.

These functions are not implemented yet.

class word

This represents word data on the VM68000 architecture. A word is 16-bit wide.

This type is trivial and standard-layout.

using int_type = std::int16_t
using uint_type = std::uint16_t

Signed and unsigned integer types this class can store values, respectively.

static constexpr std::size_t size() noexcept

Returns the size of a word value on the architecture, which is always 2.

word() = default

Constructs a word object with its default value.

This constructor is explicitly defaulted.

explicit constexpr word(std::uint16_t value) noexcept

Constructs a word object with an initial value.

void swap(word &other) noexcept

This function swaps the value of the object with another one.

constexpr std::int16_t to_int() const noexcept
constexpr std::uint16_t to_uint() const noexcept

These functions return the interpretations of the object as signed and unsigned integers respectively.

template<class Iterator>
Iterator serialize(Iterator i) const

This function serializes the value of the object to a sequence of bytes.

template<class Iterator>
Iterator deserialize(Iterator i)

This function deserializes the value of the object from a sequence of bytes.

bool operator==(word x, word y) noexcept
bool operator!=(word x, word y) noexcept

Tests equality of word values.

These functions are not implemented yet.

class long_word

This represents long word data on the VM68000 architecture. A long word is 32-bit wide.

This type is trivial and standard-layout.

using int_type = std::int32_t
using uint_type = std::uint32_t

Signed and unsigned integer types this class can store values, respectively.

static constexpr std::size_t size() noexcept

Returns the size of a long_word value on the architecture, which is always 4.

long_word() = default

Constructs a long_word object with its default value.

This constructor is explicitly defaulted.

explicit constexpr long_word(std::uint32_t value) noexcept

Constructs a long_word object with an initial value.

void swap(long_word &other) noexcept

This function swaps the value of the object with another one.

constexpr std::int32_t to_int() const noexcept
constexpr std::uint32_t to_uint() const noexcept

These functions return the interpretations of the object as signed and unsigned integers respectively.

template<class Iterator>
Iterator serialize(Iterator i) const

This function serializes the value of the object to a sequence of bytes.

template<class Iterator>
Iterator deserialize(Iterator i)

This function deserializes the value of the object from a sequence of bytes.

bool operator==(long_word x, long_word y) noexcept
bool operator!=(long_word x, long_word y) noexcept

Tests equality of long_word values.

These functions are not implemented yet.

<vm68k/memory>

class memory_map
using address_type = std::uint32_t
using size_type = std::uint32_t
enum class mode : char
protected memory_map() = default
memory_map(const memory_map&) = delete

The copy constructor is deleted.

void operator=(const memory_map&) = delete

The copy-assignment operator is deleted.

virtual ~memory_map() = default
virtual read(mode mode, address_type address, size_type n, void *buffer) = 0
virtual write(mode mode, address_type address, size_type n, const void *buffer) = 0
class paged_memory_map : public memory_map
class memory

Abstract base class of memory objects that is mappable in a paged memory map.

protected using address_type = memory_map::address_type
protected using size_type = memory_map::size_type
protected memory() = default
protected memory(const memory&) = delete

Prohibits copy construction.

void operator=(const memory&) = delete

Prohibits assignment.

virtual ~memory() = default
virtual size_type size() const noexcept = 0

Returns the size of this memory object.