VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I currently know these things about the x86 flags behaviour:

The flags are initialised to 0x2 when a reset is executed, or the power is applied.
The 8086 seems to always set bits 12-15 to 1.
80186 unknown? Does nothing specific to the flags?
The 80286 sets bits 12-15 to 1 when in real mode only.
The 80386 seems to always set the AC flag to 0.

Anyone knows more about this? Any other flags that have some specific behaviour in real/protected mode on the 80(1/2/3/4)86?

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

Reply 1 of 2, by crazyc

User metadata
Rank Member
Rank
Member
superfury wrote:

The 8086 seems to always set bits 12-15 to 1.

Yes.

superfury wrote:

80186 unknown? Does nothing specific to the flags?

The 80186 flags are same as the 8086.

superfury wrote:

The 80286 sets bits 12-15 to 1 when in real mode only.

The 80286 sets bits 12-15 to 0 in real mode (you should be able set 12-14 with LOADALL but I don't know if anyone has tried it) and in protected mode 15 is always 0 (probably to avoid conflict with the v20 mode flag).

superfury wrote:

The 80386 seems to always set the AC flag to 0.

AFAIK, yes.

superfury wrote:

Anyone knows more about this? Any other flags that have some specific behaviour in real/protected mode on the 80(1/2/3/4)86?

Here's info for the Pentium - Pentium 4.

Reply 2 of 2, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm testing my CPU emulation with the 80186 testsuite here: http://orbides.1gb.ru/80186_tests.zip . But for some reason it seems to have the high 4/5 bits of the flags set to 0 sometimes and 1 at other times (currently testing (res_)mul.bin/asm)? Anyone can tell me if the result set is correct at all? The interrupt test goes wrong completely: after the return from the interrupt it executes a JMP AX, which contains the wrong value (Flags pushed earlier)?

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