TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: PETER MAGNUSSON
from: SCOTT MCNAY
date: 1997-12-27 21:11:00
subject: pure Hex Programming

Following up a message from Darryl Gregorash to Peter Magnusson:
 DG>> Any differences in teh instructions are bugs..
 PM> In undocummented to?
 PM> I mean, if you read x86.org you'll find a couple
 PM> of insructions that have excisted in a lot of
 PM> processors, but wasn't made public until P6.
 PM> Would diffrences in them be considered a bug, too?
DG> OK, I wasn't considering undocumented instructions. The
DG> manufacturer can make those do whatever he pleases, and we
DG> use them in our peril :) 
You might take a look at the AAM and AAD instruction.  As you probably know, 
it's officially a two-byte opcode, but it's actually a one-byte opcode 
followed by a single data byte, 0x0A.  If, for example, you use 0x08 instead, 
you get an instruction that converts binary to/from octal.
Apparently, on the NEC chips (I dont have a PC or XT motherboard to test with 
anymore, and I doubt that I still have any NEC chips either, so I can't 
confirm this), supposedly the AAM and AAD instructions don't work correctly 
for any operand other than 0x0A.  Thus, a good reason to not rely upon such 
ondocumented behavior.
The book Undocumented DOS, by Andrew Schulman, et. al., explains in detail 
why it is NECESSARY to rely upon undocumented features of DOS to do certain 
things, but one should never use undocumented CPU features, with the possible 
exception of the LOADALL instruction.
--Scott.
--- timEd 1.01
---------------
* Origin: Wizard's, 254-554-2146, Abacus PLUS, 903-3097 (1:395/11)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.