i can't assemble and run a single file! i am using MASM32 and when i click assemble a text document pop up with some info and when i click run program nothing happens. Please can anyone help me?
Posted on 2004-08-18 12:15:03 by patriziacharms993
What do you mean "some info"? Perhaps there's an error in the code. Could you post that text document?
Posted on 2004-08-18 13:26:03 by QvasiModo
i compiled a sample code i found in the tutorial section of my compiler. But i now see that there are more options. In the image i attach, i click the "Assemble ASM File", which i think functioned ok, and then "Run program" ( at the bottom of the menu ) but nothing happened. Should i click to something else from all these options:
?
Posted on 2004-08-18 14:16:01 by patriziacharms993
Compiling with Masm32 has three steps:
1) Compiling resources
2) Assembling
3) Linking

Step 1 is optional (only needed if you have a .rc file).
Step 2 takes your .asm and .inc files and generates a .obj file.
Step 3 takes your .obj and generates the executable.

If you click on the "Build All" option, all needed steps will be performed automatically. All other options are for better control of the compile process, or custom steps (the "Run Makeit.bat" option will literally run a file named "makeit.bat" if there is one in the current folder).

Hope that helps. :)
Posted on 2004-08-18 14:30:24 by QvasiModo
ok thank you now there's difference but:
1) why i never see a .inc file?
2) when i run the program nothing is printed. wha'ts wrong?


; ?????????????????????????????????????????????????????????????????????????

; Build this with the "Project" menu using
; "Console Assemble and Link"

; ?????????????????????????????????????????????????????????????????????????

.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive

include masm32includewindows.inc ; always first
include masm32macrosmacros.asm ; MASM support macros

; -----------------------------------------------------------------
; include files that have MASM format prototypes for function calls
; -----------------------------------------------------------------
include masm32includemasm32.inc
include masm32includegdi32.inc
include masm32includeuser32.inc
include masm32includekernel32.inc

; ------------------------------------------------
; Library files that have definitions for function
; exports and tested reliable prebuilt code.
; ------------------------------------------------
includelib masm32libmasm32.lib
includelib masm32libgdi32.lib
includelib masm32libuser32.lib
includelib masm32libkernel32.lib

.code ; Tell MASM where the code starts

; ?????????????????????????????????????????????????????????????????????????

start: ; The CODE entry point to the program

print chr$("Hey, this actually works.",13,10)
exit

; ?????????????????????????????????????????????????????????????????????????

end start ; Tell MASM where the program ends


3) what does "Link OBJ File" do?

thank you!
Posted on 2004-08-18 14:53:34 by patriziacharms993

; Build this with the "Project" menu using
; "Console Assemble and Link"


hey i just now see this and it worked ok now!!

but what's the difference of this between the other options? ( and don't forget the other 2 questions of my previous post :) )

thank you...
Posted on 2004-08-18 14:56:03 by patriziacharms993
No prob :alright:

1) Header files (.inc) are optional (like .h files in C and C++). Take a look at this lines in the source you posted, this instructs MASM to read some .inc files:
    include masm32includemasm32.inc

include masm32includegdi32.inc
include masm32includeuser32.inc
include masm32includekernel32.inc


2) For "console mode" and "gui mode" apps the third step (linking) is slightly different, so QuickEditor has different menu items for each one. It's been a while since I used that editor so I forgot about it, sorry :o

3) It's the third step (converts the .obj into the executable).
Posted on 2004-08-18 17:50:53 by QvasiModo
bron - maybe you will feel better if you use WinAsm Studio. Here is the link: http://www.code4u.net/winasm/ ,it is similar to Visual Studio and simplyfies manny tasks.

Also a good debugger is Olly for writing general win32 apps (if you go into driver creation the SoftiCE is the best answer)
Link http://home.t-online.de/home/Ollydbg/
Posted on 2004-08-18 17:57:09 by Black iCE
I would assume the difference between the normal and console build is the linker commands... "/SUBSYSTEM:WINDOWS" or "/SUBSYSTEM:CONSOLE". The single dword change tells windows whether to create a console for the application or not.
Posted on 2004-08-18 19:11:14 by f0dder
thank you all very mush! :) And personally i find it very helpful when i see the corresponding assembly things in C ( .inc == .h for C, thanks! ) It makes me understand things MUCH easier

But i have one small question.
With "Assemble" you create the .obj from .asm.
With "Link Obj" you create the .exe from the .obj.
With "Assemble and Link" you do the previous things in one step.
Then what "Build all" does??
thanks..
Posted on 2004-08-19 03:20:06 by patriziacharms993