News:

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

Really stupid question...

Started by bluemoon, December 09, 2008, 11:20:11 PM

Previous topic - Next topic

bluemoon

I am very new to MASM32 and assembly.  I don't know what steps it takes to compile and build assembly .EXE files.  I recently asked a question on databases and someone gave me a link to sample code.  Every way I try to build or compile it, it gets errors.  What steps do I take?  The files I have to work with are listed below; please help me out.   :cheekygreen:

MAKEFILE
ODBCTest.asm
ODBCTest.exe (Came with source code, but is deleted when I try to build)
ODBCTest.rc
res.h

The other files are just a read Me file and a MS Access database.

How do you build or compile this source code in MASM32?  I feel really silly asking this, but if I don't ask I'm not going to learn or get anywhere.  I get fatal errors on every file I try to build or compile.  I know this is silly, but I am a virgin assembler lol.  I have Visual Studio .Net installed and double clicking most the files opens it up in Studio; I need to set them to open with masm.  I know there must be a simple way to open these files and create a .EXE program, but right now I am stumped.  I hate posting such a lame question on here but I have to start somewhere.  I am familiar with C#, C++, and VB but that doesn't help me with MASM32.  Sorry to bother you, but please enlighten me to my errors.

Brian  ::)

BlackVortex

You should setup RadAsm and set its file associations. Then you can edit your sources and assemble through that.
http://www.radasm.com/

P.S.: Oh, you also need the radasm masm language package and to set the language to masm.

bluemoon

I've tried RadASM and also MasmEd and still can't compile an exe file.  I thought MASM32 was all that was needed???   I even downloaded EasyCodeMasm.  There is obviously many different software to write assembly in.  Why can't MASM32 do this?  I'm new to this code, what software is best for assembly?  This website is for MASM32 so it would seem MASM32 would be the best?  I'm lost...

Mark Jones

I was too when I first started. Since the assemble and link commands are essentially DOS-style commands, sometimes it helps to start over from that context. I can't help with the other projects at the moment, but if you go back to my example at:

http://www.masm32.com/board/index.php?topic=1891.msg58065#msg58065

and look at the Makeit.bat file, THAT should unconditionally recompile it. The batch file will pause when finished building so exactly what was done can be seen.  If that does not work, then something is wrong with your installation of MASM32. (Also, perhaps not mentioned, it greatly helps to place the \masm32\bin folder in the PATH statement, and code should be assembled on the same drive as MASM32. It is NOT recommended to install MASM32 into a path with spaces or other strange characters in it, nor from a network drive or other shared path.)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

MichaelW

bluemoon,

To build the Iczelion ODBC example with the MASM32  Quick Editor:

Place all of the files from the archive in a directory on the same drive as the MASM32 directory (can be under the MASM32 directory, but does not need to be).

Rename ODBCTest.rc to rsrc.rc.

Start Quick Editor, navigate to the directory, and open ODBCTest.asm.

At the top of the file, after the line ".model flat,stdcall", add the line "option casemap:none".

Save the changes.

On the Project menu, select Build All.
eschew obfuscation

fattypotato

I was lost until I the forum told me to check out Iczelion's tutorials.  This is especially true if you use Hutch's MASM32 package, they kind of go hand in hand.  Anyway there you can find instructions on how to assemble and link from the DOS cmd line.  You can also look at Iczelion's make files for each chapter in the tutorial which also show how to compile and link resource files into your exec.

bluemoon

Thanks MichaelW and all who wrote.  Renaming files and adding more code is new to me... it worked though.  Why did I have to rename files and add more code?  He he yea I'm going to read them tutorials.  This all different than any other language I've worked with.  I am dedicating myself to assembly.  But I have much to learn.  Thanks for posting help to my silly questions, but to me its not all that silly   ::)  I don't yet understand why someone would release sample code that has to be renamed and added to just to use it?  But I am slowly learning.  Thanks for the help everyone!  I just get to study this in my spare time and I try to memorize every detail I learn.  But so far assembly is more difficult than the other languages I've learned.

Peace
Brian  :clap:

MichaelW

I'm not sure if the missing line was a mistake, or was the norm at the time this tutorial was crated (~2000). I was able to readily identify the problem because I have seen it before, but only once or twice in the last 4-5 years. The rsrc.rc name for resource definitions is a requirement for the batch files that Quick Editor uses.

The error messages returned by the tools are key to diagnosing problems. When you report a problem, you should include the error messages, or at least a sample if there are many similar error messages, as was the case here.
eschew obfuscation

bluemoon

That's good to know.   :U  I'll remember that if I run into any more errors.  Thanks for the help!  I have much to learn.  I downloaded some e-books on assembly language that I think might help me?  But I learn better like this with hands on.  Thanks to everyone that helped me.

Brian  :cheekygreen: