home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / intel / 2163 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.8 KB  |  51 lines

  1. Newsgroups: comp.sys.intel
  2. 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
  3. From: thomas@aeon.in-berlin.de (Thomas Wolfram)
  4. Subject: Re: Undocumented instructions in x86 CPUs
  5. Message-ID: <Bx9sv5.1yo@aeon.in-berlin.de>
  6. Organization: Cities in Dust
  7. References: <mostert.51@cs.sun.ac.za>
  8. Date: Fri, 6 Nov 1992 01:16:15 GMT
  9. Lines: 40
  10.  
  11. In <mostert.51@cs.sun.ac.za> mostert@cs.sun.ac.za (A. Mostert) writes:
  12. >Hi all
  13.  
  14. >I just became aware of an undocumented instruction that (I think) works on
  15. >all members of the x86 family. The opcode is D4 10 and it does this:
  16. >   AH = AL >> 4
  17. >   AL = AL & 0xF
  18. >Is this a well known instruction ? Does anyone know of any other instructions
  19. >(besides LOADALL and the 386 bit string stuff) that Intel did not tell us
  20. >about ?
  21.  
  22. What you discovered was some time ago mentioned in the german computer magazine
  23. "c't". (I guess is more an old story.)
  24. This is the fact that the instructions 'aam' and 'aax' also work
  25. with other basises then 10. It's sometimes (e.g. for conversions) very useful
  26. and I use often following macros (turbo assembler):
  27.  
  28. aamx    MACRO basis             ;ah := al / basis
  29.         db 0D4h, basis          ;al := al mod basis
  30.         ENDM
  31.  
  32. aadx    MACRO basis             ;al := ah*basis + al
  33.         db 0D5h, basis          ;ah := 0
  34.         ENDM
  35.  
  36.  
  37. You can then use it with (e.g.):
  38.  
  39.         aamx 16
  40.  
  41. regards,
  42. Thomas
  43.  
  44. PS: What is the '386 bit string stuff'?
  45.     
  46. -- 
  47.   Thomas Wolfram, European Advanced Networking Test Center
  48.   (Process Computing Center, Technical University of Berlin)
  49.   Strasse des 17.Juni 135, 1000 Berlin 12, Germany
  50.   +49 030 31421294, wolf@prz.tu-berlin.de, thomas@aeon.in-berlin.de
  51.