From 31f163787fb964013b2139fe2d8a7a9472daaac4 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Tue, 10 May 2016 16:24:49 +0800 Subject: [PATCH] regress: add directives 'db', 'dw' to x86_nasm_directive.py --- suite/regress/x86_nasm_directives.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/suite/regress/x86_nasm_directives.py b/suite/regress/x86_nasm_directives.py index df2f622..4c3c6ea 100755 --- a/suite/regress/x86_nasm_directives.py +++ b/suite/regress/x86_nasm_directives.py @@ -20,7 +20,10 @@ class TestX86(regress.RegressTest): ks.syntax = KS_OPT_SYNTAX_NASM # compile an instruction in NASM syntax - #encoding, count = ks.asm(b"bits 32\n add eax, ebx\nbits 16\nadd eax, ebx") + encoding, count = ks.asm(b"db 12, 13\ndw 14, 15") + # Assert the result + self.assertEqual(encoding, [ 0x0c, 0x0d, 0x0e, 0x00, 0x0f, 0x00 ]) + encoding, count = ks.asm(b"bits 32\n add eax, ebx\nbits 16\nadd eax, ebx") # Assert the result self.assertEqual(encoding, [ 0x01, 0xd8, 0x66, 0x01, 0xd8 ])