I have a number stored in dl, and I need this to work for numbers up to three digits? Here is the working code for digits 0-9.
WriteNumber:
;; print out number in dl
push ax
push dx
add dl,"0"
mov ah,02h ; printing one char
int 21h
pop dx
pop ax
ret
For example, for two digits. I could take dl/10. And then print out the result and the rest as to different chars. But I got an error, because the number needs to be in AX register for the DIV.
I need to do this:
mov ax,dl
But that won't work?