EightBit/M6502/HarteTest_6502/byte_t.h
Adrian Conlon 76c03bb4d4 Tidy up header usage.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2021-10-24 11:42:43 +01:00

20 lines
515 B
C++

#pragma once
#include <cstdint>
#include "simdjson/simdjson.h"
#include "array_t.h"
class byte_t : public array_t {
protected:
[[nodiscard]] auto address_at(size_t idx) const noexcept { return (uint16_t)integer_at(idx); }
[[nodiscard]] auto byte_at(size_t idx) const noexcept { return (uint8_t)integer_at(idx); }
public:
byte_t(simdjson::dom::array input) noexcept;
[[nodiscard]] auto address() const noexcept { return address_at(0); }
[[nodiscard]] auto value() const noexcept { return byte_at(1); }
};