28 lines
478 B
C++
28 lines
478 B
C++
#include "instructions.h"
|
|
|
|
void emulate() {
|
|
while (1) {
|
|
uint32_t addr = physical_addr(CS, IP);
|
|
uint8_t opcode = ram[addr];
|
|
|
|
IP++;
|
|
}
|
|
}
|
|
|
|
int main(int argc, char* argv[]) {
|
|
CS = 0x0000;
|
|
IP = 0x0100;
|
|
|
|
if (argc < 2) {
|
|
std::cerr << "usage: " << argv[0] << "<filename>\n";
|
|
return 1;
|
|
}
|
|
|
|
char* filename = argv[1];
|
|
if (!load_binary(filename, 0x0100)) {
|
|
return 1;
|
|
}
|
|
|
|
emulate();
|
|
return 0;
|
|
} |