⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s03_03.htm

📁 Programmer s Reference Manual is an improtant book on Intel processor architecture and programming.
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>80386 Programmer's Reference Manual -- Section 3.3</TITLE></HEAD><BODY><B>up:</B> <A HREF="c03.htm">Chapter 3 -- Applications Instruction Set</A><BR><B>prev:</B> <A HREF="s03_02.htm">3.2  Binary Arithmetic Instructions</A><BR><B>next:</B> <A HREF="s03_04.htm">3.4  Logical Instructions</A><P><HR><P><H1>3.3  Decimal Arithmetic Instructions</H1>Decimal arithmetic is performed by combining the binary arithmeticinstructions (already discussed in the prior section) with the decimalarithmetic instructions. The decimal arithmetic instructions are used in oneof the following ways:<UL><LI> To adjust the results of a previous binary arithmetic operation toproduce a valid packed or unpacked decimal result.<LI> To adjust the inputs to a subsequent binary arithmetic operation sothat the operation will produce a valid packed or unpacked decimalresult.</UL>These instructions operate only on the AL or AH registers. Most utilize theAF flag.<H2>3.3.1  Packed BCD Adjustment Instructions</H2><A HREF="DAA.htm">DAA</A> (Decimal Adjust after Addition) adjusts the result of adding two validpacked decimal operands in AL. <A HREF="DAA.htm">DAA</A> must always follow the addition of twopairs of packed decimal numbers (one digit in each half-byte) to obtain apair of valid packed decimal digits as results. The carry flag is set ifcarry was needed.<P><A HREF="DAS.htm">DAS</A> (Decimal Adjust after Subtraction) adjusts the result of subtractingtwo valid packed decimal operands in AL. <A HREF="DAS.htm">DAS</A> must always follow thesubtraction of one pair of packed decimal numbers (one digit in each half-byte) from another to obtain a pair of valid packed decimal digits asresults. The carry flag is set if a borrow was needed.<H2>3.3.2  Unpacked BCD Adjustment Instructions</H2><A HREF="AAA.htm">AAA</A> (ASCII Adjust after Addition) changes the contents of register AL to avalid unpacked decimal number, and zeros the top 4 bits. <A HREF="AAA.htm">AAA</A> must alwaysfollow the addition of two unpacked decimal operands in AL. The carry flagis set and AH is incremented if a carry is necessary.<P><A HREF="AAS.htm">AAS</A> (ASCII Adjust after Subtraction) changes the contents of register AL toa valid unpacked decimal number, and zeros the top 4 bits. <A HREF="AAS.htm">AAS</A> must alwaysfollow the subtraction of one unpacked decimal operand from another in AL.The carry flag is set and AH decremented if a borrow is necessary.<P><A HREF="AAM.htm">AAM</A> (ASCII Adjust after Multiplication) corrects the result of amultiplication of two valid unpacked decimal numbers. <A HREF="AAM.htm">AAM</A> must always followthe multiplication of two decimal numbers to produce a valid decimal result.The high order digit is left in AH, the low order digit in AL.<P><A HREF="AAD.htm">AAD</A> (ASCII Adjust before Division) modifies the numerator in AH and AL toprepare for the division of two valid unpacked decimal operands so that thequotient produced by the division will be a valid unpacked decimal number.AH should contain the high-order digit and AL the low-order digit. Thisinstruction adjusts the value and places the result in AL. AH will containzero.<P><HR><P><B>up:</B> <A HREF="c03.htm">Chapter 3 -- Applications Instruction Set</A><BR><B>prev:</B> <A HREF="s03_02.htm">3.2  Binary Arithmetic Instructions</A><BR><B>next:</B> <A HREF="s03_04.htm">3.4  Logical Instructions</A></BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -