summaryrefslogtreecommitdiff
path: root/daemon/src/Memory.h
blob: 26783550cdd94f56ef99467f97a66a1312aa757e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <array>
#include <cstddef>
#include <vector>

#include "Assembly.h"


class Memory
{
public:
	Memory() noexcept;
	void apply(AssemblyContext ctx);

	constexpr static std::size_t size = 10 * 1024;
private:
	std::array<char, size> content;

	std::vector<char> read(std::size_t len, std::size_t off) const;
	bool write(const std::vector<char> data, std::size_t off);
};