News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Newbie Question

Started by samcp12, July 29, 2013, 03:50:28 PM

Previous topic - Next topic

samcp12

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

jj2007

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:

anta40

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.

jj2007

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.

anta40

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:

ragdog

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" 

samcp12

Thanks guys! I managed to get it working, seems like a really great forum.

Gunther

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
You have to know the facts before you can distort them.

daydreamer

Welcome to the forum
Magnus
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Magnum

Welcome to the forums.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org