News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

beginner problems with asm in visual studio

Started by maxim6394, July 18, 2014, 08:36:34 PM

Previous topic - Next topic

maxim6394

I am using visual studio 2013 now and I'm trying to build an .exe from a single .asm file. I am totally new to asm. My problem now is that visual studio tells me the project was built correctly, but it seems that there is no .exe created. when I try to start it from visual studio I get an error message because the file is not found.
why is the file missing?

Gunther

Hi maxim6394,

first things first: Welcome to the forum.

For you as a beginner, I would suggest not to use VS. Download the current MASM32 package from the link in the upper right corner of the forum window. It contains everything you'll need. There are extensive help files, tutorials and well commented examples. That's the right way to success. Go forward.

Gunther
You have to know the facts before you can distort them.

maxim6394

Quote from: Gunther on July 18, 2014, 10:36:49 PM
Hi maxim6394,

first things first: Welcome to the forum.

For you as a beginner, I would suggest not to use VS. Download the current MASM32 package from the link in the upper right corner of the forum window. It contains everything you'll need. There are extensive help files, tutorials and well commented examples. That's the right way to success. Go forward.

Gunther

I have already tried the MASM32 package, but event the simplest test program doesn't start. If I try to execute it, I get the message that says the program doesn't work anymore. I am using windows 7 64bit.

Gunther

That sounds very strange. Did you try the test installation? I've attached it and it runs fine under Windows 7-64. Could you try it, please?

Gunther

You have to know the facts before you can distort them.

Zen

MAXIM6394,   
The easiest way to test the whole MASM and Visual Studio configuration is to compile your ASM code into a DLL using the MASM32 editor and compiler. You should use a DEF file (to declare exports) or declare your functions as PUBLIC so that they are exported.
Then start a project in Visual Studio, write some code in whatever other language you typically write in and, prototype the functions exported from your pre-compiled ASM DLL. You must link to the ASM DLL, and then call the exported function in your Visual Studio code.
As an alternative, you can call LoadLibrary and GetProcAddress, and use the CALL syntax of whatever language you use in Visual Studio.
...Also,...you can just compile your ASM code to an Object file, using the MASM32 compiler, and, copy it into your project directory for your Visual Studio project. Again, you must declare your functions PUBLIC. Visual Studio will add your Object file to its compilation, and the code will be included in your final compiled Visual Studio application.
There are a number of threads on the Old UK MASM Archive concerning this subject (for instance):
Assembly & Visual Studio, Nov 2009
Annoyingly Vague Inquiry, Aug 2009

jj2007

Quote from: maxim6394 on July 18, 2014, 11:40:08 PMI have already tried the MASM32 package, but event the simplest test program doesn't start. If I try to execute it, I get the message that says the program doesn't work anymore. I am using windows 7 64bit.

- launch \Masm32\qeditor.exe

- paste this code:
include \masm32\include\masm32rt.inc

.code
start: inkey "Hello World"
exit

end start


- save as HelloWorld.asm (yes, you must supply the extension)
- Click on menu Project/Console Build All
- Click on menu Project/Run program
- Press any key

maxim6394

Quote from: Gunther on July 19, 2014, 01:09:49 AM
That sounds very strange. Did you try the test installation? I've attached it and it runs fine under Windows 7-64. Could you try it, please?

Gunther

seems to work now, it probably was just a problem with my code or file locations.

Gunther

Hi maxim6394,

Quote from: maxim6394 on July 19, 2014, 08:04:50 PM
seems to work now, it probably was just a problem with my code or file locations.

that's good news. The other examples and tutorials are instructive. Go forward.

Gunther
You have to know the facts before you can distort them.