Navigation bar
  Start Previous page
 17 of 156 
Next page End 12 13 14 15 16 17 18 19 20 21 22  

11
Option TaskStackMargin <margin-value>
Default: 10
When the compiler compares the size of the stack allocated to a task to the estimated task stack usage it
pads the estimate with a safety margin.  This option can be used to specify a value for that safety margin
different from the default of 10 bytes.  The safety margin may be any non-negative decimal integral value.
Example
Option TaskStackMargin 20
Option ExtRamConfig [On | Off | <constant-expression>]
Default: (see text)
For ZX devices that support external RAM, you may control whether external RAM is enabled using this
directive.  Using the keyword On enables external RAM support in the default configuration (16-bit
address, no wait states).  If you need a different configuration, you may specify a constant expression
whose 16-bit value is written to the external RAM configuration registers of the CPU.  The high byte is
written to the register XMCRB register and the low byte is written to XMCRA register.  Note that for the
mega128 CPU, the high bit of the XMCRA register is undefined but the configuration value must have
that bit asserted in order for the external RAM interface to be enabled.
The default external RAM configuration value is &H0000 for the ZX-1281 and ZX-1280 while it is &H0080
for the ZX-128e and ZX-1281e.
Examples
Option ExtRamConfig On
Option ExtRamConfig &H0084  ' enable with 1 wait state
Option RamSize <constant-expression>
Default: (see text)
The compiler compares the aggregate size of the statically allocated data items to the amount of RAM
available in the target device.  If the aggregate size is too large, the compiler issues a warning to that
effect.  For ZX models that support external RAM (e.g. ZX-1281), the compiler must know the resultant
size of User RAM in order to avoid generating meaningless warnings.  That is the purpose of this
directive, which may only be used on ZX models that support external RAM.  The example below shows
the simplest way of specifying the augmented User RAM size.  The example is for the case where the
maximum amount of additional RAM was added.
Example
Option RamSize 65536 – Register.RamStart
 
Option HeapSize <constant-expression>
Default: (see text)
The function of this directive differs depending on whether the target device operates in VM mode (e.g.
ZX-24) or native mode (e.g. ZX-24n).  For VM mode devices, when the compiler performs various checks
regarding the use of RAM, it takes into account an amount of RAM reserved for the heap (from which
memory for strings, for example, is allocated).  This directive provides a means to specify a different
amount to reserve for the heap.  Note that the reservation is conceptual only – it does not affect how the
program operates in any way.  It only affects whether or not the compiler will issue a warning about the
use of RAM in a particular circumstance.
For native mode devices, this directive affects the allocation of RAM between the string heap and task
stacks.  The effect is to set a hard limit beyond which the heap will not grow, thereby preventing the heap
from encroaching on a task stack.
If a size less than the minimum size (64 bytes) is specified, the minimum is used instead.  Also, for
devices with external RAM, the special value of 65535 (&Hffff) can be used to specify that all external
Previous page Top Next page