8086 family CPU bug

David Wright dww at stl.UUCP
Thu Jul 11 06:10:50 AEST 1985


In article <1190 at hcrvx1.UUCP> hugh at hcrvx1.UUCP (Hugh Redelmeier) writes:
>All 8086 manuals I have read say that shift instructions set
>the flags to reflect the value of the result.  All the chips
>that I have tested (8086, 8088, 80186) do not set the flags
>if the shift count is zero. 

1 - If I remember rightly, the 8086 (et al) Users Guides say that for count of
0 "the result is undefined" - in practice you seem to have discovered that the
result is <do nothing> (not even set flags).   I think it is very bad to have
undefined results unnecessarily, but at least it's a "feature" not a bug
(a "feature" is a bug that you documented .... ).  I guess the C manual you're
using didn't get round to documenting it - not Intel's fault if their "feature"
wasn't recognised!

2 - I guess one reason Intel haven't bothered to fix this "feature" is that 
their PL/M-86 compiler isn't (usually) upset by such things, because it can
almost always optimise out shift 0 anyway, and the C example you gave is pretty
unlikely to appear in PL/M.



More information about the Net.bugs mailing list