2023-04-18 18:08:30 -05:00
|
|
|
use holey_bytes::bytecode::ops::Operations::*;
|
|
|
|
use holey_bytes::bytecode::types::CONST_U64;
|
|
|
|
use holey_bytes::RuntimeErrors;
|
|
|
|
use holey_bytes::{bytecode::types::CONST_U8, engine::Engine};
|
|
|
|
|
|
|
|
fn main() -> Result<(), RuntimeErrors> {
|
2023-04-18 21:41:27 -05:00
|
|
|
use holey_bytes::bytecode::ops::MathTypes::*;
|
2023-04-18 18:08:30 -05:00
|
|
|
#[rustfmt::skip]
|
|
|
|
let prog: Vec<u8> = vec![
|
2023-04-18 21:41:27 -05:00
|
|
|
NOP as u8, NOP as u8,
|
|
|
|
ADD as u8, EightBit as u8, 100, 20, 0xA7,
|
|
|
|
ADD as u8,
|
|
|
|
EightBit as u8, 1, 0, 0xB0,
|
|
|
|
ADD as u8,
|
|
|
|
SixtyFourBit as u8,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 2, 0xD0
|
|
|
|
|
2023-04-18 18:08:30 -05:00
|
|
|
];
|
|
|
|
let mut eng = Engine::new(prog);
|
|
|
|
// eng.timer_callback = Some(time);
|
|
|
|
eng.run()?;
|
2023-04-18 21:41:27 -05:00
|
|
|
eng.dump();
|
2023-04-18 18:08:30 -05:00
|
|
|
Ok(())
|
|
|
|
}
|