Oldskooler is wrong!
Posted by Trixter on March 18, 2007
In my last post, I stated that interrupts were supposed to be disabled on an 8088 for a MOV to the stack segment register (SS). Turns out that interrupts are supposed to be disabled during ALL segment register moves, not just SS! That explains why the procedure works to test if you have a buggy CPU or not:
Start DEBUG and run the following commands:
-A 100
MOV ES, AX
INC AX
NOP
-T
All registers are displayed at this point, where you want to look at the value in the AX register. If it is “0000” your 8088 CPU has the bug. AX = “0001” means your CPU passes the test & does not have the bug.
Why does this work? The T(race) command tries to single-step the MOV ES,AX instruction, but on a working cpu, the trace will include the INC AX as well, before the cpu stops so that you can check the result (value in AX). You can just as easily check the IP value, i.e. the position of the next opcode to be executed: If this is INC AX then you have a buggy cpu.
Many thanks to the venerable Terje Mathisen and DJ Delorie for cluing me in.
Yuhong Bao said
Actually it was not supposed to disable interrupts on all segment register loads, just SS, that was another bug created by the fix for the bugs that SS does not disable interrupts.