The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: rom87 on April 02, 2009, 01:13:23 PM

Title: Noob beginner question
Post by: rom87 on April 02, 2009, 01:13:23 PM
Whats the easiest calls or interupts i can use to print to console for output,input,text colour etc.



How do i convert a 1 byte ascii say 'y' for example to decimal value  ?


Thanks
Title: Re: Noob beginner question
Post by: BlackVortex on April 02, 2009, 09:07:03 PM
Are you making a DOS program or a windows console program ?

The masm32 library has some very easy macros for printing to the console and getting input from it (non-DOS though)
Title: Re: Noob beginner question
Post by: rom87 on April 02, 2009, 09:29:12 PM
For the dos console window have tried stdout but am wondering what else i could use  ?
I tried the interrupt for exiting a program insteed of exitprocess just to test it but it didnt work and just frozze the program.
Title: Re: Noob beginner question
Post by: BlackVortex on April 02, 2009, 09:44:13 PM
So, you aren't programming for DOS, you're programming a win32 program that has no GUI and only a console. So forget about DOS and its interrupts and use only APIs and macros from the masm32 library.

Open \masm32\help\hlhelp.chm and check out the Console Mode Macros. You also have to include macros.asm in your source.

Example of a macro :
SetConsoleCaption offset YourTitleHere
Title: Re: Noob beginner question
Post by: rom87 on April 02, 2009, 11:25:57 PM
Ok thanks how i do print the decimal value of a register using the print macro ?


print hex$ (edx);for example


Also what does the second parameter of print  do  ?
Title: Re: Noob beginner question
Post by: BlackVortex on April 03, 2009, 12:21:12 AM
print takes a sequence of parameters or only one.

print "This is an empty line ",13,10   ; the 13,10 bytes make a new line

hex$  and str$ are different macros. You really should rely on the help and a little trial and error to figure things out for yourself. Also, this thread is in the wrong section (now)

Your example works fine :
print hex$ (edx)