thumb unconditional branch

This commit is contained in:
Matthew Berry 2020-10-02 23:13:59 -07:00
parent 67c58e5f2b
commit b25d941d0f
2 changed files with 9 additions and 1 deletions

View file

@ -9,7 +9,7 @@ module THUMB
if idx & 0b11110000 == 0b11110000
lut[idx] = ->thumb_long_branch_link(Word)
elsif idx & 0b11111000 == 0b11100000
# unconditional branch
lut[idx] = ->thumb_unconditional_branch(Word)
elsif idx & 0b11111111 == 0b11011111
# software interrupt
elsif idx & 0b11110000 == 0b11010000

View file

@ -0,0 +1,8 @@
module THUMB
def thumb_unconditional_branch(instr : Word) : Nil
offset = bits(instr, 0..10)
offset = (offset << 5).to_i16! >> 4
@r[15] &+= offset
clear_pipeline
end
end