VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've been watching https://youtu.be/en_7DtfT8Cg . But when it gets to negative bit indexes it strikes me as odd.

According to all documentation(x86/x86_64/80386 programmer's ref. manual) the imm8 and r16/32 are unsigned values, not signed as he expains?

Although, it would cause problems when accessing BT [EAX],-1 when EAX=1. Since it would try to read a doubleword at offset FFFFFFFD, which isn't your data and might not be a valid offset, segfaulting/pagefaulting/IO device access? Actually, it would always throw #GP(0) due to segmentation limit of 4G being broken(at offset 4G(64-bit)/0(truncated 32-bit)) for the 32-bit memory read?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 1, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

Do you mean BT [EAX], Exx where Exx is -1? Yes, that's signed. It will take Exx, SAR 3, AND -3, then add to EAX, and fault on the mis-aligned address.
Otherwise it's an imm8 & 0x1F, so it's not signed. Sign is meaningless there.