Google

Sep 11, 2008

Assembly program to convert BCD to ASCII

Assembly program to convert BCD to ASCII

Initially the input is moved in SI register , then its divided by 10 and then 30 is added to the number for both AH, AL i.e. the 8 bit higher and lower registers. Then the output is moved to the destination index register.

Following is the program code in assembly language to convert a BCD number to ASCII.

MOV SI,2000
MOV DI,4000
MOV AX,[SI]
MOV BL,10
DIV BL
MOV DL,30
ADD AL,DL
ADD AH,DL
MOV [DI],AX
INT A5

Example Input: 08 , Output: 30 38

You might be also interested in:

:: Interfacing Analog-to-Digital converter to 8086 using 8255
:: Interfacing Digital-To-Analog converter to 8086 using 8255

No comments: