Table of Contents
- Chapter 1 - Introduction
- 1.1 The ZBasic System Library
- 1.2 The ZX Microcontroller Family
- 1.3 Support for Generic Microcontrollers
- 1.4 Conventions
- Chapter 2 - ZBasic Language Elements
- 2.1 Identifiers
- 2.2 Data Types
- 2.3 Modules
- 2.3.1 The Options Section
- Option <pin>
- Option <port>
- Option Base
- Option Explicit
- Option Language
- Option AllocStr
- Option StringSize
- Option Strict
- Option TargetCPU
- Option TargetDevice
- Option DeviceParameter
- Option PortPinEncoding
- Option CodeLimit
- Option SignOn
- Option DefaultISR
- Option CallFunctions
- Option TaskStackMargin
- Option ExtRamConfig
- Option RamSize
- Option HeapSize
- Option HeapReserve
- Option HeapLimit
- Option MainTaskStackSize
- Option TxQueueSize
- Option RxQueueSize
- Option ConsoleSpeed
- Option Com1Speed
- Option Console
- Option ComChannels
- Option RTC
- Option AtnChar
- Option Include
- Option Objects
- Option Overload
- Option Namespaces
- Option NameStyle
- Option CodeType
- Option Arduino
- Option Notice
- Option SerialReadStrobe
- Option X10Interrupt
- Option OCModulateEnable
- Option Library
- 2.3.2 The Definitions Section
- Defining Constants
- Defining Variables
- Defining Arrays of Variables
- Defining Subroutines
- Defining Functions
- 2.4 Expressions
- 2.4.1 Operator Precedence
- 2.4.2 Operator Associativity
- 2.4.3 Arithmetic Operators
- 2.4.4 Logical Operators
- 2.4.5 Comparison Operators
- 2.4.6 Miscellaneous Operators
- 2.4.7 No "Short Circuit" Evaluation
- 2.5 Statements
- 2.5.1 Assignment Statement
- 2.5.2 Call Statement
- 2.5.3 CallTask Statement
- 2.5.4 Console.Write and Console.WriteLine Statements
- 2.5.5 Debug.Print Statement
- 2.5.6 Do-Loop Statement and Variants
- 2.5.7 Exit Statement
- 2.5.8 For-Next Statement
- 2.5.9 Goto Statement
- 2.5.10 If-Then-Else Statement
- 2.5.11 Single-line If-Then Statement
- 2.5.12 Select-Case Statement
- 2.5.13 Set Statement
- 2.5.14 While-Wend Statement
- 2.5.15 With Statement
- 2.6 Literals
- 2.6.1 Boolean Literals
- 2.6.2 Numeric Literals - Integral Values
- 2.6.3 Numeric Literals - Real Values
- 2.6.4 String Literals
- 2.6.5 Built-in Binary Constants
- 2.7 Comments
- 2.8 Line Continuation and Multiple Statements Per Line
- 2.9 Persistent Variables
- 2.10 Program Memory Data Items
- 2.11 String Types
- 2.11.1 Bounded Strings
- 2.11.2 Fixed-Length Strings
- 2.12 Variable Initialization
- 2.13 Type Conversions
- 2.14 Parameter Passing Conventions
- 2.15 Program and Data Item Properties
- 2.16 Default Visibility
- Chapter 3 - Advanced Topics
- 3.1 Scope and Lifetime
- 3.2 Enumerations
- 3.3 Serial Channels
- 3.4 Queues
- 3.4.1 System Queues
- 3.5 Multitasking
- 3.5.1 Advanced Multi-tasking Options
- 3.6 Semaphores
- 3.7 Built-in Variables
- 3.7.1 Special Function Registers
- 3.7.2 System Variables and Constants
- 3.8 Built-in Constants
- 3.9 Conditional Compilation Directives
- 3.10 Error Directive
- 3.11 Notice Directive
- 3.12 Include Directive
- 3.13 Include_path Directive
- 3.14 Using Conditional Directives in Project and Argument Files
- 3.15 Preprocessor Symbols
- 3.16 Array Data Order
- 3.17 Recursion in Subroutines and Functions
- 3.18 Using Default Parameter Values in Subroutines and Functions
- 3.19 Subroutine and Function Overloads
- 3.20 Aliases
- 3.21 Based Variables
- 3.22 Based Procedures
- 3.23 Reference Variables
- 3.24 Sub-byte Types
- 3.24.1 Forcing Byte Alignment
- 3.25 Structures
- 3.25.1 Structures in Persistent Memory and Program Memory
- 3.26 Unions
- 3.27 Using Namespaces
- 3.28 Data Type Implementation Information
- 3.28.1 User-defined Type Details
- 3.28.2 String Data Type Details
- 3.28.3 String Address and String Type
- 3.29 Controlling the Heap Size and Main() Task Stack Size
- 3.30 Task Management
- 3.30.1 Task Control Block
- 3.31 Dynamic Memory Allocation
- 3.32 Exception Handling
- 3.33 Run Time Stack Checking
- Chapter 4 - ZBasic Object-Oriented Extensions
- 4.1 Enabling Object-Oriented Extensions
- 4.2 Defining a Class
- 4.3 Defining Class Methods
- 4.4 Object Creation Issues
- 4.5 Object Destruction Issues
- 4.6 Object Assignment Issues
- 4.7 Object Self-reference and Parent Reference
- 4.8 Explicit Class References and Default Namespace References
- 4.9 Class Sections
- 4.10 Static Class Members
- 4.11 Inheritance
- 4.12 Abstract Classes, Abstract Methods
- 4.13 Final Classes
- 4.14 Using Mixins
- 4.15 Using the Const Attribute for Methods
- 4.16 Based Objects, Reference Objects
- 4.17 Miscellaneous Class Elements
- Chapter 5 - Compiling for Generic Target Devices
- 5.1 Overview
- 5.2 Loading Application Code onto the Target Device
- 5.3 Target Device Parameters
- ClockFrequency
- ClockPrescaler
- Package
- RTCFrequency
- RTCScale
- RTCError
- TimerSpeed1Divisor, TimerSpeed2Divisor
- TimerOCPin
- HWUartSpeed
- SWUartDivisor, SWUartMinSpeed, SWUartMaxSpeed, SWUartBaseSpeed
- ZBasicBootloader
- BootloaderAddress
- BootloaderSize
- WriteWordAddress, WritePageAddress
- clkCtrl, psCtrl, oscCtrl, xoscCtrl, pllCtrl
- 5.4 ZBasic Bootloader
- Chapter 6 - Special Considerations for Native Mode Devices
- 6.1 Using Inline C and Assembly Code
- 6.2 Defining and Using External Subroutines, Functions and Variables
- 6.3 Defining Interrupt Service Routines
- 6.4 Executing Blocks of Code Atomically
- 6.5 Attributes for Procedures and Variables
- 6.6 Considerations for Task Stack Size
- 6.7 Creating and Using Object Libraries
- 6.8 Importing Identifiers from External Modules
- Chapter 7 - Compatibility Issues
- 7.1 Known Differences and Compatibility Between ZBasic and BasicX
- 7.2 Known Differences and Compatibility Between ZBasic and Visual Basic
- Chapter 8 - The ZBasic IDE
- 8.1 Using the Editor
- 8.1.1 Basic Editing
- 8.1.2 Special Code Editing Features
- 8.1.3 Expand/Collapse
- 8.1.4 Auto-Completion
- 8.1.5 Call Tips
- 8.2 Project Configuration, Compiling and Downloading
- 8.3 Compiling and Downloading Individual Files
- 8.4 Setting Serial Port Options
- 8.5 Setting Device Options
- 8.6 Setting Target Options
- 8.7 Setting the Downloader Command
- 8.8 Downloading Without Using DTR Signaling
- 8.9 Updating Device Firmware
- 8.10 Setting the Debug Output Limit
- 8.11 Other Configurable Items
- Chapter 9 - Compiler Guide
- 9.1 Compiler Invocation
- 9.2 Compiler Options in Detail
- 9.3 Error and Warning Messages
- 9.3.1 Controlling Warnings
- 9.3.2 Internal Errors
- Chapter 10 - Downloader Utility
- 10.1 Firmware Updates
- 10.1.1 Emergency Update Procedure
- 10.2 Device Configuration
- 10.3 Downloader API
- Appendix A - Reserved Words
- Appendix B - Supported Target Devices
- Appendix C - Pre-Defined Structures
- Appendix D - ZX-24 Series Hardware Reference
- D.1 External Connections
- D.2 Pin Configuration
- D.2.1 Standard Pins
- Detailed Pin Descriptions
- D.2.2 Expansion Pins
- Detailed Pin Descriptions
- Appendix E - ZX-40 Series Hardware Reference
- E.1 ZX-40 Series Specifications
- E.2 ZX-40 Series Required External Components
- Appendix F - ZX-44 Series Hardware Reference
- F.1 ZX-44 Series Specifications
- F.2 ZX-44 Series Required External Components
- Appendix G - ZX-1281 Series Hardware Reference
- G.1 ZX-1281 Series Specifications
- G.2 ZX-1281 Series Required External Components
- Appendix H - ZX-1280 Series Hardware Reference
- H.1 ZX-1280 Series Specifications
- H.2 ZX-1280 Series Required External Components
- Appendix I - ZX-328n and ZX-328l Hardware Reference
- I.1 ZX-328 Series Specifications
- I.2 ZX-328 Series Required External Components
- Appendix J - ZX-32n and ZX-32l Hardware Reference
- J.1 ZX-32 Series Specifications
- J.2 ZX-32 Series Required External Components
- Appendix K - ZX-32a4 and ZX-128a4u Hardware Reference
- K.1 ZX-32a4 and ZX-128a4u Specifications
- K.2 ZX-32a4 and ZX-128a4u Required External Components
- Appendix L - ZX-128a1 Hardware Reference
- L.1 ZX-128a1 Specifications
- L.2 ZX-128a1 Required External Components
- Appendix M - External Components for Generic Target Devices
- Appendix N - Processor Resource Description Files