You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
734 B
24 lines
734 B
use crate::asm::data::literal::Addr;
|
|
use crate::asm::instr::Op;
|
|
use crate::asm::instr::op::{EvalRes, OpTrait};
|
|
use crate::runtime::fault::Fault;
|
|
use crate::runtime::frame::StackFrame;
|
|
use crate::runtime::run_thread::RunThread;
|
|
|
|
impl RunThread {
|
|
// TODO unit tests
|
|
pub fn eval_op(&mut self) -> Result<EvalRes, Fault> {
|
|
let frame = &mut self.frame;
|
|
|
|
let op = self.program.read(frame.pc);
|
|
|
|
trace!("### {:04} : {:?}", frame.pc.0, op);
|
|
|
|
/* Operations can be given different execution times when run in slow mode. */
|
|
/* Presently, all that do anything use 1 cycle. */
|
|
|
|
let rv = op.execute(&self.program, &mut self.call_stack, frame);
|
|
trace!("-> {:?}", rv);
|
|
rv
|
|
}
|
|
}
|
|
|