I want to display the value in the Al register which is in my case 0Ah and here's my code but nothig happens , I am not sure but I think that my problem is that I have a hexa number in the register but I can only print Char or strings so is there a way to convert the hexa number to a string for example
Here's the code I used :
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
.data segment
Array DB 0h,0h,0h,0h,0h
x db 0h
result db ?
.code segment
mov si,0
loop1:
;these 5 lines allows me to take
;input and let it be shown on the screen
mov ah,08h
int 21h
mov ah,02h
mov dl,al
int 21h
;those 3 lines allows me
;to start my code when
;enter button is pressed
mov bl,0Dh
cmp bl,dl
JZ start
;those 4 lines allow me
;to enter 4 chars and
;fill an array with them
;to use them later
mov array[si],dl
inc si
cmp si,5
jne loop1
start:
;putting each element in the
;array in a register to be
;able to deal with it
mov si,0
mov al,array[si]
mov bl,array[si+1]
mov cl,array[si+2]
mov dl,array[si+3]
;subtracting 30h from each
;number to turn it to its
;decimal form to deal with
;it as normal number
sub al,30h
sub bl,30h
sub cl,30h
sub dl,30h
;adding all numbers in
;variable called result
add al,cl
add al,bl
add al,dl
;printing
mov ah,02h
mov dl,al
int 21h
ret