Re: Relocatable sources

From: silverdr_at_wfmh.org.pl
Date: Wed, 19 Nov 2014 16:01:25 +0100
Message-ID: <9ED6E4CA-F73E-4BF4-B117-A65C9B302730@wfmh.org.pl>
-- 
Sent from mobile phone (so please have understanding).

On 19 November 2014 14:34:52 CET, "Michał Pleban" <lists@michau.name> wrote:
>
>Hello!
>
>Sometime ago I tried to do this trick with ca65 and I did not find the
>required capabilities in the assembler.

It is all there. One of the strong (and most misunderstood) features of ca65 is that it  generates relocatable output by default, while leaving the absolute address assignments for the linker. 

There are several features supporting this and much more complex use cases. My guess is that as most people fresh to cc65 / ca65 you didn't read or understood the docs thoroughly and tried to use it the way most other assemblers work. 

>
>What I ended up doing was to split the compilation process into several
>stages, in the first one the relocatable source is compiled for the
>intended RAM location, a .bin file is produced and then it is included
>in the main source for the ROM. A kludgey way, but I wasn't able to do
>it any other way in ca65.

.org/.reloc is the first that comes to mind but for more complex projects a proper linker config with appropriate segments is usually a better way to go. My typical use case is drive code. It needs to be run inside the drive at given address but before it gets there it has to be transferred from the computer's memory of a different address. With correct setup I don't care at all where it gets linked to. It "just works"

       Message was sent through the cbm-hackers mailing list
Received on 2014-11-19 16:00:04

Archive generated by hypermail 2.2.0.