News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Noob beginner question

Started by rom87, April 02, 2009, 01:13:23 PM

Previous topic - Next topic

rom87

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

BlackVortex

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)

rom87

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.

BlackVortex

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

rom87

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  ?

BlackVortex

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)