VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Apparently, the call gates and task gates can be used with the LSL instruction to get bytes 0,1 and the 4 bits of byte 6 combined with the granularity flag to get the limit of said descriptor.

But what happens when you use it with the 16/32-bit call gates and task gates? Will it still fetch said bytes, even though there's different data in them?

For a call gate that's offsetlow and the number of arguments combined with the 'granularity' flag in the middle of offsethigh(for 32-bits versions at least, not for 16-bit ones)?
And for a task gate that's reserved bits only?

Why is it legal to use LSL with such an descriptor?

Edit: Hmmm.... https://mudongliang.github.io/x86/html/file_m … x86_id_162.html says the gate descriptors are legal to use.
But https://www.felixcloutier.com/x86/lsl says they aren't legal, which makes more sense(as they have no limit fields)?

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

Reply 1 of 2, by Anonymous Coward

User metadata
Rank l33t
Rank
l33t

Leisure Suit Larry?

"Will the highways on the internets become more few?" -Gee Dubya
V'Ger XT|Upgraded AT|Ultimate 386|Super VL/EISA 486|SMP VL/EISA Pentium

Reply 2 of 2, by superfury

User metadata
Rank l33t++
Rank
l33t++
Anonymous Coward wrote:

Leisure Suit Larry?

Not quite, it's an x86 instruction that stands for "Load Segment Limit" (opcode 0F03), which reads a specified GDT(Global Descriptor Table) entry or it's LDT's entry (within a LDT descriptor table (pointed by an entry in the GDT itself) and gives the entry's limit value(the maximum or minimum(with top-down segments) value of a offset using said descriptor)) and puts it into the resulting register or memory address.

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