From 1482c77ea447ca9a5ce450918583430c51a59794 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Fri, 16 Oct 2020 16:50:49 -0700 Subject: [PATCH] fix cmprb_0 --- src/instr_models.rs | 6 +++--- src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/instr_models.rs b/src/instr_models.rs index 069e58e..89e4bdf 100644 --- a/src/instr_models.rs +++ b/src/instr_models.rs @@ -854,11 +854,11 @@ pub fn cmplw(inputs: InstructionInput) -> InstructionResult { pub fn cmprb_0(inputs: InstructionInput) -> InstructionResult { let ra = inputs.try_get_ra()? as u8; let rb: u64 = inputs.try_get_rb()?; - let eq = ra >= rb as u8 && ra <= (rb >> 8) as u8; + let in_range = ra >= rb as u8 && ra <= (rb >> 8) as u8; let cr0 = ConditionRegister { lt: false, - gt: false, - eq, + gt: in_range, + eq: false, so: false, }; Ok(InstructionOutput { diff --git a/src/lib.rs b/src/lib.rs index d544724..31d48a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -840,8 +840,8 @@ instructions! { // cmprb 0, 0, ..., ... #[enumerant = CmpRB0] - fn cmprb_0(Ra, Rb) -> (CR0) { - "cmprb 0, 0," + fn cmprb_0(Ra("r3"), Rb("r4")) -> (CR0) { + "cmprb_0" : "cmprb 0, 0, 3, 4" } } -- 2.30.2