The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: pcp190 on May 20, 2010, 11:47:09 PM

Title: Simple Question for Assembling
Post by: pcp190 on May 20, 2010, 11:47:09 PM
Hi, I'm new to assembling but I have a few years of C++. Let's say that I have an assembly file called "basic.asm". I'm trying to assemble the file using a batch file. I can assemble the file and link the file. I am doing this by using a batch file. When I run this file during the command line, the message "Assembling: basic.asm" appears and the rest of the program runs. Is there anyway that I can turn off the "Assembling: basic.asm" message? If you have any ideas, that would be great.
Title: Re: Simple Question for Assembling
Post by: dedndave on May 20, 2010, 11:57:11 PM
we use batch files for assembly and linking as well
however, if there are any errors, you will want to see them
we usually redirect the text output of the assembler to a .TXT file and display it at the end of the batch
you can do the same thing, only redirect output to the NUL device

this is the line from my batch file for assembling console-mode apps
\masm32\bin\ml /c /coff %1.asm >\masm32\bin\asmbl.txt

then, for linking, we append to the same text file with
\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF %1.obj >>\masm32\bin\asmbl.txt

this is a modified version, that should display nothing
\masm32\bin\ml /c /coff %1.asm >nul
\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF %1.obj >nul


if you like, you might redirect the output of both the assembler and linker to a text file as shown above
then, just don't display the text file
that way, the error report will be there if you need it
Title: Re: Simple Question for Assembling
Post by: oex on May 23, 2010, 12:06:35 AM
heh ty Dave I have found a great usage for that :bg
Title: Re: Simple Question for Assembling
Post by: dedndave on May 23, 2010, 12:25:58 AM
that's some old stuff, there - lol
you can also redirect input
i used to disassemble programs using the old DEBUG program with a text file that had all the debug commands
the last command in the text file was "<con", which switched debug input back to the console   :P
Title: Re: Simple Question for Assembling
Post by: oex on May 23, 2010, 12:31:38 AM
:lol before my time.... I'm thinking on a quick app to parse the text file for the error text and open that file.... Eventually when I finally finish my editor I can get it to scroll to the right place also :bg
Title: Re: Simple Question for Assembling
Post by: dedndave on May 23, 2010, 12:36:41 AM
you should use the forum search tool and look for a little utility i wrote called BATCHNUM
you could also incorporate something similar to that into an editor

bascially, you could use contional assembly with the @ECHO assember directive and use that to control batch flow
Title: Re: Simple Question for Assembling
Post by: oex on May 23, 2010, 12:57:17 AM
:lol well you obviously didnt name it in your original post

I piece of music I like called "One divine neuron" just came on on winamp.... It's awesome.... real spaced out :bg
Title: Re: Simple Question for Assembling
Post by: dedndave on May 23, 2010, 01:18:55 AM
here is the post that has it

http://www.masm32.com/board/index.php?topic=13233.msg102956#msg102956

i was going to make an assembly batch file to go with it for myself   :bg

in the assembler text, i could then control the batch flow
for example....

bit 1  -  use LINK=0 or POLINK=1
bit 2  -  use a resource file during linking
bit 3  -  console app (0) or WinGUI app (1)

in the assember file...
@ECHO BATCH=5

would cause the batch file to assemble and link it as a GUI app using POLINK

you could control other things like 16/32/64 bit etc
Title: Re: Simple Question for Assembling
Post by: oex on May 23, 2010, 01:41:32 AM
well that's weird, it comes up in the search now...???? There is dodgy search functionality on this forum ::)

I will leave the page open for the morning.... It's 3am again and I'm still coding, story of my life, I had a quick look and all I see are 0s and 1s :lol
Title: Re: Simple Question for Assembling
Post by: clive on May 23, 2010, 01:43:26 AM
Another trick to remember for applications that send error information to STDERR, which is not captured by the STDOUT redirection, is to use 2>

ie  FOO  >std.log  2>err.log
or FOO  >nul  2>nul
Title: Re: Simple Question for Assembling
Post by: dedndave on May 23, 2010, 02:16:12 AM
good one Clive   :U
don't think i ever used that one
in 16-bit code, you can use INT 29h (fast console output) to display characters that cannot be redirected
i suppose there is some fancy switch on WriteFile for that (or maybe you have to open the con device)