mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-19 10:26:44 +01:00
thumb pc relative load
This commit is contained in:
parent
cbc140b7c4
commit
eb5d932579
2 changed files with 8 additions and 1 deletions
7
src/crab/thumb/pc_relative_load.cr
Normal file
7
src/crab/thumb/pc_relative_load.cr
Normal file
|
@ -0,0 +1,7 @@
|
|||
module THUMB
|
||||
def thumb_pc_relative_load(instr : Word) : Nil
|
||||
imm = bits(instr, 0..7)
|
||||
rd = bits(instr, 8..10)
|
||||
@r[rd] = @gba.bus.read_word((@r[15] & ~2) + (imm << 2))
|
||||
end
|
||||
end
|
|
@ -33,7 +33,7 @@ module THUMB
|
|||
elsif idx & 0b11110010 == 0b01010000
|
||||
# load/store with register offset
|
||||
elsif idx & 0b11111000 == 0b01001000
|
||||
# pc-relative load
|
||||
lut[idx] = ->thumb_pc_relative_load(Word)
|
||||
elsif idx & 0b11111100 == 0b01000100
|
||||
# hi register operations / branch exchange
|
||||
elsif idx & 0b11111100 == 0b01000000
|
||||
|
|
Loading…
Reference in a new issue