NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: saddlefoot on May 07, 2010, 04:10:44 PM

Title: Link MODEND error
Post by: saddlefoot on May 07, 2010, 04:10:44 PM
I am trying to link a program compiled with  the "-f obj".

The compile has no warnings or errors.  I start the first line of the code with "..start".
I've got a segment code, followed by a segment data, and a segment stack stack.

When I try to link with the Val linker. I get a "MODEND record missing" error message.

How do I create this record in my source?
Title: Re: Link MODEND error
Post by: Frank Kotler on May 07, 2010, 05:59:44 PM
Dunno. I've never seen that error message, Saddlefoot! I've only used "val" a few times (and not recently!). It may be that Nasm is failing to meet val's expectations in some way, but I "thought" it worked okay...

Have you (or can you) tried other linkers? David Lindauer's got an "updated val" called "valx"... And Anthony William's "alink" usually works with Nasm's "-f obj" output. Give a yell if you have trouble finding them.

If you want to use "val", and (or) continue to have trouble, get back to us. May need to know what Nasm version and/or Val version... though that's stuff's so "stone age" it shouldn't make much difference (still supposed to work!). Maybe a code example to demonstrate the problem. I'll boot up dos to try and help you track it down if I have to, but... not right now.


Title: Re: Link MODEND error
Post by: saddlefoot on May 11, 2010, 05:27:48 AM
OK I think I figured it out.  When I broke up the program, which is pretty big, into more segments the error went away.

However now one of my segments comes up with the error "Location not within frame".  Any ideas on that?

By the way, I switched from Alink to val because Alink was really screwing up the EXE.  It looked like the code was
overwriting itself. Example:  mov   ah, 40   int 21    would come out     mov ah,40     les[si+10].   When I dumped
the obj, the code looked correct, so it had to be the linker.    It maybe related to the
"to much code - not enough segments" problem above.  I haven't had time to retry since the more segments fix.