diff --git a/suite/regress/x64_rip_relative.py b/suite/regress/x64_rip_relative.py new file mode 100755 index 0000000000000000000000000000000000000000..7f3c7b80ba9bb731f75003a21e10633787d4d522 --- /dev/null +++ b/suite/regress/x64_rip_relative.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +# Test RIP relative instruction + +# Github issue: #9 +# Author: Nguyen Anh Quynh + +from keystone import * + +import regress + +class TestX86(regress.RegressTest): + def runTest(self): + # Initialize Keystone engine + ks = Ks(KS_ARCH_X86, KS_MODE_64) + # Assemble to get back insn encoding & statement count + encoding, count = ks.asm(b"MOV QWORD PTR [RIP+0xF55AF], 0xFF") + # Assert the result + self.assertEqual(encoding, [ 0x48, 0xc7, 0x05, 0xaf, 0x55, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x00 ]) + + +if __name__ == '__main__': + regress.main()