diff --git a/unittests/32Bit_ASM/X87/DB_E3.asm b/unittests/32Bit_ASM/X87/DB_E3.asm index e2f7c74e7..d38ab1ce9 100644 --- a/unittests/32Bit_ASM/X87/DB_E3.asm +++ b/unittests/32Bit_ASM/X87/DB_E3.asm @@ -7,12 +7,16 @@ } %endif -mov eax, 0 -mov esp, 0xe0000008 +section .bss +control: resb 2 ; Reserve space for the FPU control word + +section .text +global _start +_start: fninit ; Ensures that fnstcw after fninit sets the correct value -fnstcw [esp] -mov ax, word [esp] +fnstcw [rel control] +mov ax, word [rel control] hlt diff --git a/unittests/ASM/X87/DB_E3.asm b/unittests/ASM/X87/DB_E3.asm new file mode 100644 index 000000000..17db1e88b --- /dev/null +++ b/unittests/ASM/X87/DB_E3.asm @@ -0,0 +1,21 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "0x037F" + } +} +%endif + +section .bss +control: resb 2 ; Reserve space for the FPU control word + +section .text +global _start +_start: +fninit + +; Ensures that fnstcw after fninit sets the correct value +fnstcw [rel control] +mov ax, word [rel control] + +hlt diff --git a/unittests/ASM/X87_F64/DB_E3.asm b/unittests/ASM/X87_F64/DB_E3.asm new file mode 100644 index 000000000..39613ab6e --- /dev/null +++ b/unittests/ASM/X87_F64/DB_E3.asm @@ -0,0 +1,22 @@ +%ifdef CONFIG +{ + "RegData": { + "RAX": "0x037F" + }, + "Env": { "FEX_X87REDUCEDPRECISION" : "1" } +} +%endif + +section .bss +control: resb 2 ; Reserve space for the FPU control word + +section .text +global _start +_start: +fninit + +; Ensures that fnstcw after fninit sets the correct value +fnstcw [rel control] +mov ax, word [rel control] + +hlt