Flags after execution of DIVide instruction

by Grzegorz Mazur

The page was updated on 1996-11-26.

Revision history:
961126 - construction started.

According to Intel, state of common condition flags after DIV is undefined. Different CPUs have different behavior there. Manufacturers of CPUs give some ideas of DIV usage for CPU detection.

To make this test more reliable, we should take the following assumptions:

  • We will always perform the same division: 5 (in AX) by 2 (anywhere)
  • Non-system flags will be set to all-zeros just before division. Mask 0x8D5 will be used for isolating "interesting" flags.
  • The result of the test is value of flags masked with the same mask - 0x8D5.
  • Now take the result...

  • 0x095 - Any Intel, AMD 386/486 or similar,
  • 0x040, 0x044 - Cyrix or alike,
  • 0x020 - AMD K5
  • 0x004 - NexGen (Can someone who has NexGen CPU check this, please...)
  • The End

    Copyright 1996 by Grzegorz Mazur