first commit

This commit is contained in:
tuz358
2018-03-03 08:54:12 +09:00
parent e2e56da666
commit 6a3b037a89
7 changed files with 176 additions and 0 deletions

25
main.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include <iostream>
#include <string>
#include "include/emulator.h"
const size_t MEMORY_SIZE = 1*KB;
int main(int argc, char *argv[]){
FILE *bin;
bin = fopen(argv[1], "rb");
Emulator emulator;
emulator.init(MEMORY_SIZE, bin);
fclose(bin);
while(emulator.get_eip() < MEMORY_SIZE) {
uint8_t opcode = emulator.read_next_opcode();
emulator.exec(opcode);
if (emulator.get_eip() == 0x00) break;
}
emulator.free();
return 0;
}