add mul, disable slow mode
This commit is contained in:
+11
-2
@@ -166,8 +166,17 @@ impl RunThread {
|
||||
// TODO carry?
|
||||
frame.write(*dst, val)?;
|
||||
}
|
||||
Op::Mul(_, _) => {
|
||||
unimplemented!()
|
||||
Op::Mul(dst, src) => {
|
||||
frame.status.clear();
|
||||
let mut a = frame.read(dst.as_rd())?;
|
||||
let mut b = frame.read(*src)?;
|
||||
|
||||
let val = a.wrapping_mul(b);
|
||||
frame.status.zero = (val == 0);
|
||||
frame.status.positive = is_positive(val);
|
||||
frame.status.negative = is_negative(val);
|
||||
//frame.status.overflow = b > a; // TODO detect overflow
|
||||
frame.write(*dst, val)?;
|
||||
}
|
||||
Op::Div(_, _) => {
|
||||
unimplemented!()
|
||||
|
||||
@@ -10,7 +10,8 @@ use crate::frame::StackFrame;
|
||||
use crate::program::Program;
|
||||
use crate::exec::EvalRes;
|
||||
|
||||
const CYCLE_TIME : Duration = Duration::from_millis(100);
|
||||
const CYCLE_TIME : Duration = Duration::from_millis(0);
|
||||
//const CYCLE_TIME : Duration = Duration::from_millis(100);
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug, Ord, PartialOrd)]
|
||||
pub struct ThreadToken(pub u32);
|
||||
|
||||
Reference in New Issue
Block a user