#include "debug.h" #include "vm.h" #include #include #include #include int main(int argc, char *argv[]) { std::ifstream f; std::streamsize fsize; uint8_t * bytecode; if (argc < 2) { printf("Usage: %s \n", argv[0]); return 1; } /* reading bytecode */ f.open(argv[1], std::ios::binary | std::ios::ate); fsize = f.tellg(); f.seekg(0, std::ios::beg); bytecode = new uint8_t[fsize]; f.read((char*)bytecode, fsize); VM vm(bytecode, sizeof(bytecode)); vm.run(); vm.status(); return 0; }