mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-29 20:35:13 +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
|
if idx & 0b11110000 == 0b11110000
|
||||||
lut[idx] = ->thumb_long_branch_link(Word)
|
lut[idx] = ->thumb_long_branch_link(Word)
|
||||||
elsif idx & 0b11111000 == 0b11100000
|
elsif idx & 0b11111000 == 0b11100000
|
||||||
# unconditional branch
|
lut[idx] = ->thumb_unconditional_branch(Word)
|
||||||
elsif idx & 0b11111111 == 0b11011111
|
elsif idx & 0b11111111 == 0b11011111
|
||||||
# software interrupt
|
# software interrupt
|
||||||
elsif idx & 0b11110000 == 0b11010000
|
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…
Add table
Reference in a new issue