The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: RainMan23 on April 15, 2005, 02:51:34 PM

Title: Link Fatal Error 1123
Post by: RainMan23 on April 15, 2005, 02:51:34 PM
I'm recieving the following error when linking 16 bit assembly files with the 16 bit linker.  Any thoughts on what would cause this error?  Google isn't providing me with answers...

Fatal Error L1123:  _TEXT segment defined both 16- and 32-bit
Title: Re: Link Fatal Error 1123
Post by: MichaelW on April 16, 2005, 04:27:33 PM
From the MASM 6.0 Programmer's Guide, the solution is "Define the segment as either 16-bit or 32-bit". If you need a better answer then you should post your code.
Title: Re: Link Fatal Error 1123
Post by: tenkey on April 17, 2005, 04:53:32 AM
Are you assuming that all your code is 16-bit?

Most programmers won't define a _TEXT segment. That is usually generated by using .MODEL and .CODE
So look for a file that has this order of directives:

.386 ; or better processor type
.model small

If you find a file with that sequence, reverse the sequence. The default segment size is the based on the assumed processor when the .MODEL directive is encountered. Enable the 32-bit instructions after you've established the memory MODEL.
Title: Re: Link Fatal Error 1123
Post by: MichaelW on April 17, 2005, 06:01:12 AM
Good guess tenkey. I can trigger that particular link error by assembling and linking these two sources:

; With this order, default segment word size is 16 bits.
.model small
.386
.code
end


; With this order, default segment word size is 32 bits.
.386
.model small 
.code
end

Title: Re: Link Fatal Error 1123
Post by: RainMan23 on April 19, 2005, 01:17:24 PM
Thanks for the quick response!  I changed the order of those statements and it worked out great.  I experimented with the directions in  MASM 6.0 Programmer's Guide, but had no luck with that alternative method.

I have another program which will not assemble when i switch the ordering of the statements, however.  This is a program written for entering big real mode....Looks like I'll be following up on the thread concerning this topic :)

Thanks again!  It would have taken me days to figure that one out on my own!