The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ookami on January 27, 2011, 10:43:46 AM

Title: Help about print
Post by: ookami on January 27, 2011, 10:43:46 AM
Hello,

Is "print" a procedure or a macro ? It seems to be a macro because it does not need a call instruction....Am I right ?

And can you explain me how to use it well (what the meaning of chr$, str$, cat$....) ?

Thank you
Title: Re: Help about print
Post by: oex on January 27, 2011, 10:57:28 AM
print is a macro

you could use it:

print chr$("Some Text")
or
print chr$("Some Text With A New Line"), 13, 10

chr$ is also a macro....

see: \masm32\macros\macros.asm
Title: Re: Help about print
Post by: disintx on January 27, 2011, 11:29:36 AM
Quote from: ookami on January 27, 2011, 10:43:46 AM
Hello,

Is "print" a procedure or a macro ? It seems to be a macro because it does not need a call instruction....Am I right ?

And can you explain me how to use it well (what the meaning of chr$, str$, cat$....) ?

Thank you

macros will make calls to APIs or other functions which either don't or do use the win32 api, which make your life much simpler. follow ookami's advice and give the masm32 help files (:\masm32\help) a once-over; they make the simple things of programming much easier and remove much of the "mundane work" for you to work on more interesting algorithms, whilst still being ultra-efficient.
Title: Re: Help about print
Post by: hutch-- on January 27, 2011, 12:19:58 PM
ookami,

They are documented in the help file on the help menu of the masm32 editor.
Title: Re: Help about print
Post by: dedndave on January 27, 2011, 12:45:19 PM
you can read the docs, as Hutch suggests
but, you can also learn a lot about writing code by seeing how these macros and functions are written   :U
the macros are in \masm32\macros\macros.asm
and the functions are in the \masm32\m32lib folder
Title: Re: Help about print
Post by: ookami on January 27, 2011, 01:11:56 PM
Thank you very much everybody, that's a great help !

Title: Re: Help about print
Post by: ookami on January 27, 2011, 06:27:29 PM
Sorry for the double post.

Dednave, I found all of them in the m32lib folder, and I can open them and see how they are written (they are .asm files).....apart from the masm32 (there is only a .lib and a .inc, but no asm.).  :dazzled:
Where can I find it ?
Title: Re: Help about print
Post by: dedndave on January 27, 2011, 06:27:43 PM
i guess i don't understand what you are asking for
if you mention a specific example function, we can help you out   :U
Title: Re: Help about print
Post by: ookami on January 27, 2011, 06:29:35 PM
Ok I found it, thanks.

Title: Re: Help about print
Post by: dedndave on January 27, 2011, 06:30:56 PM
\masm32\m32lib\stdout.asm

sometimes, you may have to use windows explorer search tool to find the title you are looking for
Title: Re: Help about print
Post by: ookami on January 27, 2011, 06:34:45 PM
Thank you.

In this folder there are only the functions from the masm32 lib, but not the others, right ?
Where can i find the 'crt_system' for example ?
Title: Re: Help about print
Post by: dedndave on January 27, 2011, 06:41:17 PM
that is a function from MS visual C runtime library (MSVCRT.lib)
you can find info for that at msdn, however you won't find the source code for the function

http://msdn.microsoft.com/en-us/library/abx4dbyh%28v=vs.80%29.aspx
Title: Re: Help about print
Post by: ookami on January 27, 2011, 07:00:09 PM
Thanks.

Is there a function in masm32 lib that does the same (pausing the console) ? (sorry for all these questions)
Title: Re: Help about print
Post by: jj2007 on January 27, 2011, 09:13:24 PM
Quote from: ookami on January 27, 2011, 07:00:09 PM
Thanks.

Is there a function in masm32 lib that does the same (pausing the console) ? (sorry for all these questions)

Something like inkey "hit the keybord to get more text" ?
Title: Re: Help about print
Post by: xandaz on January 27, 2011, 11:08:53 PM
   hey jj. Why is italy in your personal image? you italian? Which part?
Title: Re: Help about print
Post by: ookami on January 27, 2011, 11:44:47 PM
Yes ! thank you jj !