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
was in russian interface
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.
2) You must greatly increase your skills in "basic algorithms" like dec to string, string to dec, print string by symbols etc.
3) You must learn that though assembler is a very strange language it does not mean you must wrote programs in nasty style. Use procedures, local labels etc like in any normal language.
4) I just wanted to show a short example, but it seems I could not write short %)
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