extra question in porting guide for high ram

This commit is contained in:
Irmen de Jong 2023-02-22 22:48:45 +01:00
parent ba9268a09e
commit 4641ac46e7
3 changed files with 13 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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.