kopia lustrzana https://github.com/micropython/micropython
Merge f3191bcd48
into 01c31ea804
commit
673d126b14
|
@ -89,8 +89,17 @@ def asm_jump_x86(entry):
|
|||
def asm_jump_thumb(entry):
|
||||
# Only signed values that fit in 12 bits are supported
|
||||
b_off = entry - 4
|
||||
assert b_off >> 11 == 0 or b_off >> 11 == -1, b_off
|
||||
return struct.pack("<H", 0xE000 | (b_off >> 1 & 0x07FF))
|
||||
if b_off >> 11 == 0 or b_off >> 11 == -1:
|
||||
return struct.pack("<H", 0xE000 | (b_off >> 1 & 0x07FF))
|
||||
else:
|
||||
# Use BL instruction
|
||||
# Two 16-bit instructions in sequence
|
||||
# each on form: 1111 HOOO OOOO OOOO
|
||||
# first instruction has H=0, and has high 11 bits of the Offset
|
||||
# second instruction has H=1, and has low 11 bits of the Offset
|
||||
b0 = 0xF000 | (b_off >> 12 & 0x07FF)
|
||||
b1 = 0xF800 | (b_off >> 1 & 0x7FF)
|
||||
return struct.pack("<HH", b0, b1)
|
||||
|
||||
|
||||
def asm_jump_thumb2(entry):
|
||||
|
|
Ładowanie…
Reference in New Issue