Files
FEX-Emu--FEX/unittests/32Bit_ASM/FEX_bugs/SignExtendBug.asm
T
Ryan Houdek 67f13ba927 Adds sign extending address bug that was detected when testing #3421
Doesn't quite match the libc code directly because it uses `[gs:eax]`
with both having the sign bit set and we can't deal with that with ASM
tests. So match the behaviour in a different way.
2024-02-27 19:57:22 -08:00

31 lines
535 B
NASM

%ifdef CONFIG
{
"RegData": {
"RAX": "0x41424344",
"RBX": "0x41424344"
},
"MemoryRegions": {
"0xf0000000": "4096"
},
"MemoryData": {
"0xf0000000": "0x41424344"
},
"Mode": "32BIT"
}
%endif
; Ensures that zero extension of addresses are adhered to.
lea eax, [0xf000_0000]
mov eax, [ds:eax]
; Ensures that zext occurs correctly with two registers that have the sign bit set.
mov ebx, 0xffff_ffff
mov ecx, 0xf000_0001
; Break the block so it can't optimize through.
jmp .test
.test:
mov ebx, [ebx+ecx]
hlt