Statement: convert the ASCII number in memory to its equivalent decimal number
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:

       LXI        H, 4150        : Point to data
       MOV        A, M                : Get operand
       SUI        30                : convert to decimal
       CPI        0A                : Check whether it is valid decimal number
       JC        LOOP                : yes, store result
       MVI        A, FF                : No, make result=FF
LOOP: INX        H
       MOV        M, A
       HLT                        : (A) = (4151)
.


Note: The ASCII Code (American Standard Code for Information Interchange) is commonly used for communication. It is a seven bit code. In this code number 0 through 9 are represented as 30 through 39 respectively and letters A through Z are represented as 41H through 5AH. Therefore, by subtracting 30H we can convert an ASCII number into its decimal equivalent.