وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

DAA

DAA

Usage:  DAA                                           Modifies flags: AF CF PF SF ZF (OF undefined)

Corrects result (in AL) of a previous BCD addition operation. Contents of AL are changed to a pair of packed decimal digits.

Decimal Adjustments


DAA                           ; 27                   [8086]

DAS                           ; 2F                   [8086]


These instructions are used in conjunction with the add and subtract instructions to perform binary-coded decimal arithmetic in  (one BCD digit per nibble) form. For the unpacked equivalents, see  AAA.

DAA should be used after a one-byte ADD instruction whose destination was the AL register: by means of examining the value in the AL and also the auxiliary carry flag AF, it determines whether either digit of the addition has overflowed, and adjusts it (and sets the carry and auxiliary-carry flags) if so. You can add long BCD strings together by doing ADD/DAA on the low two digits, then doing ADC/DAA on each subsequent pair of digits.


DAS works similarly to DAA, but is for use after SUB  instructions rather than ADD.


Example:

daa

 

DAA