News:

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

Main Menu

Hi All

Started by Mondragon, June 10, 2017, 07:18:57 PM

Previous topic - Next topic

Mondragon

Hello all, I don't want to make a scene but the instructions here are very clear about the spam issue and to make a posting so the account doesn't get deleted. Well, I'm human, I promise!

MASM has been the first assembly language I've learned because I learned by incorporating it into a few "C++" (I actually just use C but it's called VC++ in VS) programs. Been doing extern "C" and then linking in .asm files.

I'm going to go looking for some good newbie guides, but while I'm here, I might as well ask... Anyone have any tips on learning how to call up Win32 API funcs in ASM? I think my main question here is, must you include the Win32 header file in the actual .asm file or is it sufficient to include it in the C++ file that uses the .asm code? Thanks.


Vortex

Hello,

Welcome to the forum. I can recommend you to start with Iczelion's Win32 Assembly Tutorials

felipe

Quote from: Mondragon on June 10, 2017, 07:18:57 PM
I think my main question here is, must you include the Win32 header file in the actual .asm file or is it sufficient to include it in the C++ file that uses the .asm code? Thanks.

Welcome to the forum. I don't know about c++, but i recommend you the use of the masm32 sdk, comes with all the include and lib files you will almost need. So you can do assembly programming and forget about c++.  :biggrin:

aw27

Quote from: Mondragon on June 10, 2017, 07:18:57 PM
have any tips on learning how to call up Win32 API funcs in ASM?
It is easier than you think, have a look at my article and download the sources.

PS: Welcome on board!

hutch--

Mondragon,

The 32 bit version of MASM requires prototypes if you want to use its higher level notation. You can call API functions with PUSH/CALL notation but in most instances you get no advantage and its harder to read and write. You need both the libraries built for MASM and the include files. Current version of 32 bit ML.EXE (MASM) dates 2017 so its up to date but still as bad mannered as MASM always was.

Link at the top right of the page will get you a working 32 bit environment but you will have to provide the help files from Intel and Microsoft. You cannot use C header files with MASM.

Mondragon

Great thanks for the resources guys. I'm installing the SDK now and also going to read thru the Code Project article.

aw27

Quote from: Mondragon on June 11, 2017, 04:43:29 AM
Great thanks for the resources guys. I'm installing the SDK now and also going to read thru the Code Project article.

Final note: You must not link with the libraries of the SDK, or any other libraries, from your MASM project. The reason is that the C++ linker will do the linkage for the whole project. In the MASM just put the prototypes for the external functions or rely on the include files of the SDK.


jj2007

To get you started:include \masm32\include\masm32rt.inc

.code
AppName db "Masm32:", 0

start: MsgBox 0, "Hello World", addr AppName, MB_OK
exit

end start


\masm32\include\masm32rt.inc is a text file, you can open it in qEditor or Notepad.
It contains the frequently used libraries. If you need something more exotic, one line does the job:uselib whatever

Have fun :biggrin: