Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #6054

Re: cc65 / apple2 HGR2 linker configuration

From ol.sc@web.de (Oliver Schmidt)
Newsgroups comp.sys.apple2.programmer
Subject Re: cc65 / apple2 HGR2 linker configuration
Date 2023-07-29 15:22 +0000
Message-ID <ua3arl$f695$1@solani.org> (permalink)
References <20230728215344.0522a00e@laptop-sigfox>

Show all headers | View raw


Hi Colin,

>I'm hoping Oliver will see this message :)


Here I am...

>I've managed to make this linker config:
>https://github.com/colinleroy/a2tools/blob/master/config/apple2enh-hgr2.cfg

The config looks absolutely sane to me.

>It seems to work good and safe. I checked that the linker errors out if
>I put too much code and it crosses the $4000 boundary; I've also
>checked that malloc() does the right thing, not touching HGR
>page 2 (it starts allocating at $6000 + BSS size + stack size).

The heap starts at $6000 + BSS size. The stack starts at HIMEM and
grows downwards towards the heap.


>I'd love a second opinion though :)


I don't see a problem. However, I'm wondering why you don't go the
from my perspective simpler way to load your program at $4000 and use
$803 to $2000 as additional heap.

That alternative doesn't require an own custom linker config. Just use
the '--start-addr $4000' cmdline parameter and add the heap as
described in https://cc65.github.io/doc/apple2.html#ss5.2

The HGR sample programs coming with cc65 doit this very way:
https://github.com/cc65/cc65/blob/master/samples/Makefile#L108-L112

Regards,
Oliver

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

cc65 / apple2 HGR2 linker configuration Colin Leroy-Mira <colin@colino.net> - 2023-07-28 21:53 +0200
  Re: cc65 / apple2 HGR2 linker configuration ol.sc@web.de (Oliver Schmidt) - 2023-07-29 15:22 +0000
    Re: cc65 / apple2 HGR2 linker configuration Colin Leroy-Mira <colin@colino.net> - 2023-07-30 15:13 +0200
      Re: cc65 / apple2 HGR2 linker configuration Colin Leroy-Mira <colin@colino.net> - 2023-07-30 16:24 +0200
        Re: cc65 / apple2 HGR2 linker configuration Oliver Schmidt <ol.sc@web.de> - 2023-07-31 17:59 +0000

csiph-web