Merge pull request #165 from Sonicadvance1/pushf_unittest

Pushf and Popf unit tests
This commit is contained in:
Ryan Houdek authored and GitHub committed 2020-04-29 12:31:11 -07:00
commit 772e47bf22
2 files changed
+67

No files matched your search

+29
View File
@@ -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
+38
View File
@@ -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