mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 13:04:35 +03:00
22 lines
397 B
C++
22 lines
397 B
C++
#define KB 1024
|
|
#define MB 1024*KB
|
|
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include "instructions.h"
|
|
#include "memory.h"
|
|
|
|
class Emulator{
|
|
public:
|
|
Instructions instructions;
|
|
Memory memory;
|
|
|
|
void init(size_t memorysize, FILE *bin);
|
|
void free();
|
|
void exec(uint8_t opcode);
|
|
void dump_registers();
|
|
uint8_t read_next_opcode();
|
|
uint8_t read_uint8(uint32_t addr);
|
|
uint32_t get_eip();
|
|
};
|