Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual page 1326

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

AAS—ASCII Adjust AL After Subtraction
Opcode
3F
Description
Adjusts the result of the subtraction of two unpacked BCD values to create a unpacked
BCD result. The AL register is the implied source and destination operand for this
instruction. The AAS instruction is only useful when it follows a SUB instruction that
subtracts (binary subtraction) one unpacked BCD value from another and stores a byte
result in the AL register. The AAA instruction then adjusts the contents of the AL
register to contain the correct 1-digit unpacked BCD result.
If the subtraction produced a decimal carry, the AH register is decremented by 1, and
the CF and AF flags are set. If no decimal carry occurred, the CF and AF flags are
cleared, and the AH register is unchanged. In either case, the AL register is left with its
top nibble set to 0.
Operation
IF ((AL AND FH) > 9) OR (AF = 1)
THEN
AL  AL - 6;
AH  AH - 1;
AF  1;
CF  1;
ELSE
CF  0;
AF  0;
FI;
AL  AL AND FH;
Flags Affected
The AF and CF flags are set to 1 if there is a decimal borrow; otherwise, they are
cleared to 0. The OF, SF, ZF, and PF flags are undefined.
Additional Itanium System Environment Exceptions
Itanium Reg Faults NaT Register Consumption Abort.
Exceptions (All Operating Modes)
None.
4:24
Instruction
AAS
Description
ASCII adjust AL after subtraction
Volume 4: Base IA-32 Instruction Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents