From 9cd1ffa6a6131455e419f5436f1396e140cff005 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Thu, 11 Feb 2021 19:20:11 +0100 Subject: [PATCH] doc/ld65.sgml: document the INIT segment - re-arrange the segments in the "Special segments" section alphabetically - some small changes in section 5.8 (FILE) regarding Atari XEX format --- doc/ld65.sgml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/ld65.sgml b/doc/ld65.sgml index cba06fef4..c2e990dc2 100644 --- a/doc/ld65.sgml +++ b/doc/ld65.sgml @@ -921,9 +921,8 @@ name="6502 binary relocation format specification">). It is defined like this: } -The other format available is the Atari (xex) segmented file format, this is -the standard format used by Atari DOS 2.0 and upward file managers in the Atari -8-bit computers, and it is defined like this: +The other format available is the Atari segmented file format (xex), this is +the standard format used by Atari DOS 2.0 and upwards, and it is defined like this: FILES { @@ -1140,6 +1139,19 @@ The builtin config files do contain segments that have a special meaning for the compiler and the libraries that come with it. If you replace the builtin config files, you will need the following information. +INIT

+ +The INIT segment is some kind of 'bss' segment since it contains +uninitialized data. Unlike .bss itself, its contents aren't +initialized to zero at program startup . It's mostly used by +constructors in the startup code. An example for the use of the INIT +segment is saving/restoring the zero page area used by cc65. + +LOWCODE

+ +For the LOWCODE segment, it is guaranteed that it won't be banked out, so it +is reachable at any time by interrupt handlers or similar. + ONCE

The ONCE segment is used for initialization code run only once before @@ -1147,11 +1159,6 @@ execution reaches main() - provided that the program runs in RAM. You may for example add the ONCE segment to the heap in really memory constrained systems. -LOWCODE

- -For the LOWCODE segment, it is guaranteed that it won't be banked out, so it -is reachable at any time by interrupt handlers or similar. - STARTUP

This segment contains the startup code which initializes the C software stack