Struct reustmann::Interpreter
[−]
[src]
pub struct Interpreter { // some fields omitted }
The main interpreter, execute instructions, read from input, write to output
Methods
impl Interpreter
[src]
fn new(arch_length: usize, arch_width: usize) -> Result<Interpreter, &'static str>
Construct a new Interpreter with an existing Program.
arch_length
need to be in the range [1..2^32)
and arch_width
in [6..32)
.
fn copy_program(&mut self, program: &Program)
Copy your program in the memory of the machine, a reset is done after program was loaded.
fn arch_length(&self) -> usize
return the interpreter arch length
fn arch_width(&self) -> usize
return the interpreter arch width
fn reset(&mut self) -> Statement
Reset pc
, sp
and nz
to 0
, 0
and false
respectively.
fn step<R: ?Sized + Read, W: ?Sized + Write>(&mut self, input: &mut R, output: &mut W) -> Statement
fn debug_infos(&self) -> DebugInfos
Get a debug struct that can help for debugging programs