This commit is contained in:
2020-09-26 21:06:34 +02:00
parent ba0e3d0fd2
commit 1d444fd516
14 changed files with 234 additions and 214 deletions
+4 -3
View File
@@ -2,7 +2,7 @@ use std::ops::Rem;
use num_traits::PrimInt;
use crsn::asm::instr::op::OpTrait;
use crsn::asm::instr::op::{OpTrait, EvalRes};
use crsn::runtime::fault::Fault;
use crsn::runtime::frame::{CallStack, StackFrame};
use crsn::runtime::program::Program;
@@ -10,7 +10,8 @@ use crsn::runtime::program::Program;
use crate::defs::ArithOp;
impl OpTrait for ArithOp {
fn execute(&self, _program: &Program, _call_stack: &mut CallStack, frame: &mut StackFrame) -> Result<(), Fault> {
fn execute(&self, _program: &Program, _call_stack: &mut CallStack, frame: &mut StackFrame) -> Result<EvalRes, Fault> {
let eres = EvalRes::default();
match self {
ArithOp::Test { a } => {
frame.status.clear();
@@ -188,7 +189,7 @@ impl OpTrait for ArithOp {
}
}
Ok(())
Ok(eres)
}
//
}