How exactly do you convert a binary representation to its ASCII equivalent in assembly?
Posted on 2004-11-20
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
mov dx, offset headerLine
mov si, myArray + 0
mov cx, 16
mov ah, 2
shl si, 1
mov dl, '0'
mov dl, '1'
mov ah, 6
mov dl, 09h
; now i can't figure out how to turn the binary into ASCII