Positron Compiler Documentation

Variable Declares.

Positron8 · Revision 4.0.6.5 · PDF page 422

In order to make the finer management of variables more automatic, the compiler has a few declares. These are:

Declare Auto_Heap_Arrays = On or Off The Auto_Heap_Arrays declare will automatically place all Array variables created in a program, in Higher RAM.

Arrays are usually accessed via indirect operation, and as such, do not have bank changing requirements in the assembler code, so when arrays are placed among standard variables, they can actually create bloat, so that standard variables require more RAM bank changing mnemonics used when they are are accessed. So when this Declare is set to On, it keeps the RAM used by them, out of the way of standard variables, so that that less RAM bank switching mnemonics need to be used in the assembler code created by the compiler, thus saving flash memory space, and speeding up a program’s operation. Its default is Off for backward compatibility.

Declare Auto_Heap_Strings = On or Off The Auto_Heap_Strings declare will automatically place all String variables created in a program, in Higher RAM.

String variables are accessed via indirect operation, and as such, do not have bank changing requirements in the assembler code, so when String variables are placed among standard variables, they can actually create bloat, so that standard variables require more RAM bank changing mnemonics used when they are are accessed. So when this Declare is set to On, it keeps the RAM used by them, out of the way of standard variables, so that that less RAM bank switching mnemonics need to be used in the assembler code created by the compiler, thus saving flash memory space, and speeding up a program’s operation. Its default is Off for backward compatibility.

Declare Auto_Variable_Bank_Cross = On or Off The compiler handles multi-byte variables such as Word, Long, Dword and Float crossing over a RAM bank boundary, which is where some bytes of a variable are in a differing RAM bank. However, this does cause the code produced to be a little larger because it has to bank

change more in the assembly code. This can be modified by using the

Auto_Variable_Bank_Cross declare and setting it to On. This will move any variables that are crossing RAM banks up to the beginning of the next RAM bank, however, this will increase RAM usage a little, but may produce smaller code and faster code, so it is a useful Declare to try. Its default is Off for backward compatibility.

View original PDF page 422Open page in PDFOriginal PDF page 422