diff --git a/src/assembler.rs b/src/assembler.rs index 6b2aa348..477a571a 100644 --- a/src/assembler.rs +++ b/src/assembler.rs @@ -235,7 +235,7 @@ fn insn(opc: u8, dst: i64, src: i64, off: i64, imm: i64) -> Result if !(0..16).contains(&dst) { return Err(format!("Invalid destination register {dst}")); } - if dst < 0 || src >= 16 { + if !(0..16).contains(&src) { return Err(format!("Invalid source register {src}")); } if off < i16::MIN as i64 || off > i16::MAX as i64 {