11 of 172
ZBasic Language Reference 4 ZX Microcontroller Family D for more detailed information on the ZX-44/ZX-44a including several suggested connection diagrams. See Appendix E for more detailed information on the suggested ZX-1281 circuitry and Appendix Ffor the ZX-1280. The ZX-328n and ZX-328l are a 28-pin DIP format integrated circuit that is programmed with the ZX native mode control program. In order to use the ZX-328n or ZX-328l you must add a few external components such as a regulated supply, a crystal and serial interface circuitry. See Appendix G for more detailed information on the ZX-328n and ZX-328l including several suggested connection diagrams. The ZX-32n and ZX-32l are a 32-pin TQFP format integrated circuit that is programmed with the ZX native mode control program. In order to use the ZX-32n or ZX-32l you must add a few external components such as a regulated supply, a crystal and serial interface circuitry. See Appendix H for more detailed information on the ZX-32n and ZX-32l including several suggested connection diagrams. It should be noted that ZBasic is a superset of NetMedia’s BasicX language, incorporating many improvements and advanced features. Many, perhaps even most, BasicX programs can be recompiled using the ZBasic compiler and the resulting code should run exactly as it would on the BX-24 microcontroller except for differences due to the fact that the ZX is twice as fast as the BX-24. See Chapter 5 for more information on compatibility issues. The n-suffix ZX devices run in “native mode” meaning that the ZBasic application is compiled to native object code for the processor. In contrast, the other ZX devices contain a “virtual machine” (commonly referred to as a VM) and ZBasic applications are compiled to instruction codes that are executed by the VM. The primary advantage of the native mode devices is that the application executes faster but the disadvantage is that the resulting program is larger than the corresponding VM mode program. Some ZX devices mentioned in this manual have an "e" suffix, e.g. ZX-24e, ZX-24ne. These “extended” devices are produced by Oak Micros under license from Elba Corp. and are available in both VM and native mode versions. 1.3 Conventions In this manual, specific examples of things that can appear in your ZBasic program are shown in Courier typeface as are descriptions of the syntax of program elements. Otherwise, discussion and general references to program elements will be shown in Arial typeface. When describing the syntax of a ZBasic language element, sometimes portions of it are optional. This fact is indicated by enclosing the optional portion with left and right square brackets. Literal elements, those that must appear as typed (but without regard to alphabetic case, of course) appear as themselves. Often, it is useful to describe an element generally rather than giving a specific instance. When this is done, the description will be italicized and enclosed with left and right angle brackets and subsequent text will describe the characteristics of the generalized item. Here is an example that uses these conventions: [Private] Const <name> As <type> = <value> The idea being conveyed is that this program element may begin with the Private keyword or it may be omitted, i.e. it is optional. The keywords Const and As are specified literally as is the equal sign. The name of the constant to be defined, its type and value are all specified using a descriptive word or phrase enclosed in angle brackets. These placeholder components will be explicitly described in the discussion of the program element. In some instances, there may be more than one optional element that may appear in a given position. In these cases, the vertical bar character is used to indicate that any one element may be used, but not more than one, of course. [Public | Private] Const <name> As <type> = <value>