Hi,
Im just starting out attempting to learn assembly, and ive come across what is probably a really simple stumbling block.. The aid of google has failed me this time and im hoping someone on here can help me.
I started writing a simple program that takes input for an option, and my first option would be to "show the dos version"... Ive ran my code through a debugger and "i think" it is all working correctly, apart from the section of my code that prints the output to screen. Im fairly sure from my limited ASM debugging knowledge that AL contained 05, part of the DOS version after the INT was executed.
My problem is i cant print it to the screen, ive tried INT 21 - 09 and 02 functions... This is my code...
.model small
.stack
.data
.code
main proc
MOV AH, 30h ; Get DOS Version
INT 21h ; Execute INT
MOV DL, AL ; Place return in DL for screen output
MOV AH, 09h ; Print String
INT 21h ; Execute
main endp
end main
Ive ripped all the input/select option stuff out and ended up with the above for the moment while i get this working. I know i could compare whats in AL and print a string such as "this is dos 5", but i realy want to be able to print an integer. The obvious issue i think i have is that INT 21h function 09 and 02 are for printing strings?? Ive gandered through the available functions for INT 21 and i cant seem to find anything that prints an integer.
Ive seen examples on the NET that use C++ functions to print it to the screen, but id much rather do it in raw ASM if possible??
Thanks in advance for your help.