21 of 208
ZBasic Language Reference 13 ZX Microcontroller Family Option PortPinEncoding Option PortPinEncoding [On | Off] Default: see text When the compiler encounters an I/O port pin designator like C.2 it can convert it to the corresponding physical pin number for the target device or it can convert it to a composite value whose fields specify the port and the pin. This directive controls which of these conversions is performed. When the option is off, the result is a pin number and when it is on the result is the encoded port/pin value. The encoded result is a Byte value that has the binary form 1PPPPnnn where PPPP represents a port index (PortA=0, PortB=1, etc.) and nnn represents the bit number (0-7). The option is on by default for ZX devices based on the mega328P, mega128, mega1280, mega1281, xmega32A4 and xmega128A1 and off by default for other devices. Example Option PortPinEncoding On Option CodeLimit Option CodeLimit <limit-value> Default: none This option can be used to have the compiler check the size of the generated code and issue an error message if it exceeds a specified size. The limit value is specified by a decimal number, optionally using the suffix K or k to denote a multiple of 1024. Examples Option CodeLimit 32K Option CodeLimit 32768 Option SignOn Option SignOn {On | Off} Default: On This option can be used to control the generation of a sign-on message when the ZX begins running after a reset. The flag to control the sign-on is stored in Persistent Memory of the processor. This is important to remember because if you download one program to the ZX that, say, turns it off and then you download another program that has no Option SignOn directive at all, the sign-on will still be in the off state. In other words, if you want to ensure that it is in particular state for your particular program, be sure to include this directive. Of course, if you’ve never turned it off, it will still be in the On state. Example Option SignOn Off Option TaskStackMargin 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