about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--test/arch/x86/unit/test_asm_x86_64.py30
-rwxr-xr-xtest/test_all.py1
2 files changed, 31 insertions, 0 deletions
diff --git a/test/arch/x86/unit/test_asm_x86_64.py b/test/arch/x86/unit/test_asm_x86_64.py
new file mode 100644
index 00000000..4e600846
--- /dev/null
+++ b/test/arch/x86/unit/test_asm_x86_64.py
@@ -0,0 +1,30 @@
+from miasm2.core import asmblock
+from miasm2.arch.x86  import arch
+from miasm2.core import parse_asm
+from miasm2.core.interval import interval
+
+my_mn = arch.mn_x86
+
+
+asmcfg, loc_db = parse_asm.parse_txt(my_mn, 64, r'''
+main:
+  PUSH   RBP
+  MOV    RBP, RSP
+loop_dec:
+  CMP    RCX, RDX
+  JB    loop_dec
+end:
+  MOV    RSP, RBP
+  POP    RBP
+  RET
+
+''')
+
+loc_db.set_location_offset(loc_db.get_name_location("main"), 0x100001000)
+dst_interval = interval([(0x100001000, 0x100002000)])
+patches = asmblock.asm_resolve_final(
+    my_mn,
+    asmcfg,
+    loc_db,
+    dst_interval
+)
diff --git a/test/test_all.py b/test/test_all.py
index 81b6e6e5..3fb0a5b7 100755
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -81,6 +81,7 @@ for script in ["x86/sem.py",
                "x86/unit/mn_seh.py",
                "x86/unit/mn_cpuid.py",
                "x86/unit/mn_div.py",
+               "x86/unit/test_asm_x86_64.py",
                "arm/arch.py",
                "arm/sem.py",
                "aarch64/unit/mn_ubfm.py",