• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

MASM32, cant find msgbox.asm?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Bmxpunk86pl

Member
Joined
Sep 7, 2001
Location
CT/Poland
Ok i wanna get more into how windows workes so I'm learning assembly. I know it preety much but now its time to learn how to program with it. I got masm32 and made a little program that i have the source code here:

;
.386
.model flat, stdcall

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib\masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
.data
MsgBoxCaption db "This is my first program",0
MsgBoxText db "Asm Rocks",0

.code

start:
invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK




invoke ExitProcess,o
end start

Some of the code needs to go one one line, but i cant fit it.

Ok so i go and extract masm32 to my windows folder and then i go to ms dos and type in:

C:\>ml /c /coff /Cp msgbox.asm [and i hit enter]

Then i get a error saying that mams cannot find msgbox.asm
I cant figure out why this will not work?

Thanks for any help

Adam
 
I know very little about this but aren't you supposed to save the code first as msgbox.asm then assemble it. Also the code shows a o instead of a zero at invoke ExitProcess,0 and how about a space after includelib at includelib \masm32\lib\kernel32.lib
 
Thank you for the problems found in my code. I fixed them, but that still would not find the file and yes i did save it before compiling it.
 
change to the directory that has msgbox.asm in it. So it would be:
C:\sourcecodedir>ml /c /coff /Cp msgbox.asm

When doing it the way you are now its looking for msgbox.asm in your root C:\. I assume you organize your files better then that and msgbox.asm isn't in C:\
 
visidex, here is what i did.

I made a folder called test in C:\test. Then i copied ml.exe nmake.exe and link.exe to it and my source code (msgbox.asm) to it.

Now i went to ms dos and gave this command:

c:\test\ml /c /coff /Cp msgbox.asm

And i still got the error:



C:\>c:\test\ml /c /coff /Cp msgbox.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.

Assembling: msgbox.asm
MASM : fatal error A1000: cannot open file : msgbox.asm

C:\>

I cant figure out what the problem is.

Thanks for help.
 
My guess is that it is looking for msgbox.asm in the current directory, which looks like C:\ in your case.

cd into C:\test and then do it.
 
thanks for the help so far. Ok i did what xwred told me to do, which is to cd c:\test but that still didnt work.

Ok i do not know what else to do.


Does anyone recommend a better asm compiler? Perferebly a Windows GUI style instead of dos?


Thanks,
adam
 
yea it does, I triple checked. I dont kno, I probobly doing something at fault here. Here is what I did exactly

1. I copied ml. exe and link.exe to c:\test.
2. Then i copied msgbox.asm to c:\test.
3. Then i went to ms dos and typed in cd c:\test.
4 Then i typed in /c /coff /Cp msgbox.asm
5. Then i get a error saying that it cant find msgbox.asm.


Thanks,
Adam
 
ok now i tried TASM and it cant find the file. I dont know what the hell i am doing wrong. Maybe if someone could write some insturctions step by step for me lol, of what to do.


Thanks,
adam
 
What the heck is '/c /coff /Cp msgbox.asm' supposed to do? Thats not even a valid DOS command as far as I know. Looks like you are putting switches in front of what isn't even an executable.
 
sorry xwred1, i meant to say "ml /c /coff /Cp" so it would look like this at the command prompt: c:\test>ml /c /coff /Cp msgbox.asm

/c -assembles
/coff - tells masm32 to creat a .obj file in coff format, somethin to do with unix.
/Cp-preserve case of user identifiers.

thanks,
adam
 
Last edited:
Back