pull/12241/merge
Jon Nordby 2024-03-16 09:35:05 +08:00 zatwierdzone przez GitHub
commit 673d126b14
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -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):