# How exactly do you convert a binary representation to its ASCII equivalent in assembly?

hello, i need some basic help. i'm trying to convert some binary numbers to decimal.
i'm starting off with an array, and am trying to output each integer in the array, first its binary representation (which i'm not having trouble with), then its decimal
equivalent which has me scratching my head. i know i need to convert  the binary to ASCII but don't know how to do that. does anyone have any suggestions?

myArray dw 41,385,32767,256,1,600,7890,4096,3456,128,0,64

.code               ; start of code segment
main   proc          ; start procedure main
mov   ax,seg myArray     ; mov to ax the segment address of 'myArray'
mov   ds,ax          ; we now know where data is located in memory

; i have no problemt outputting the binary and realize i can just loop through the array with this code
mov ah, 9
int 21h

mov si, myArray + 0
mov cx, 16
mov ah, 2

output0:
shl si, 1
jc output1
mov dl, '0'
int 21h
jmp nextStep

output1:
mov dl, '1'
int 21h

nextStep:
loop output0
mov ah, 6
mov dl, 09h
int 21h
; now i can't figure out how to turn the binary into ASCII
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Do you know how to convert on paper? If I gave the number 1010 binary could you convert this to ascii in decimal?

Are you having trouble translating the problem to assembly or do you not know how to write the steps down on paper?
0
Commented:

number = value to be displayed
do
digit = number mod 10 + '0'
number = number div 10
while number > 0
display buffer backwards

0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Assembly

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.