The MASM Forum Archive 2004 to 2012
Welcome, Guest. Please login or register.
February 28, 2020, 11:39:00 PM

Login with username, password and session length
Search:     Advanced search
128553 Posts in 15254 Topics by 684 Members
Latest Member: mottt
* Home Help Search Login Register
+  The MASM Forum Archive 2004 to 2012
|-+  Miscellaneous Forums
| |-+  16 bit DOS Programming
| | |-+  Link Fatal Error 1123
« previous next »
Pages: [1] Print
Author Topic: Link Fatal Error 1123  (Read 11785 times)
RainMan23
Guest


Email
Link Fatal Error 1123
« 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
Logged
MichaelW
Global Moderator
Member
*****
Gender: Male
Posts: 5161


Re: Link Fatal Error 1123
« Reply #1 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.
Logged

eschew obfuscation
tenkey
Member
*****
Posts: 336



Re: Link Fatal Error 1123
« Reply #2 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.
Logged

A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8
MichaelW
Global Moderator
Member
*****
Gender: Male
Posts: 5161


Re: Link Fatal Error 1123
« Reply #3 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:
Code:
; With this order, default segment word size is 16 bits.
.model small
.386
.code
end
Code:
; With this order, default segment word size is 32 bits.
.386
.model small 
.code
end
Logged

eschew obfuscation
RainMan23
Guest


Email
Re: Link Fatal Error 1123
« Reply #4 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!
« Last Edit: April 19, 2005, 03:54:43 PM by RainMan23 » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!