mirror of
https://github.com/mattrberry/crab.git
synced 2025-02-05 08:45:50 +01:00
simplify arm branch exchange logic
This commit is contained in:
parent
bdda6b0509
commit
8b6f300f67
1 changed files with 3 additions and 7 deletions
|
@ -1,13 +1,9 @@
|
|||
module GBA
|
||||
module ARM
|
||||
def arm_branch_exchange(instr : Word) : Nil
|
||||
rn = bits(instr, 0..3)
|
||||
if bit?(@r[rn], 0)
|
||||
@cpsr.thumb = true
|
||||
set_reg(15, @r[rn])
|
||||
else
|
||||
set_reg(15, @r[rn])
|
||||
end
|
||||
address = @r[bits(instr, 0..3)]
|
||||
@cpsr.thumb = bit?(address, 0)
|
||||
set_reg(15, address)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue