home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.intel
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!wupost!usc!sol.ctr.columbia.edu!ira.uka.de!ira.uka.de!gmd.de!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!math.fu-berlin.de!fub!obh.in-berlin.de!aeon!thomas
- From: thomas@aeon.in-berlin.de (Thomas Wolfram)
- Subject: Re: Undocumented instructions in x86 CPUs
- Message-ID: <Bx9sv5.1yo@aeon.in-berlin.de>
- Organization: Cities in Dust
- References: <mostert.51@cs.sun.ac.za>
- Date: Fri, 6 Nov 1992 01:16:15 GMT
- Lines: 40
-
- In <mostert.51@cs.sun.ac.za> mostert@cs.sun.ac.za (A. Mostert) writes:
- >Hi all
-
- >I just became aware of an undocumented instruction that (I think) works on
- >all members of the x86 family. The opcode is D4 10 and it does this:
- > AH = AL >> 4
- > AL = AL & 0xF
- >Is this a well known instruction ? Does anyone know of any other instructions
- >(besides LOADALL and the 386 bit string stuff) that Intel did not tell us
- >about ?
-
- What you discovered was some time ago mentioned in the german computer magazine
- "c't". (I guess is more an old story.)
- This is the fact that the instructions 'aam' and 'aax' also work
- with other basises then 10. It's sometimes (e.g. for conversions) very useful
- and I use often following macros (turbo assembler):
-
- aamx MACRO basis ;ah := al / basis
- db 0D4h, basis ;al := al mod basis
- ENDM
-
- aadx MACRO basis ;al := ah*basis + al
- db 0D5h, basis ;ah := 0
- ENDM
-
-
- You can then use it with (e.g.):
-
- aamx 16
-
- regards,
- Thomas
-
- PS: What is the '386 bit string stuff'?
-
- --
- Thomas Wolfram, European Advanced Networking Test Center
- (Process Computing Center, Technical University of Berlin)
- Strasse des 17.Juni 135, 1000 Berlin 12, Germany
- +49 030 31421294, wolf@prz.tu-berlin.de, thomas@aeon.in-berlin.de
-