From d8825183bbfe40289c128498de610bc6bce8385e Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 5 Dec 2020 19:36:05 -0800 Subject: fix incorrect operand selection --- src/armv7/thumb.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/armv7/thumb.rs b/src/armv7/thumb.rs index 8e6c009..9595e1f 100644 --- a/src/armv7/thumb.rs +++ b/src/armv7/thumb.rs @@ -961,17 +961,18 @@ pub fn decode_into>(decoder: &InstDecoder, inst: &mut I } } else if opword < 0b11111 { // op1 == 0b10 + // interpret `op1 == 0b10` lines in table `A6-9` on `A6-228`: if lower & 0x80 == 0 { // op == 0 - if !op2[4] { + if !op2[5] { // `A6.3.1` `Data-processing (modified immediate)` (`A6-229`) // see `A6.3.2` for `Modified immediate constants in Thumb instructions` on how // to decode immediates // v6T2 - let op = op2[..4].load::(); + let op = op2[1..5].load::(); let i = lower2[10..11].load::(); - let s = lower2[4]; - let rn = lower2[0..4].load::(); + let s = instr2[4]; + let rn = instr2[0..4].load::(); let imm3 = lower2[12..15].load::(); let rd = lower2[8..12].load::(); let imm8 = lower2[0..8].load::(); -- cgit v1.1