ia-32_instruction-set-ref_a-m

Can be used to produce a doubleword dividend from a

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: THEN AL AL + 6; CF old_CF or (Carry from AL AL + 6); AF 1; ELSE AF 0; FI; IF ((old_AL > 99H) or (old_CF = 1)) THEN AL AL + 60H; CF 1; ELSE CF 0; FI; FI; 3-256 Vol. 2 INSTRUCTION SET REFERENCE, A-M Example ADD AL, BL Before: AL=79H BL=35H EFLAGS(OSZAPC)=XXXXXX After: AL=AEH BL=35H EFLAGS(0SZAPC)=110000 DAA Before: AL=AEH BL=35H EFLAGS(OSZAPC)=110000 After: AL=14H BL=35H EFLAGS(0SZAPC)=X00111 DAA Before: AL=2EH BL=35H EFLAGS(OSZAPC)=110000 After: AL=34H BL=35H EFLAGS(0SZAPC)=X00101 Flags Affected The CF and AF flags are set if the adjustment of the value results in a decimal carry in either digit of the result (see the "Operation" section above). The SF, ZF, and PF flags are set according to the result. The OF flag is undefined. Protected Mode Exceptions None. Real-Address Mode Exceptions None. Virtual-8086 Mode Exceptions None. Compatibility Mode Exceptions None. 64-Bit Mode Exceptions #UD If in 64-bit mode. Vol. 2 3-257 INSTRUCTION SET REFERENCE, A-M DAS--Decimal Adjust AL after Subtraction Opcode 2F Instruction DAS 64-Bit Mode Invalid Compat/ Leg Mode Valid Description Decimal adjust AL after subtraction. Description Adjusts the result of the subtraction of two packed BCD values to create a packed BCD result. The AL register is the implied source and destination operand. The DAS instruction is only useful when it follows a SUB instruction that subtracts (binary subtraction) one 2-digit, packed BCD value from another and stores a byte result in the AL register. The DAS instruction then adjusts the contents of the AL register to contain the correct 2-digit, packed BCD result. If a decimal borrow is detected, the CF and AF flags are set accordingly. This instruction executes as described above in compatibility mode and legacy mode. It is not valid in 64-bit mode. Operation IF 64-Bit Mode THEN #UD; ELSE old_AL AL; old_CF CF; CF 0; IF (((AL AND 0FH) > 9) or AF = 1) THEN AL AL - 6; CF old_CF or (Borrow from AL AL - 6); AF 1; ELSE AF 0; FI; IF ((old_AL > 99H) or (old_CF = 1)) THEN AL AL - 60H; CF 1; FI; FI; 3-258 Vol. 2 INSTRUCTION SET REFERENCE, A-M Example SUB AL, BL Before: AL=35H BL=47H EFLAGS(OSZAPC)= XXXXXX After: AL=EEH BL=47H EFLAGS(0SZAPC)= 010111 DAA Before: AL=EEH BL=47H EFLAGS(OSZAPC)= 010111 After: AL=88H BL=47H EFLAGS(0SZAPC)= X10111 Flags Affected The CF and AF flags are set if the adjustment of the value results in a decimal borrow in either digit of the result (see the "Operation" section above). The SF, ZF, and PF flags are set according to the result. The OF flag is undefined. Protected Mode Exceptions None. Real-Address Mode Exceptions None. Virtual-8086 Mode Exceptions None. Compatibility Mode Exceptions None. 64-Bit Mode Exceptions #UD If in 64-bit mode. Vol. 2 3-259 INSTRUCTION SET REFERENCE, A-M DEC--Decrement by 1 Opcode FE /1 REX + FE /1 FF /1 FF /1 REX.W + FF /1 48+rw 48+rd Instruction DEC r/m8 DEC r/m8* DEC r/m16 DEC r/m32 DEC r/m64 DEC r16 DEC r32 64-Bit Mode Valid Valid Valid Valid Valid N.E. N.E...
View Full Document

Ask a homework question - tutors are online