3 ms·
The near and far pointers bit is also the reason why in the Windows flavor of Systems Hungarian notation, you have a lot of “LP” prefixes; I believe it means Lo
by jchw 6y ago
The near and far pointers bit is also the reason why in the Windows flavor of Systems Hungarian notation, you have a lot of “LP” prefixes; I believe it means Long Pointer and would give you a far pointer. It’s typical to have one pointer typedef for Long Pointer, like LPBYTE, and sometimes one near, like PIMAGE_DOS_HEADER. Of course now it’s all ignored so if you see someone writing LP in modern code chances are it’s just tradition.
Also, today the segment-jumping far call still exists on modern AMD64 machines, and is how you cross “heaven's gate” to go between 32 bit and 64 bit execution.
- jcranmer 6y ago> Also, today the segment-jumpimg far call still exists on modern AMD64 machines, and is how you cross “heaven's gate” to go between 32 bit and 64 bit execution. Addendum: this model only exists on Windows. On Unixes, programs are entirely 64-bit or entirely 32-bit, so there's no LDT setup to have a 32-bit segment in 64-bit code. And there's no syscall on x86-64 to let userspace muck with the LDT as there is on x86-32.
- jchw 6y agoHm? I don’t think this is true. It’s CS 0x23 and 0x33 just like on Windows, no? This is, afaik, how Wine WoW64 works. I cannot find a definitive source, but for ex: https://stackoverflow.com/questions/24113729/switch-from-32bit-mode-to-64-bit-long-mode-on-64bit-linux https://stackoverflow.com/questions/24113729/switch-from-32b... I also think on Linux the x86 syscalls using software interrupts will still work in a 64 bit process, too.