Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!cbmvax!higgin From: higgin@cbmvax.cbm.UUCP (Paul Higginbottom) Newsgroups: net.micro.amiga Subject: Re: Manx assembler/linker problem? Message-ID: <689@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 1-Sep-86 18:31:41 EDT Article-I.D.: cbmvax.689 Posted: Mon Sep 1 18:31:41 1986 Date-Received: Tue, 2-Sep-86 04:06:09 EDT References: <436@vger.UUCP> Reply-To: higgin@cbmvax.UUCP (Paul Higginbottom) Organization: Commodore Technology, West Chester, PA Lines: 46 Keywords: Manx In article <436@vger.UUCP> waterfal@vger.UUCP (Douglas Waterfall) writes: >Help! > > I am porting a large (100k) program written in another dialect of 68k >assembly language using the assembler from the Manx C package. The Manx >assembler and/or the linker seems to have problems whith PC relative >addressing. The following code fragment shows the problem. The assembler >will assemble the code without any errors but the linker reports the following >message: > > file filename: Branch out of range @pc=xx (xx varies) > > What is strange about the error is that it depends on the amount of >code preceding the instruction. If the constant block is 96 hex or less the >linker does not report an error. If the size is 97 hex or greater the linker >reports the error. Using the constant block makes demonstrating the error >simpler, placing code there has the same effect. Even stranger the error >occurs regardless of the opcode used (and, jmp, move). > Since the code works correctly with other machines using different >assemblers (4.2BSD) the problem seems to be with the Manx package. Is there >something wrong or am I missing something obvious? > >assemble with > as -c -d filename > >link with > ln filename > >######cut###### > cseg >; $96 & down works >; $97 & up does not work > dcb.b $97 > and.l $20(PC,D1) ; pc@($20,D1) > >######cut###### I expect the problem is something to do with the optimization of the assembler turning something into a short offset. You can turn off the optimization with the -n option. Try this. Alternatively, try putting the data in a dseg, or bss. Hope this helps, Paul Higginbottom Disclaimer: The above reflects only my own opinions.