holey-bytes/hbvm/src/main.rs
2023-06-08 00:25:38 +02:00

25 lines
521 B
Rust

use hbbytecode::opcode;
use hbvm::{validate::validate, vm::Vm, RuntimeErrors};
fn main() -> Result<(), RuntimeErrors> {
// TODO: Grab program from cmdline
#[rustfmt::skip]
let prog = &[];
if let Err(e) = validate(prog) {
eprintln!("Program validation error: {e:?}");
return Ok(());
} else {
unsafe {
let mut vm = Vm::new_unchecked(prog);
vm.memory.insert_test_page();
vm.run();
}
}
Ok(())
}
pub fn time() -> u32 {
9
}