I have just started to learn the 8086 assembly language.The task is to print the sum of 2 16 bit numbers.Here's my code:
org 100h
start:
mov al,5
add al,3
mov dl,al
mov ax,2h
int 21h
end start
But the output is the ascii value of 8.I want to know if there is a way to print the decimal value of 8.If yes then how???
You have to convert the number to ascii string yourself, it's assebmler :)
In windows you can try to call "printf" from msvc library
Ord('0') = 48
you need to add 48 and 8, then assci value will be 56, and assci character will be '8', to print number with more than 1 digit, you must divide it by 10, until it is not zero.
I'm learning assembler in school this year and I find it very interesting. :)
Here is my code for Sum Of Two Numbers problem.
http://pastebin.com/Wuwi9Azd