Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!rutgers!husc6!necntc!custom!boykin From: boykin@custom.UUCP (Joseph Boykin) Newsgroups: comp.sys.ibm.pc Subject: Interesting 80X86 instruction Message-ID: <767@custom.UUCP> Date: Wed, 5-Aug-87 15:31:59 EDT Article-I.D.: custom.767 Posted: Wed Aug 5 15:31:59 1987 Date-Received: Sat, 8-Aug-87 04:29:23 EDT Organization: Custom Software Systems; Natick, MA Lines: 30 I was looking through my handy-dandy 80X86 programmers reference and noticed something that I thought was a little strange. The AAD instruction (ASCII Adjust before division), does the following: AL = AL + (10 * AH). AH = 0 This instruction has a 'two' byte op-code, which really didn't seem necessary; i.e. why couldn't the instruction be encoded in one byte? OK, one-byte opcodes are valuable and you don't want to waste it on a semi-useless instruction. The other point was that the second byte was 0A. Humm, an instruction which multiplies the least significant nibble by 10 has a 10 as its second byte! Taking out my handy debugger I found that AAD *is* a one-byte instruction with the second byte acting as a parameter. Try coding the following: db 0d5h, 10h and you'll create an instruction which does: AL = AL + (16 * AH) AH = 0. I'm not sure what value such an instruction might have. Looking at the instruction timings a MUL is faster, but I'm sure someone will find a case where this is useful. If you do, let me know! Joe Boykin Custom Software Systems ...necntc!custom!boykin