From 0736b138001e9bf4ccf489083bf07137b4502375 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Thu, 20 Aug 2020 10:32:38 +0300 Subject: [PATCH] Tests: Add xchg 32 and 64 bit --- unittests/ASM/Primary/Primary_87_2.asm | 24 ++++++++++++++++++++++++ unittests/ASM/Primary/Primary_87_3.asm | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 unittests/ASM/Primary/Primary_87_2.asm create mode 100644 unittests/ASM/Primary/Primary_87_3.asm diff --git a/unittests/ASM/Primary/Primary_87_2.asm b/unittests/ASM/Primary/Primary_87_2.asm new file mode 100644 index 000000000..7db21bccb --- /dev/null +++ b/unittests/ASM/Primary/Primary_87_2.asm @@ -0,0 +1,24 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "0x0000000045464748", + "RBX": "0x41424344FFFFFFFF" + }, + "MemoryRegions": { + "0x100000000": "4096" + } +} +%endif + +mov rdx, 0xe0000000 + +mov rax, 0x4142434445464748 +mov [rdx + 8 * 0], rax +mov rax, 0x5152535455565758 +mov [rdx + 8 * 1], rax + +mov rax, -1 +xchg dword [rdx + 8 * 0], eax +mov rbx, [rdx + 8 * 0] + +hlt diff --git a/unittests/ASM/Primary/Primary_87_3.asm b/unittests/ASM/Primary/Primary_87_3.asm new file mode 100644 index 000000000..e3819afbe --- /dev/null +++ b/unittests/ASM/Primary/Primary_87_3.asm @@ -0,0 +1,24 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "0x4142434445464748", + "RBX": "0xFFFFFFFFFFFFFFFF" + }, + "MemoryRegions": { + "0x100000000": "4096" + } +} +%endif + +mov rdx, 0xe0000000 + +mov rax, 0x4142434445464748 +mov [rdx + 8 * 0], rax +mov rax, 0x5152535455565758 +mov [rdx + 8 * 1], rax + +mov rax, -1 +xchg qword [rdx + 8 * 0], rax +mov rbx, [rdx + 8 * 0] + +hlt