For example I have the number 6C0000h = 7077888d
Dividing each word by ten and then saving the remainder on the stack doesn't work in this case, because the lower part of the double word is 0000.
Any tips are appreciated.
thanks
for example..
;number = 6c0000h
mov ax,word ptr number
;after this mov ax is 0000
;dividing by ten will mean dx = 0 and ax = 0 and 0 is saved on the stack
mov cx,0
repeat:
mov dx,0
div ten ;ten = 10
inc cx
push dx
cmp ax,0
ja repeat
mov ax,word ptr number+2
;after this ax is 6Ch
;i think this part is alright
repeat2:
mov dx,0
div ten
inc cx
push dx
cmp ax,0
ja repeat2
display:
pop dx
add dl,'0'
mov ah,02h
int 21h
loop display
this code displays: 1080 and not 7077888 which would be the expected result
108 = 6Ch and the ending 0 is from 0000 div 10..
NOTE: I have to work with 16bit registers