Arithmetic Instructions CEK

23
Arithmetic Instructions 8086

description

Arithmetic Instructions of 8086

Transcript of Arithmetic Instructions CEK

Arithmetic Instructions

Arithmetic Instructions 8086DAAThe DAA instruction functions like AAAHandles packed BCD (binary code decimal) DAA's main purpose is to add strings of BCD digits (with two digits per byte). The AlgorithmThe algorithm for daa is if ( (AL and 0Fh) > 9 or (AuxC = 1)) then al := al + 6 AuxC := 1 ;Set Auxilliary carry. endif if ( (al > 9Fh) or (Carry = 1)) then al := al + 60h Carry := 1; ;Set carry flag. endifProgram Example AL = 53 CL = 29ADD AL,CL;AL