From 8107e1087b36811524637205626dfa1528476786 Mon Sep 17 00:00:00 2001 From: LdyEax <ldyeax@gmail.com> Date: Thu, 5 Jan 2017 02:40:47 -0500 Subject: [PATCH] mips jal test --- suite/regress/mips_jal.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 suite/regress/mips_jal.py diff --git a/suite/regress/mips_jal.py b/suite/regress/mips_jal.py new file mode 100644 index 0000000..f99c983 --- /dev/null +++ b/suite/regress/mips_jal.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +# Test JAL <plain address> instruction for MIPS64 + +# Github issue: #269 +# Author: LdyEax + +from keystone import * + +import regress + +class TestMIPS(regress.RegressTest): + def runTest(self): + # Initialize Keystone engine + ks = Ks(KS_ARCH_MIPS, KS_MODE_MIPS64 + KS_MODE_BIG_ENDIAN) + # Assemble to get back insn encoding & statement count + encoding, count = ks.asm(b"jal 0") + # Assert the result + self.assertEqual(encoding[:4], [ 0x0C, 0x00, 0x00, 0x00 ]) + +if __name__ == '__main__': + regress.main() -- GitLab