News:

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

ORG for .EXE program

Started by MASM, January 05, 2012, 04:52:51 AM

Previous topic - Next topic

MASM

MASM complains my .EXE programs have no starting address..

if I write a .COM program I do an offset of ORG 100h.

what is the correct ORG for a .MODEL SMALL .EXE program ? (one code segment one data segment)

dedndave

no org at all   :U

the error is because, for EXE's, there should be an entry point in the END statement at the end of the file
start:  mov     ax,4C00h
        int     21h

        END     start     ;entry is start

or
_main   PROC

        mov     ax,4C00h
        int     21h

_main   ENDP

        END     _main     ;entry is _main


notice that the entry point does not need to be the first code in the code segment, nor at any specific address

this does not apply to modules like those for a library
they require an END, but no entry point