News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Intel's LINK86.EXE "WARNING 58: NO START ADDRESS SPECIFIED IN INPUT MODULES"

Started by bugthis, June 12, 2023, 08:42:44 PM

Previous topic - Next topic

bugthis

I am trying to create an executable and symbol file with Intel's ASM86 Assembler and Intel's LINK86.EXE linker.

This creates my program:

ASM86 program.asm SYMBOLS
LINK86 program.obj TO program.exe EXE

Without the latter EXE parameter, which unfortunately isn't mentioned anywhere in the manual "iAPX 86,88 FAMILY UTILITIES USER'S GUIDE FOR DOS SYSTEMS", the linker produces an invalid EXE file that crashes.
With the EXE parameter, the program works correctly.

But i run into two problems.

1.
I don't know how to get rid of this warning message:

WARNING 58:  NO START ADDRESS SPECIFIED IN INPUT MODULES

I tried to set a

ORG 0000h ; for EXE

statement in the *.ASM file. It compiles like it did without this statement, but the warning message still didn't go away.

I also tried to name the module MAIN:
NAME MAIN
in the *.ASM file.
And in the CODE segment, it tried to use a
MAIN:
label.
But nothing solved that. The warning message is still there. Now i am running out of options. I have no further ideas how to get rid of this message.

2. The SYMBOLS that are created by the ASM86 assembler are part of the PROGRAM.LST listing file. It's not an individual *.SYM file.
Is there a way to create an individual *.SYM file with this ASM86 assembler?

_japheth

Quote from: bugthis on June 12, 2023, 08:42:44 PM
I don't know how to get rid of this warning message:

WARNING 58:  NO START ADDRESS SPECIFIED IN INPUT MODULES


OMG, the Intel ASM86, hasn't this software celebrated its 40. birthday this year?

But IIRC, it has strong relations to Masm. So check the END directive, the optional argument for this directive is the start label, where program execution is to begin.
Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

bugthis

I tried this before:


CODE SEGMENT
ORG 0000h
START:
        .... ; ASM code
        END START
CODE ENDS

END


But ASM86 complains with an error.
The error message can be read in the listing and it says:

        END START
***_____^
***Error #1 IN 50, SYNTAX ERROR
----


So END START like in MASM doesn't work. Also the examples in the manual are all without an END for labels.

jj2007

Try this.

CODE SEGMENT
ORG 0000h
START:
        .... ; ASM code

END START

bugthis

Quote from: jj2007 on June 13, 2023, 12:38:47 AM
Try this.

CODE SEGMENT
ORG 0000h
START:
        .... ; ASM code

END START


Well Intel ASM86 is not MASM.
With this there are 2 errors now.

First the same as in my previous comment.
And second this one:

*** ERROR #89 IN 53, PREMATURE END OF FILE (NO END STATEMENT)


Intel ASM86 requires at least an end for every segment and a final end for the complete source file.


_japheth

Quote from: bugthis on June 13, 2023, 12:52:51 AM
Intel ASM86 requires at least an end for every segment and a final end for the complete source file.

I doubt that. Why don't you proceed systematically? If I were you, I would, as a first step, generate the most simplest program:


CODE SEGMENT
START:
CODE ENDS
END START


These are four lines, nothing else. Still receiving errors?
Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

jj2007

Quote from: bugthis on June 13, 2023, 12:52:51 AMWell Intel ASM86 is not MASM.
With this there are 2 errors now.

Sorry, I don't have Asm86, so I couldn't test it. Just a wild guess.

HSE

Code (t1.asm) Select
name t1
org 0100h
CGROUP group CODE
assume CS: CGROUP
CODE segment
START proc near

START endp
CODE ENDS
END START


:thumbsup:
Equations in Assembly: SmplMath

bugthis

Quote from: _japheth on June 13, 2023, 01:08:37 AM
Quote from: bugthis on June 13, 2023, 12:52:51 AM
Intel ASM86 requires at least an end for every segment and a final end for the complete source file.

I doubt that.
Well, omitting CODE END in Intel ASM86 is like omitting the curly brace in C.
Intel ASM86 requires its syntactical sugar.

Correct:

DATA segment
DATA ENDS
CODE segment
CODE ENDS


False:

DATA segment
CODE segment // The assembler still thinks, he's inside the DATA part.


Quote
Why don't you proceed systematically?
The program is already very simple. It only prints a "Hello world!"
The pure ASM mnemonic code is itself correct, what's missing seems to be some magic mambo jambo statement the ASM86 assembler requires. Or in other words, syntactic sugar.

Quote
If I were you, I would, as a first step, generate the most simplest program:
i can remove the "Hello world!" and Data segment and just print a letter and exit to DOS. I will try that, after i have answered your questions.

Quote

CODE SEGMENT
START:
CODE ENDS
END START


These are four lines, nothing else. Still receiving errors?
Yes.
Error messages are:

***ERROR #7 IN 2, NO CS-ASSUME IN EFFECT - NEAR LABEL CANNOT BE DEFINED
***ERROR #150 IN 4, UNDEFINED SYMBOL IN INITIALIZATION
***ERROR #145 IN 4, IDENTIFIER MUST BE LABEL FOR A CS-IP INITIALIZATION
***ERROR #151 IN 4, NO NAME DIRECTIVE ENCOUNTERED, DEFAULT MODULE NAME USED
ASSEMBLY COMPLETE, 4 ERRORS FOUND

bugthis

Quote from: HSE on June 13, 2023, 05:50:17 AM
Code (t1.asm) Select
name t1
org 0100h
CGROUP group CODE
assume CS: CGROUP
CODE segment
START proc near

START endp
CODE ENDS
END START


:thumbsup:

This compiles:

ASSEMBLY COMPLETE, NO ERRORS FOUND


But with this, START is not a LABEL, it's a procedure.
And org 100h means, that it is for a COM file, not an EXE.

Trying to link the Objectcode to a working EXE fails. The trying to run the EXE in FreeDOS it gives the error message:

Allocation of DOS memory failed.



TimoVJL

Example asm

https://archive.org/details/introductiontoas00inte/page/n31/mode/2up
May the source be with you

bugthis

Quote from: TimoVJL on June 13, 2023, 04:54:34 PM
Example asm

https://archive.org/details/introductiontoas00inte/page/n31/mode/2up

Thanks.

I found the reason for the error/warning.
You must define at least one label between your CODE segment and you must end it with an END directive outside of the CODE segment section.


NAME PROGRAM
ASSUME CS:CODE

CODE SEGMENT
  GECKO:
          .... ; ASM code
    MOV AH, 4Ch  ; Back to DOS
    INT 21h
CODE ENDS
END GECKO


The label (here GECKO) can have any name. You can call it MAIN, START, BEGIN, GECKO, BLABLA or something else.
But if you define it inside your CODE section, you must end it at the END outside of the code section.

You can have multiple labels inside your code section, but at least one of them must be after the END directive outside of the code section.
It doesn't matter which one:


NAME PROGRAM
ASSUME CS:CODE
CODE SEGMENT
  BLABLA:
          .... ; ASM code
  GECKO:
          .... ; ASM code
  START:
          .... ; ASM code
  MAIN:
          .... ; ASM code
  BEGIN:
           .... ; ASM code
    MOV AH, 4Ch
    INT 21h
CODE ENDS
END GECKO



So _japheth was close with this suggestion, but the NAME and ASSUME directive was missing:
https://masm32.com/board/index.php?topic=10802.msg119988#msg119988

Thanks to all for helping.

_japheth

Quote from: bugthis on June 13, 2023, 05:43:41 PM
I found the reason for the error/warning.
You must define at least one label between your CODE segment and you must end it with an END directive outside of the CODE segment section.

Congratulation!

I downloaded ASM86/LINK86 and played with them a bit. It's interesting - although ASM86 is supposed to emit object modules in OMF format, 16-bit linkers like MS Link or Borland's tlink are unable to find the start label. So you are restricted to LINK86.

A possible trap is that LINK86 doesn't warn if no stack is defined. That's usually not fatal, the program still runs, but it runs "by chance" only.

Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.