ROM-BIOS leaves ds and es limits beyond 64 KiB (Developers)
> I just noticed that testing instructions like mov ax, [FFFF]
> and mov ax, [es:FFFF] do not cause a fault when I boot the
> physical Pentium 3 (686) machine into bootable lDebug. (You want to
> install intfaults before running such tests, to have the
> debugger catch these Real 86 Mode faults in case they do occur.) With cs,
> ss, or fs overrides the instruction does fault (int 0Ch for ss, int 0Dh
> else).
>
> If I boot using boot protocol msdos7 hda2 followed by
> q, which runs a Himem driver, then regardless of the involved
> segment the instruction does fault. (This is without an EMM that switches
> to Virtual 86 Mode, the machine is still in Real 86 Mode.)
>
> So I assume that the ROM-BIOS leaves ds and es limits in an "unreal mode"
> state of higher segment limits than the 64 KiB expected for Real 86 Mode.
> Did you know that this is done by some systems?
The way it works on the original 8086/8088 CPUs, which I think is what should be emulated by default, is obviously that it wouldn't generate a fault (the old CPU's didn't have segment faults). The issue is what byte ends up in AH when you do something like a MOV AX,[FFFFh]. Is it the byte at DS:[0000h] or the byte at the linear address one byte above DS:[FFFFh]. I believe it should be DS:[0000h], but am not 100% positive. I do know when you use high _segment_ numbers they roll over to zero so you can't access the HMA unless you enable A20 (which 8086/8088 CPU's didn't have, either).
Complete thread:
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 28.10.2025, 17:20 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- ROM-BIOS leaves ds and es limits beyond 64 KiB - Oso2k, 28.10.2025, 21:46
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 28.10.2025, 22:03
- ROM-BIOS leaves ds and es limits beyond 64 KiB - tkchia, 06.11.2025, 17:29
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 06.11.2025, 20:13
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 06.11.2025, 20:23
- ROM-BIOS leaves ds and es limits beyond 64 KiB - tkchia, 06.11.2025, 23:07
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 06.11.2025, 20:23
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 06.11.2025, 20:13
- ROM-BIOS leaves ds and es limits beyond 64 KiB - tkchia, 06.11.2025, 17:29
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 28.10.2025, 22:03
- ROM-BIOS leaves ds and es limits beyond 64 KiB - bretjohn, 30.10.2025, 16:49
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 30.10.2025, 18:49
- ROM-BIOS leaves ds and es limits beyond 64 KiB - bretjohn, 31.10.2025, 01:45
- LOADFIX - ecm, 06.11.2025, 20:20
- ROM-BIOS leaves ds and es limits beyond 64 KiB - bretjohn, 31.10.2025, 01:45
- ROM-BIOS leaves ds and es limits beyond 64 KiB - ecm, 30.10.2025, 18:49
- ROM-BIOS leaves ds and es limits beyond 64 KiB - Oso2k, 28.10.2025, 21:46
Mix view