diff --git a/docs/source/building.rst b/docs/source/building.rst index 4f210889c..14beafff8 100644 --- a/docs/source/building.rst +++ b/docs/source/building.rst @@ -176,11 +176,11 @@ One or more .p8 module files is changed accordingly (to keep them in the same memory space as the evaluation stack). ``-varshigh`` - Places the uninitialized (and zero-initialized) variables in a separate high memory area, instead of - inside the program itself. This results in an increase of the amount of system ram available for the program - itself. The amount of ram saved depends on the amount and types of variables in the program, but can be - several hundreds of bytes or more. - The new memory location of the variables depends on the compilation target machine + Places the non-zeropage variables in a separate high memory area, instead of inside the program itself. + This results in an increase of the amount of system ram available for the program + itself. The amount of ram saved depends on the amount and types of variables in the program, + but can be several hundreds of bytes or more. + The new memory location of the variables depends on the compilation target machine: c64: $C000 - $CEFF diff --git a/docs/source/portingguide.rst b/docs/source/portingguide.rst index a5cc83aa1..3d4a4754c 100644 --- a/docs/source/portingguide.rst +++ b/docs/source/portingguide.rst @@ -33,9 +33,10 @@ RAM, ROM, I/O #. what part(s) of the address space is RAM? What parts of the RAM can be used by user programs? #. what is the usual starting memory address of programs? -#. what is the best place to put 2 pages (512 bytes total) of scratch area data in RAM? +#. what is the best place to put a page (256 bytes total) of scratch area data in RAM? #. what part(s) of the address space is ROM? #. what part(s) of the address space is memory mapped I/O registers? +#. is there a block of "high ram" available (ram that is not the main ram used to load programs in) that could be used for variables? #. is there a banking system? How does it work (how do you select Ram/Rom banks)? How is the default bank configuration set? Character encodings diff --git a/docs/source/technical.rst b/docs/source/technical.rst index f94a9c0eb..c5cadb27c 100644 --- a/docs/source/technical.rst +++ b/docs/source/technical.rst @@ -12,10 +12,12 @@ but care should be taken of course to avoid unexpected side effects. Especially when you're dealing with interrupts or re-entrant routines: don't modify variables that you not own or else you will break stuff. -Uninitialized and zero-initialized variables that are not put into zeropage, will be put into -a special 'BSS' section for the assembler. This section is usually placed at the end of the resulting program -but because it only contains empty space it won't actually increase the size of the resulting program binary. -Prog8 takes care of properly filling this memory area with zeros at program startup. +Variables that are not put into zeropage, will be put into a special 'BSS' section for the assembler. +This section is usually placed at the end of the resulting program but because it only contains empty space +it won't actually increase the size of the resulting program binary. +Prog8 takes care of properly filling this memory area with zeros at program startup and then reinitializes +the subset of variables that have a nonzero initialization value. + It is possible to relocate the BSS section using a compiler option so that more system ram is available for the program code itself.