News:

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

Using cmd

Started by ebichuhamster, September 17, 2009, 12:26:19 AM

Previous topic - Next topic

ebichuhamster

Hey everyone!

Just entered the forum hoping to learn a lot about this. But I'm -REALLY- lost in taking the baby steps.

Here's the thing, I don't intend to use (for now) the SDK which seems really cool.  Our professor required us to use the CMD so we can explore how the register change as we write/assemble/go through our own basic programs.

Ok, so all I read onlines that I should do something like this:
Paste some code, save on some location as a first.ASM file, open CMD, type "masm first" then "link fist" then "first.exe"

The CMD prints out " 'masm' isn't a recognized command..."

This is understandable since all I've done is run the automatic install for the SDK.  I know I'm supposed to tweak some kind of path variables but I tried that and it didn't work.
Maybe it's because I'm running Vista? I heard that setting it up here can be a hassle. 

In any case, if anyone can spare a moment i would be immensely grateful.

(I wouldn't be posting here if I hadn't already spent 2 hours searching tutorials and beginner's guides. I'll keep looking and post if I find out what I'm doing wrong)

Thanks

dedndave

well - if you go to the masm32 download page
get the masm32.zip file (version r9 i think)...
http://www.masm32.com/masmdl.htm
unzip that file
before you run it, close all programs
it is best to let the installer have the system to itself - it doesn't take very long
after it is done, there will be a "masm32" folder on whichever drive you selected (i suggest C:)
the masm program, as well as link, are in the masm32\bin folder
masm is named ML.EXE
if you look in the examples, help, and tutorials folders, you will find a lot of info to get you started
also, Iczelion's tutorials are available here....
http://website.masm32.com/iczelion/iczelion.zip

Slugsnack

just add C:\masm32\bin or whatever to your path environmental variable

MichaelW

Here is a batch file that automates the process:

: Because the environment variables are set in
: a batch file they affect only a copy of the
: environment, and the copy is discarded after
: the batch file ends.
:
: The paths without a drive specification will
: work only if this batch file is executed from
: the drive were MASM32 is installed.
:
: The following environment variables control
: the search paths for executable, include, and
: library files. Setting these so they point to
: the appropriate MASM32 directory will allow
: you to avoid specifying the paths for ML and
: LINK in this batch file, and the paths for
: the INCLUDE and INCLUDELIB directives in the
: source file.

set path=\masm32\bin;%path%
set include=\masm32\include;%include%
set lib=\masm32\lib;%lib%

ml /c /coff /Fltest.lst test.asm

pause

Link /VERBOSE /MAP /SUBSYSTEM:CONSOLE test.obj

pause


http://msdn.microsoft.com/en-us/library/s0ksfwcf(VS.71).aspx

http://msdn.microsoft.com/en-us/library/aa270751(VS.60,classic).aspx
eschew obfuscation

ebichuhamster

hmmm Ok, Im gonna try to write the following in the command line

set path=\masm32\bin;%path%
set include=\masm32\include;%include%
set lib=\masm32\lib;%lib%

ml /c /coff /Fltest.lst test.asm

pause

Link /VERBOSE /MAP /SUBSYSTEM:CONSOLE test.obj

pause

Thanks for the answers everybody!

dedndave

it works better if you go to...
My Computer - Advanced tab - Environment Variables button and enter them into the system EV's

ebichuhamster

OK!

That last part was worked like a charm.

I still don't understand why i need to use those exact parameters on the ml and Link commands but I'm gonna eat through the help files now and the links that were provided.  Probably too much info on that there.

Thanks again!