int main(int argc, char** argv) { char* filename = ""; if(argc == 2) filename = argv[1]; virtual_machine* vm = create_vm(filename); if(vm != NULL) run_vm(vm); // Print the first memory address //if(vm) printf("%i\n", vm->pMemory->int32[0]); destroy_vm(vm); return 0; }
/* Standard C main program */ int main(int argc, char **argv) { /* Make sure we have a program tape to run */ if (argc < 2) { fprintf(stderr, "Usage: %s $FileName\nWhere $FileName is the name of the paper tape of the program being run\n", argv[0]); return EXIT_FAILURE; } /* Perform all the essential stages in order */ struct lilith* vm; tape_01_name = "tape_01"; tape_02_name = "tape_02"; vm = create_vm(1 << 21); load_program(vm, argv); execute_vm(vm); destroy_vm(vm); return EXIT_SUCCESS; }
~runtime() { destroy_vm(vm); }