Hello I need some help with this problem, I need to get an input from the user an ASCII character and print back its decimal value so for example:
Input A --> Output 65
Input B --> Output 66
.model small
.stack 100h
.data
msg1 db 10,13,"Enter a number: $"
msg2 db 10,13,"in decimal is : $"
.code
main proc
mov ax,@data
mov ds,ax
input:
lea dx,msg1
mov ah,09h
int 21h
mov ah,1h
int 21h
mov bl,al
cmp bl,0dh
je end
lea dx,msg2
mov ah,09h
int 21h
mov cx,4
convert:
mov dl,bh
shr dl,1
shr dl,1
shr dl,1
shr dl,1
cmp dl,9
jbe num
add dl,55d
jmp display
num:
add dl,30h
display:
mov ah,02h
int 21h
rcl bx,1
rcl bx,1
rcl bx,1
rcl bx,1
loop convert
end:
mov ah,4ch
int 21h
main endp
end main;
This is my code but it prints the result in hex and I want to show it in decimal. How can I have it print the result in decimal?