diff --git a/miasm/arch/aarch64/arch.py b/miasm/arch/aarch64/arch.py index c642d2010..5246d9201 100644 --- a/miasm/arch/aarch64/arch.py +++ b/miasm/arch/aarch64/arch.py @@ -1424,7 +1424,7 @@ def decode(self, v): def encode(self): v = int(self.expr) if v & (1 << 63): - v &= (1 << 33) - 1 + v &= (1 << 21) - 1 self.parent.immlo.value = v & 3 v >>= 2 if v > (1 << 19) - 1: diff --git a/test/arch/aarch64/arch.py b/test/arch/aarch64/arch.py index 4156e054c..7d81e45e0 100644 --- a/test/arch/aarch64/arch.py +++ b/test/arch/aarch64/arch.py @@ -1846,7 +1846,10 @@ ("XXXXXXXX TLBI 0x0, c7, 0x0, XZR", "1F8708D5"), ("XXXXXXXX YIELD ", - "3F2003D5") + "3F2003D5"), + + ("XXXXXXXX ADR X29, 0xFFFFFFFFFFFFFAC8", + "5DD6FF10"), ]