mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-15 03:40:56 +01:00
thumb laod address fix word bits selection
This commit is contained in:
parent
59769a222c
commit
8ec8645ca2
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,7 @@ module THUMB
|
|||
def thumb_load_address(instr : Word) : Nil
|
||||
source = bit?(instr, 11)
|
||||
rd = bits(instr, 8..10)
|
||||
word = bits(instr, 0..8)
|
||||
word = bits(instr, 0..7)
|
||||
imm = word << 2
|
||||
# Where the PC is used as the source register (SP = 0), bit 1 of the PC is always read as 0.
|
||||
set_reg(rd, (source ? @r[13] : @r[15] & ~2) &+ imm)
|
||||
|
|
Loading…
Reference in a new issue