Skip to content
Snippets Groups Projects
Commit cac140ba authored by Nguyen Anh Quynh's avatar Nguyen Anh Quynh Committed by GitHub
Browse files

Merge pull request #227 from lunixbochs/master

add regress for #226
parents 2fdd772e 734937c0
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Ryan Hileman, 2016
# This is to test three-operand relative addressing using symbol math.
# Github issue: #226
# Author: Ryan Hileman
from keystone import *
import regress
class TestX86Nasm(regress.RegressTest):
def runTest(self):
# Initialize Keystone engine
ks = Ks(KS_ARCH_X86, KS_MODE_32)
# change the syntax to NASM
ks.syntax = KS_OPT_SYNTAX_NASM
# [eax + b - a] should assemble to [eax + length], or [eax + 6] here
encoding, count = ks.asm(b"a:\nlea eax, [eax + b - a]\nb:")
self.assertEqual(encoding, [ 141, 128, 6, 0, 0, 0 ])
if __name__ == '__main__':
regress.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment