make register rotates take explicit register shift enable

This commit is contained in:
Matthew Berry 2021-02-20 09:41:10 -08:00
parent 02b596943e
commit f26fe9faf0
2 changed files with 2 additions and 2 deletions

View file

@ -69,7 +69,7 @@ module ARM
puts "Unused instruction: #{hex_str instr}"
end
def rotate_register(instr : Word, carry_out : Pointer(Bool), allow_register_shifts = true) : Word
def rotate_register(instr : Word, carry_out : Pointer(Bool), allow_register_shifts : Bool) : Word
reg = bits(instr, 0..3)
shift_type = bits(instr, 5..6)
if allow_register_shifts && bit?(instr, 4)

View file

@ -14,7 +14,7 @@ module ARM
operand_2 = if imm_flag # Operand 2 is an immediate
immediate_offset bits(instr, 0..11), pointerof(barrel_shifter_carry_out)
else # Operand 2 is a register
rotate_register bits(instr, 0..11), pointerof(barrel_shifter_carry_out)
rotate_register bits(instr, 0..11), pointerof(barrel_shifter_carry_out), allow_register_shifts: true
end
case opcode
when 0b0000 # AND