Is this guaranteed to work? I suspect it will break on many machines
where the BIOS does a save/restore of the segment register and the
restore will make the segment be truncated back to a 16-bit one (holds
especially for interrupts etc).
(it may well be that most processors won't change the "limit" of the
segment cache when re-loading a real-mode segment, but quite frankly,
this is not documented behaviour as far as I know, and I wouldn't be
surprised if it didn't work on clones and/or P6 chips etc).
The %fs/%gs segments might be reasonably safe, but I suspect modern
BIOSes will use even those segments internally.
Linus