added add_eb_gb and add_ev_gv instructions, fixed some stuff ig
This commit is contained in:
14
main.cpp
14
main.cpp
@@ -4,14 +4,23 @@ void emulate() {
|
||||
while (1) {
|
||||
uint32_t addr = physical_addr(CS, IP);
|
||||
uint8_t opcode = ram[addr];
|
||||
|
||||
instrHandler handler = instr_table[opcode];
|
||||
|
||||
IP++;
|
||||
|
||||
if (handler) handler();
|
||||
else {
|
||||
std::cout << "unknown opcode " << std::hex << opcode << "\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
CS = 0x0000;
|
||||
IP = 0x0100;
|
||||
IP = 0x0000;
|
||||
AX.value = 0x7fff;
|
||||
BX.value = 0x7fff;
|
||||
|
||||
if (argc < 2) {
|
||||
std::cerr << "usage: " << argv[0] << "<filename>\n";
|
||||
@@ -23,6 +32,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
init_instr_table();
|
||||
emulate();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user