Use thumb_opcode_val & 0x7 instead

This commit is contained in:
twinaphex 2014-12-12 06:45:20 +01:00
parent c1677498a5
commit 4a6d527b1c
1 changed files with 3 additions and 3 deletions

6
cpu.c
View File

@ -3317,7 +3317,7 @@ thumb_loop:
/* MOV r6, imm */
case 0x27:
/* MOV r7, imm */
thumb_logic(imm, thumb_opcode_val - 0x20, imm);
thumb_logic(imm, thumb_opcode_val & 0x7, imm);
break;
case 0x28:
@ -3336,7 +3336,7 @@ thumb_loop:
/* CMP r6, imm */
case 0x2F:
/* CMP r7, imm */
thumb_test_sub(imm, reg[thumb_opcode_val - 0x28], imm);
thumb_test_sub(imm, reg[thumb_opcode_val & 0x7], imm);
break;
case 0x30:
@ -3355,7 +3355,7 @@ thumb_loop:
/* ADD r6, imm */
case 0x37:
/* ADD r7, imm */
thumb_add(imm, thumb_opcode_val - 0x30, reg[thumb_opcode_val - 0x30], imm);
thumb_add(imm, thumb_opcode_val & 0x7, reg[thumb_opcode_val & 0x7], imm);
break;
case 0x38: