regress: add directives 'db', 'dw' to x86_nasm_directive.py

This commit is contained in:
Nguyen Anh Quynh
2016-05-10 16:24:49 +08:00
parent 417abf3202
commit 31f163787f
+4 -1
View File
@@ -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 ])