это ужас
This commit is contained in:
28
main.cpp
Normal file
28
main.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user