The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: chili on February 01, 2006, 07:17:05 PM

Title: echo out
Post by: chili on February 01, 2006, 07:17:05 PM
I wanna prompt a variable that is calculated during assembly to a separate file. How can i change stdout within my ".asm" file?
(I tried it like in ".bat-files", but it won't work.)

frank
Title: Re: echo out
Post by: P1 on February 01, 2006, 11:30:56 PM
Please explain what your doing.  Or maybe post some code.  Because it sounds like to me, your asking a DOS commandline style question.  I don't know if I should move this post there or you still have a desire for a Win32 solution.

Regards,  P1  :8)
Title: Re: echo out
Post by: MichaelW on February 02, 2006, 12:52:14 AM
The ECHO and %OUT directives send their output to the standard output device, so the output can be redirected on the command line, using something like this:

\masm32\bin\ml /c /coff "test.asm" > asmout.txt

For the ECHO and %OUT directives the argument must be a single text value, so to handle a numeric value you must first convert it to text. You can do the conversion with the MASM32 num2str macro and output the converted value with:

% echo num2str(arg)

Or:

% %out num2str(arg)