News:

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

how do you make excutables?

Started by Hyperian, October 13, 2007, 03:16:27 AM

Previous topic - Next topic

Hyperian

I've tried using masm32 to assemble a program i've made but is there a way to do it without having to "include" all those files that i see in the demo programs?

cause it keeps giving me this error when i try to link

LINK: error LNK2001: unresolved external symbol _WinMainCRTStartup
l3p2.exe : fatal error LNK1120: 1 unresolved externals

so i've used Ml.exe version 6.15.8803 and put in the command
Ml /Fl l3p2.asm

and i got a obj file but then link.exe gives me this error that say invalid object module when i do
link.exe l3p2.obj

hutch--

Hyperian,

The trick is to learn what MASM does, not what you want it to do. The assembler ML.EXE converts assembler code into object modules, neither more nor less. To make it into an executable file you need a linker as it creates the startup code for the file format used in win32 or with an old linker 16 bit DOS.

The includes can be done away with but the external libraries cannot as they contain the required information for the linker. If you take this approach all you need to be able to do is either write any prototype for any system call you need OR know how to call it manually. The desire for a simple inclusive source file that does everything is not how MASM is constructed.

You can do what you are after with FASM but you need to know how to call every system call (API) yourself unless you want to use other includes yourself. FASM can build EXE and DLL files without a linker.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Hyperian

mm ok.. so how do i link the obj file to create the exe? i have the link.exe program but i havent really learn how to link it TO things.

i dont think i know how to do the system call since i just started doing ASM

Hyperian

oh wait nm i figured out how to use the link program thx.

another problem. during debug i would like to scroll up in command prompt, is there a way to do that? cause there is a scroll bar but it disappears when i go into debug mode

MichaelW

What do you mean by "debug mode"?
eschew obfuscation

Hyperian

debug mode i mean when you're in command prompt and you type 'debug' and press enter.

Vortex

DOS debug is only for 16-bit applications.

Hyperian

yes but command prompt can simulate that i think.. i'm actually using it to do class work :| but that's besides the point.

i cant seem to figure out how to make the screen bigger or scrollable during debug mode.

GregL

Hyperian,

Right-click at the top of the screen, then click Properties. ... I see what you mean, it won't go larger than 80 x 43. Debug is a 16-bit DOS program.

hutch--

Hyperian,

You are assuming a technology that does not apply to the currect 32 bit or coming 64 bit assembler code that is current. Command line debug is an ancient 16 bit real mode dos tools, there is no 32 bit or 64 bit versions nor will there be.

Try using modern assembler tools and try out Ollydebug and you will be close to the mark.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Hyperian

wow i ran the ollydebug program and i have no idea how to use it lol

Mark Jones

We should probably post this as a sticky note somewhere, lol. See this link:

http://www.masm32.com/board/index.php?topic=7861.msg57718#msg57718
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Hyperian

oh i know like how to read Hex, i mean i'm confused cause i dont know how the interface works. cause i see this 32bit address and i load a program and i dont know where it is after loading it.

i also dont see register status, but i see eax and ebx etc, but i dont know what that e means

Mark Jones

Hi, also take a look at the \help\asmintro.hlp and masm32.hlp files.... those two should bring you up to speed very quickly, enjoy. :wink
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08