News:

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

Link Fatal Error 1123

Started by RainMan23, April 15, 2005, 02:51:34 PM

Previous topic - Next topic

RainMan23

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

MichaelW

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.
eschew obfuscation

tenkey

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.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

MichaelW

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

eschew obfuscation

RainMan23

#4
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!