ZBasic Language Reference
15
ZX Microcontroller Family
Option HeapReserve
Option HeapReserve <constant-expression>
Default: (see text)
After compilation, the compiler analyzes the use of RAM and compares it to the amount of RAM available
on the target device. If a specific task stack size is specified for the Main() task, the compiler adds the
amount of statically allocated data, the Main() task stack size and the minimum heap size and compares
this total to the amount of available RAM. If the aggregate total exceeds the available RAM an error
message will be issued.
This directive allows you to specify the minimum space you want to reserve for the heap. The default
heap reserve is 256 bytes for VM mode devices and 512 bytes for native mode devices.
Option HeapLimit
Option HeapLimit <constant-expression>
Default: n/a
This directive provides a different way of allocating RAM between the string heap and the task stacks.
The value provided is interpreted as a RAM address and specifies the limit beyond which the heap will
not grow. This directive is perhaps more useful with ZX devices that support external RAM. See the
section on setting heap and task stack sizes for more information.
Option MainTaskStackSize
Option MainTaskStackSize <constant-expression>
Default: n/a
This directive provides a different way of allocating RAM between the string heap and the task stacks.
The value provided is interpreted as the desired size of the task stack for the Main() task and the heap
limit is set at the end of the task stack. See the section on setting heap and task stack sizes for more
information.
Option TxQueueSize
Option RxQueueSize
Option TxQueueSize <constant-expression>
Default: 25
Option RxQueueSize <constant-expression>
Default: 50
These directives can be used to modify the sizes of the default transmission and reception queues for
Com1. They are effective only for native mode devices such as the ZX-24n.
Example
Option TxQueueSize 100
Option Com1Speed
Option Com1Speed <constant-expression>
Default: 19200
This directive can be used to modify the default speed of the Com1 serial channel. It is effective only for
native mode devices such as the ZX-24n.
Example
Option Com1Speed 9600