Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.pc » [Robert A. Lerche <XA.W51%STANFORD.BITNET@Berkeley>: Bug in '78 8088]
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
[Robert A. Lerche <XA.W51%STANFORD.BITNET@Berkeley>: Bug in '78 8088] [message #79073] Sun, 02 June 2013 23:11
Anonymous
Karma:
Originally posted by: Info-IBMPC@USC-ISIB.ARPA
Message-ID: <12447@sri-arpa.UUCP>
Date: Thu, 27-Sep-84 22:59:04 EDT
Article-I.D.: sri-arpa.12447
Posted: Thu Sep 27 22:59:04 1984
Date-Received: Sun, 30-Sep-84 04:46:30 EDT
Lines: 52

From:  Info-IBMPC Digest 

Date: 21 Sep 1984  0948-pst
From: Robert A. Lerche 
To: 
Subject: Bug in '78 8088

An important note for anyone who changes stacks in the 8088:

An early version of the 8088 chip has a bug that can cause
memory clobbers.  According to the Intel iAPX86/88 book,
interrupts are disabled for one instruction following a MOV
into a segment register.  Thus, the safe way to switch stacks
is to do a MOV into the stack segment register followed
immediately by a MOV into the stack pointer register.

The bug is that in 8088 chips marked "copyright 1978" the
automatic interrupt disable DOES NOT OCCUR.  Thus, if an
interrupt occurs between the two MOV instructions, the
interrupt routine will store the registers in the new stack
segment but with the old stack pointer.  Potential disaster!
The fix, of course, is to do your own CLI before switching
stacks.

DOS 2.0 device drivers are entered enabled for interrupts, so
this exposure exists there.  Since timer interrupts occur
18.2 times per second in the PC, there's a good chance of a
crash if you change stacks in your driver without disabling
interrupts yourself.  Take the word of one who has been
burned.

(P. S. remember to re-enable interrupts after you're done, or
your clock may run slow.)

There was an article about this in an early issue of the PC Tech
Journal.  In that article, they gave a test which involved using
the debugger to trace a "move into segment register" instruction
followed by an "INC AX" (if I recall correctly).  If the "INC AX"
executes (you can tell by examining the registers afterward) then
you have a later-model 8088.  If the "INC AX" does not execute,
the trap interrupt occurred immediately after the "MOV", indicating
you have a '78 8088.

This bug was hell until I read that PC Tech Journal article.  I wrote
IBM a letter complaining and got a very nice phone call from someone
who apologized and asked if everything was OK now that I knew the
fix.  He also said they would consider putting a note in the next
version of the DOS manual, since the section on device drivers makes
such a big point of saying you should allocate your own stack if you
do anything other than saving the registers on the stack your driver
is entered with.
-------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: [Pierre duPont <pdupont@bbnj>: "Optimum" DBMS]
Next Topic: [Dave Farber <farber%udel-eecis3.delaware@udel-relay.ARPA>: Lotus on PCjr]
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Apr 25 20:07:57 EDT 2024

Total time taken to generate the page: 0.05684 seconds