diff --git a/unittests/ASM/Primary/Primary_9C.asm b/unittests/ASM/Primary/Primary_9C.asm new file mode 100644 index 000000000..f84c08acf --- /dev/null +++ b/unittests/ASM/Primary/Primary_9C.asm @@ -0,0 +1,29 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "0x2", + "RBX": "0x2" + }, + "MemoryRegions": { + "0x100000000": "4096" + } +} +%endif + +mov rsp, 0xe0000010 + +; These pushes will end up being the default rflags initialization value +pushfq + +; nasm doesn't encode 16bit pushf +; put the prefix before the instruction manually +db 0x66 +pushfq + +mov rax, 0x0 +mov rbx, 0x0 + +mov ax, word [rsp] +mov rbx, qword [rsp + 2] + +hlt diff --git a/unittests/ASM/Primary/Primary_9D.asm b/unittests/ASM/Primary/Primary_9D.asm new file mode 100644 index 000000000..7eed72498 --- /dev/null +++ b/unittests/ASM/Primary/Primary_9D.asm @@ -0,0 +1,38 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "0x2", + "RBX": "0x2" + }, + "MemoryRegions": { + "0x100000000": "4096" + } +} +%endif + +mov rax, 0x0 +mov rbx, 0x0 +mov rsp, 0xe0000010 + +; These pushes will end up being the default rflags initialization value +pushfq + +cmp rax, 1 +popfq +pushfq + +mov rax, qword [rsp] + +; These pushes will end up being the default rflags initialization value +db 0x66 +pushfq + +cmp rax, 1 +db 0x66 +popfq +db 0x66 +pushfq + +mov bx, word [rsp] + +hlt