Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site hou2g.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxl!houxm!hou2g!stekas From: stekas@hou2g.UUCP Newsgroups: net.micro.pc Subject: Loading problem - More info Message-ID: <123@hou2g.UUCP> Date: Mon, 5-Dec-83 09:31:38 EST Article-I.D.: hou2g.123 Posted: Mon Dec 5 09:31:38 1983 Date-Received: Tue, 6-Dec-83 23:18:29 EST References: <171@whuxle.UUCP> Organization: Bell Labs, Holmdel NJ Lines: 29 The problem with with loading concerns segment location as in the following example: DATA SEGMENT . Data goes here . DATA ENDS DELTA EQU {Difference between DATA and CODE segments} CODE SEGMENT ENTRY PUSH BP MOV AX, CS ; Set up DATA reference using SUB AX, DELTA ; constant offset from CODE MOV DS, AX ; so DATA&CODE can go anywhere . RET FAR CODE ENDS As long as DATA and CODE are loaded contiguously, the above code will work anywhere in memory if entered at ENTRY. The problem is that there is no (easy) way to get the linker to load DATA before CODE. If one reverses the order of CODE and DATA in the assembler listing, then CODE has forward references and assembly bombs. The only way of getting DATA loaded first is to declare it as COMMON, assemble a copy of it seperately and link it seperately as in - LINK DATA.OBJ+CODE.OBJ It seems there should be an easier way to do this. - Jim