Hello, I recently began learning masm32 and I have to say I'm really enjoying it, the one thing I can't seem to figure out is compiling through the command line. I have been following Iczelion's tutorials and they are really great, whats troubling me is when I get to this line.
ml /c /coff /Cp msgbox.asm
I get a A100 error, I understand this is because the file is not in the same directory as ml.exe, is there a way I can compile a program without the asm files being in the same directory as ml.exe?
Thanks and sorry If I am being a little unclear :P
You start from the folder of your source, and supply the full path to ml:
\Masm32\bin\ml.exe /nologo /c /coff Msg.asm
The source, of course, must contain the path to the includes (no C: etc please):
include \masm32\include\masm32rt.inc
.code
start: MsgBox 0, "Hello World", "Masm32:", MB_OK
exit
end start
Welcome to the forum :icon14:
Quote from: samcp12 on July 29, 2013, 03:50:28 PM
is there a way I can compile a program without the asm files being in the same directory as ml.exe?
Sure. I made a batch file that should be run first before assembling:
@echo off
set PATH=%PATH%;C:\masm32\bin
Or if you are kinda lazy, just put in %PATH% permanently.
Using environment variables is one way to assure that your proggies run on your puter only. There are really good reasons why Masm32 has hard-coded paths.
Well, MASM32 by default will be installed in C:\masm32, and I only put the bin directory in PATH.
The source codes themselves are not touched. So this should be safe, no?
:biggrin:
You can use a other way without set the environment variables
\masm32\bin\ml /c /coff /Cp msgbox.asm
\masm32\bin\link /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /OUT:"msgbox.exe" "msgbox.obj"
Thanks guys! I managed to get it working, seems like a really great forum.
Hi samcp12,
Quote from: samcp12 on July 29, 2013, 09:04:12 PM
Thanks guys! I managed to get it working, seems like a really great forum.
yes indeed. And welcome to the forum.
Gunther
Welcome to the forum
Magnus
Welcome to the forums.
Andy