mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-24 05:00:44 +02:00
Merge pull request #165 from Sonicadvance1/pushf_unittest
Pushf and Popf unit tests
This commit is contained in:
2 files changed
+67
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user