News:

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

who knows why masm32 doesn't generate obj file

Started by andrr, May 30, 2010, 05:36:25 AM

Previous topic - Next topic

sinsi

Light travels faster than sound, that's why some people seem bright until you hear them.

andrr

there is no error at all   it said that it assemled an input file and thats all

hutch--

hmmmm,

What version of ML.EXE ?
What command line ?
What code ?
Where did you call it from etc etc etc ....

With the old version of ML.EXE in MASM32 you use the command line,

ml /c /coff yourfile.asm
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

andrr

version masm 10
i use command line
code ml  /c  /coff does't work

hutch--

You are not telling us enough, millions of people over 12 years DO get it to work.

Post the code you are attempting to build so we don't have to guess what you are doing.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

andrr

my command line:

ml  /c  myfile.asm

no obj  is created

Vortex

Hi andrr,

The problem is that you need to send here your source code, the file with .asm extension.

andrr

my first program

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

    include \masm32\include\windows.inc     ; always first
.code
start:

mov eax ,3

end start

Vortex

Your source code is missing an exit statement, the ExitProcess API function :


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

include     \masm32\include\windows.inc     ; always first
include     \masm32\include\kernel32.inc

includelib  \masm32\lib\kernel32.lib

.code

start:

mov     eax , 3

invoke  ExitProcess,0

END start


To build the code :


\masm32\bin\ml /c /coff Test.asm
\masm32\bin\polink /SUBSYSTEM:WINDOWS Test.obj


andrr

how to understand this string:
masm32\bin\polink /SUBSYSTEM:WINDOWS Test.obj

is it always to write  /SUBSYSTEM:WINDOWS Test.obj?
why not to use link instead of polink?

TmX

Quote from: andrr on May 30, 2010, 10:03:16 AM
is it always to write  /SUBSYSTEM:WINDOWS Test.obj?

No. /SUBSYSTEM:WINDOWS is for GUI apps.
If you want console apps, use /SUBSYSTEM:WINDOWS

Quote from: andrr on May 30, 2010, 10:03:16 AM
why not to use link instead of polink?

Polink creates smaller executables

dedndave

i would have thought that was a console mode program
at any rate - he is missing some of the includes and includelibs needed
        .xlist
        .xcref
        include \masm32\include\masm32rt.inc
        .list

        .CODE

_main   proc

        mov     eax,3
        print   uhex$(eax),13,10
        inkey
        exit

_main   endp

        end     _main

then, to build in console mode...
\masm32\bin\ml /c /Fl /coff %1.asm
\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF %1.obj

Vortex

Hi andrr,

You can use MS link instead of Polink. Both of the tools are compatible.

andrr

how to write with pure assembler without invoke and print and inkey