News:

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

Instructions, to run MASM.

Started by stk, February 07, 2007, 09:50:51 AM

Previous topic - Next topic

stk

Hello,

@TNick:

i have done what you have said:

i've created a file "makeit.bat" with this:

masm32\bin\ml /c /Cp /I"C:\Programme\MyProg\masm32\include" MyFirst.asm
masm32\bin\link /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /LIBPATH:"C:\Programme\MyProg\masm32\lib" MyFirst.obj

in the first line i have deleted /COFF because with this i've got an error-message,

then i've created the file "MyFirst.asm" with this:

.586
.MODEL FLAT, STDCALL
OPTION CASEMAP:NONE
INCLUDE windows.inc
INCLUDE kernel32.inc
INCLUDE user32.inc

INCLUDELIB kernel32.lib
INCLUDELIB user32.lib

.CONST
AppName BYTE  "My first app using masm32",0
MESSAGE BYTE  "Damn, it works!!!",0

.CODE
App_Entry_Point:
INVOKE MessageBox, NULL,ADDR MessageBox,ADDR AppName,MB_OK
INVOKE ExitProcess,NULL
END App_Entry_Point




i had to change this line:
INVOKE MessageBox, NULL,ADDR Message,ADDR AppName,MB_OK
to this:
INVOKE MessageBox, NULL,ADDR MessageBox,ADDR AppName,MB_OK

and this line:
END App_Entry_Poiny
to this:
END App_Entry_Point
because of error-messages,

after this all, i've doubleclicked on "makeit.bat" to run the programm.

this generated the file "MyFirst.obj"

and at the end of the story i have got the following error-messages:

MyFirst.obj : warning LNK4033: converting object format OMF to COFF
MyFirst.obj : error LNK2001: unresolved external symbol _MessageBoxA@16
MyFirst.obj : error LNK2001: unresolved external symbol _ExitProcess@4
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
MyFirst.exe : fatal error LNK1120: 3 unresolved externals


Can you help me?

Thank you!

greetings,
stk

hutch--

If you are not setting the environment, then your app cannot find the include files and libraries as you only name the files, not their path as well.

This code,


.CONST
AppName BYTE  "My first app using masm32",0
MESSAGE BYTE  "Damn, it works!!!",0


Should be in the .DATA section. Try this.


AppName db "My first app using masm32",0
MESSAGE db "Damn, it works!!!",0


The basic mechanics of an ML command line require BOTH the /C (assemble only) and the /COFF if its 6.14 so it builds a COFF object module.

path\bin\ml.exe /c /coff yourapp.asm

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

stk

Hello,

thank you.

Should i type " .CONST " above this two lines or nothing:
AppName db "My first app using masm32",0
MESSAGE db "Damn, it works!!!",0

and i must change this line:
masm32\bin\ml /c /Cp /I"C:\Programme\MyProg\masm32\include" MyFirst.asm
to this:
masm32\bin\ml /c /COFF /Cp /I"C:\Programme\MyProg\masm32\include" MyFirst.asm

right?

Another questios, can i use this Tutorial (35 chapters)
for MASM?
http://win32assembly.online.fr/tutorials.html

Thank you!

stk

stk

Hello,

"Damn, it works!!!" :dance:

Now i know what the problem was.
I've typed the wrong Path in the "INCLUDE" lines,
and i had to add /COFF again.

But now it works!

thank you and greetings,
stk

TNick

Hello, stk!

Sorry for those mistakes, I was at the end of my work time and in great hurry. Glad to hear it's all working.  :U

Quote from: hutch-- on February 07, 2007, 10:27:06 AM
This code,


.CONST
AppName BYTE  "My first app using masm32",0
MESSAGE BYTE  "Damn, it works!!!",0


Should be in the .DATA section. Try this.


AppName db "My first app using masm32",0
MESSAGE db "Damn, it works!!!",0


Hello, hutch!
Why would you say it should be in .DATA section? He doesn't have to modify those... BTW, is a matter of taste turning "BYTE" to "db"? Or is something I don't know about this?

Regards,
Nick

hutch--

Initialised data in the .DATA section, Uninitialised data in the .DATA? section.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

stk

Hello,

@TNick:

no problem, now it's all working. :thumbu

greetings,
stk