News:

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

Simple Question for Assembling

Started by pcp190, May 20, 2010, 11:47:09 PM

Previous topic - Next topic

pcp190

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.

dedndave

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

oex

heh ty Dave I have found a great usage for that :bg
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

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

oex

: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
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

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

oex

: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
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

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

oex

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
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

clive

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
It could be a random act of randomness. Those happen a lot as well.

dedndave

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)