mirror of
https://github.com/mattrberry/crab.git
synced 2024-12-29 10:23:54 +01:00
make register rotates take explicit register shift enable
This commit is contained in:
parent
02b596943e
commit
f26fe9faf0
2 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue