Statement: Subtract the BCD number stored in E register from the number stored in the D register.
Home
8085 Forum
8085 Free Projects
8085 Free Programs
8085 Tutorials
8085 details
Interfacing Techniques
Electronic Tutorials
Electronic Projects
Assembler/ IDE
Datasheets
Guest Book
About Me
           
Source Program: 

       MVI A,99H
       SUB E                : Find the 99's complement of subtrahend
       INR A                : Find 100's complement of subtrahend
       ADD D            : Add minuend to 100's complement of subtrahend
       DAA                : Adjust for BCD
       HLT                : Terminate program execution



Note: When two BCD numbers are subtracted, we can use DAA instruction for ajusting the result to BCD. Therefore, the subtraction of BCD number is carried out 10's complement or 100's complement.
The 10's complement of a decimal number is equal to the 99's complement plus 1. The 99's complement of a number can be found by subtracting the number from 99.
The steps for finding 100's complement BCD subtraction are :