VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Is the limit check offset truncated to 16 bits on the 80286 CPU? What about the 80386 and newer CPUs, during 16-bit mode(using 16-bit offsets)?
Is the memory access offset, which happens after that, truncated to 16-bits on the 80386? Or is it using the full 32/24 bits?

Note, that I'm talking about the fully input offset, aka effective address(which combined withna segment register/descriptor, translates to a linear address(and physical too on 80286 and below).

Edit: I've also just read that V86 mode(unlike Real mode) does truncate the offset before checking limits or calculating linear memory addresses?

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

Reply 1 of 1, by superfury

User metadata
Rank l33t++
Rank
l33t++

Looking at the documentation time and again, it seems like the offset doesn´t get wrapped at all(Just checked against limit, which will always fail on a 286+ when over the limit(in the descriptor), pun intended). Thus even in Virtual 8086 mode(which is a protected mode version of real mode), addressing over 64KB causes a #GP fault, because it's breaking the limit. No wrapping on the offset is thus needed.

One thing I'm wondering about, though:
with expand-down descriptors, with 16-bit offsets(which may or may not overflow), it doesn't cause problems(because the high 16 bits are always set, thus making the modulo 64K effective still)?

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