You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
605 B
24 lines
605 B
3 years ago
|
#!/usr/bin/python
|
||
|
# Ingmar Steen, 2016
|
||
|
|
||
|
# This tests the LDR Rd, =label pseudo-instruction on ARM.
|
||
|
|
||
|
# Github issue: #46
|
||
|
# Author: Ingmar Steen
|
||
|
|
||
|
from keystone import *
|
||
|
|
||
|
import regress
|
||
|
|
||
|
class TestARM(regress.RegressTest):
|
||
|
def runTest(self):
|
||
|
# Initialize Keystone engine
|
||
|
ks = Ks(KS_ARCH_ARM, KS_MODE_ARM)
|
||
|
# Assemble to get back insn encoding & statement count
|
||
|
encoding, count = ks.asm(b"ldr r0, =data; data:")
|
||
|
# Assert the result
|
||
|
self.assertEqual(encoding, [ 0x04, 0x00, 0x1f, 0xe5, 0x04, 0x00, 0x00, 0x00 ])
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
regress.main()
|