mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-16 03:41:18 +01:00
thumb unconditional branch
This commit is contained in:
parent
67c58e5f2b
commit
b25d941d0f
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
8
src/crab/thumb/unconditional_branch.cr
Normal file
8
src/crab/thumb/unconditional_branch.cr
Normal 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
|
Loading…
Reference in a new issue