130 of 172
ZBasic Language Reference 123 ZX Microcontroller Family Chapter 8 - Downloader Utility Included as part of the ZBasic package is a standalone command line utility that can download code to the ZX. Like the compiler, it is a console application meaning that it has no graphical user interface. The invocation syntax for the downloader is: zload [<options>] <code-file> where <code-file> is a file containing object code created by the compiler, usually having a .zxb extension. The code file is in an industry standard format and contains checksums to help detect communication problems. After the code file is downloaded, the ZX is reset so that it begins running the user program. The available options for the downloader are described in the table below. All options are case sensitive. zload Options Option Description -h Display an invocation syntax summary and then exit. -c<port> Specify the serial port to use instead of the default port. <port> must be a decimal value between 1 and 99. -v After downloading, perform a verification pass. -m After downloading, remain connected and display any received characters on the console. -s[<term-char>] Terminate the monitor mode (-m) if a character with the value specified by <term-char> is received. The value may be specified in decimal or, with a prefix of 0x, in hexadecimal. If not specified, the termination character is EOT (04). -a Enter ATN test mode. Used to verify correct connection to the ZX. -u Download a specially formatted file to update the control program of the ZX. See Section 8.1 for more details. -U Same as –u except that no visual feedback is provided (using the LEDs on the 24-pin ZX devices) during the update. -e Use a special “emergency update” method. See Section 8.1 for more details. -z<id>:<value> This option is used to send configuration information to the device. Some example invocations of zload are: Download the file test.zxb using COM2. zload –c2 test.zxb Download the file test.zxb using COM2 with verification. zload –c2 –v test.zxb Download the file test.zxb using the default COM port, go to monitor mode until character code 8 is received. zload –s0x08 –m test.zxb Perform ATN testing using COM2. zload –c2 –a The default serial port may be specified by setting an environment variable named ZLOAD_PORT. The value of this environment variable should be a series of decimal digits specifying the serial port number (1-99). The method used to set an environment variable varies depending on the operating system. Consult your OS documentation for more information.