R.T.Russell Home Page

BBC BASIC (Z80)

Table of Contents




  1. Introduction
    1. Before You Start
      1. System Requirements
      2. Configuration
    2. Running BBC BASIC (Z80)

  2. General Information
    1. Introduction
      1. Line numbers
      2. Statement Separators
    2. Expression Priority
      1. Order of Evaluation
      2. Examples
    3. Variables
      1. Specification
      2. Numeric Variables
        1. Real Variables
        2. Integer Variables
        3. Byte variables
        4. Static Variables
        5. Boolean Variables
        6. Numeric Accuracy
      3. String Variables
    4. Arrays
      1. Array arithmetic
      2. Initialising arrays
    5. Program flow control
      1. Introduction
      2. Program structure limitations
      3. Leaving program loops
        1. REPEAT ... UNTIL loops
        2. Changing the loop variable
        3. Using the EXIT statement
        4. Moving the loop into a procedure
      4. Local arrays
    6. Indirection
      1. Introduction
      2. The ? operator
        1. Byte Access
        2. Query as a Byte Variable
      3. The ! operator
      4. The | operator
      5. The $ operator
      6. Use as binary (dyadic) operators
      7. Power of Indirection Operators
      8. The ^ operator
    7. Operators and Special Symbols
    8. Keywords
    9. Debugging
    10. Error handling
      1. Default error handling
      2. Reasons for trapping errors
        1. To make your program more 'friendly'
        2. To ensure the error message is visible
        3. To allow cleanup operations to take place
        4. To allow execution to continue
      3. Error trapping commands
        1. ON ERROR or ON ERROR LOCAL?
      4. Error reporting
      5. Error trapping examples
    11. Procedures and functions
      1. Introduction
      2. Names
      3. Function and procedure definitions
        1. Starting a definition
        2. The function/procedure body
        3. Ending a definition
        4. Single line functions/procedures
      4. Extending the language
      5. Passing parameters
        1. Formal and actual parameters
      6. Local variables
        1. Recursive functions/procedures
      7. Passing arrays to functions and procedures
      8. Using parameters for output
      9. Returning arrays from procedures and functions

  3. Assembler
    1. Introduction
      1. Instruction mnemonics
      2. Statements
      3. Labels
      4. Comments
      5. Constants
        1. Define Byte - DEFB
        2. Define Word - DEFW
        3. Define Message - DEFM
    2. Reserving Memory
      1. The Program Counter
      2. Using DIM to Reserve Memory
      3. Moving HIMEM to Reserve Memory
      4. Length of Reserved Memory
      5. Initial Setting of the Program Counter
    3. The Assembly Process
      1. OPT
      2. Assembly at a Different Address
      3. OPT Summary
        1. Code Assembled Starting at P%
        2. Code Assembled Starting at O%
      4. How the Assembler Works
      5. Saving and Loading Machine Code Programs
        1. *SAVE
        2. *LOAD
    4. Conditional Assembly and Macros
      1. Introduction
      2. Conditional Assembly
      3. Macros

  4. Statements and Functions
    1. Introduction
      1. Syntax
        1. Symbols
    2. ABS
    3. ACS
    4. ADVAL
    5. AND
    6. ASC
    7. ASN
    8. ATN
    9. AUTO
    10. BGET#
    11. BPUT#
    12. BY
    13. CALL
      1. Parameter Table
      2. Parameter Formats
    14. CASE
    15. CHAIN
    16. CHR$
    17. CIRCLE
    18. CLEAR
    19. CLOSE#
    20. CLG
    21. CLS
    22. COLOUR
    23. COS
    24. COUNT
    25. DATA
    26. DEF
    27. DEG
    28. DELETE
    29. DIM
      1. Dimensioning arrays
      2. Reserving an area of memory
      3. Reserving a temporary area of memory
      4. DIM as a function
    30. DIV
    31. DRAW
    32. EDIT
    33. ELLIPSE
    34. ELSE
    35. END
    36. ENDCASE
    37. ENDIF
    38. ENDPROC
    39. ENDWHILE
    40. ENVELOPE
    41. EOF#
    42. EOR
    43. ERL
    44. ERR
    45. ERROR
    46. EVAL
    47. EXIT
    48. EXP
    49. EXT#
    50. FALSE
    51. FILL
    52. FN
    53. FOR
    54. GCOL
    55. GET/GET$
      1. Reading from an I/O port
      2. Reading from a file
    56. GOSUB
    57. GOTO
    58. HIMEM
    59. IF
      1. Single-line IF statement
      2. Multi-line IF statement
    60. INKEY/INKEY$
    61. INPUT
    62. INPUT LINE
    63. INPUT#
    64. INSTR
    65. INT
    66. LEFT$
    67. LEN
    68. LET
    69. LINE
    70. LIST
    71. LIST IF
      1. Limitations
    72. LISTO
      1. Bit Settings
    73. LN
    74. LOAD
    75. LOCAL
      1. LOCAL DATA
    76. LOG
    77. LOMEM
    78. MID$
    79. MOD
    80. MODE
    81. MOUSE
      1. MOUSE ON n
      2. MOUSE OFF
      3. MOUSE TO x,y
      4. MOUSE RECTANGLE l,b,w,h
    82. MOVE
    83. NEW
    84. NEXT
    85. NOT
    86. OF
    87. OFF
    88. OLD
    89. ON
      1. Limitations
      2. Enabling the text cursor
    90. ON ERROR
    91. ON ERROR LOCAL
    92. OPENIN
    93. OPENOUT
    94. OPENUP
    95. OPT
      1. Code Assembled Starting at P%
      2. Code Assembled Starting at O%
    96. OR
    97. ORIGIN
    98. OSCLI
    99. OTHERWISE
    100. PAGE
    101. PI
    102. PLOT
    103. POINT
    104. POS
    105. PRINT
      1. General Information
      2. Print Format Control
        1. STR$ Format Control - SS
        2. Format Selection - NN
        3. Number of Digits - PP
        4. Zone Width - WW
        5. Changing the Print Control Variable
      3. Examples
    106. PRINT#
    107. PROC
    108. PTR#
    109. PUT
    110. QUIT
    111. RAD
    112. READ
    113. READ#
    114. RECTANGLE
    115. REM
    116. RENUMBER
    117. REPEAT
    118. REPORT/REPORT$
    119. RESTORE
      1. RESTORE DATA
      2. RESTORE ERROR
      3. RESTORE LOCAL
    120. RETURN
    121. RIGHT$
    122. RND
    123. RUN
    124. SAVE
    125. SGN
    126. SIN
    127. SOUND
    128. SPC
    129. SQR
    130. STEP
    131. STOP
    132. STR$
    133. STRING$
    134. SUM and SUMLEN
      1. SUM
      2. SUMLEN
    135. SWAP
    136. SYS
    137. TAB
    138. TAN
    139. THEN
    140. TIME
    141. TINT
    142. TO
    143. TOP
    144. TRACE
    145. TRUE
    146. UNTIL
    147. USR
    148. VAL
    149. VDU
    150. VPOS
    151. WAIT
    152. WHEN
    153. WHILE
    154. WIDTH

  5. BBC BASIC (Z80) Files
    1. Introduction
    2. The Structure of Files
      1. Basics
      2. Serial (Sequential) Files
      3. Random Access Files
      4. Indexed Files
    3. Files in BBC BASIC (Z80)
      1. Introduction
      2. How Data is Read/Written
      3. How Data is Stored
        1. Numeric Data
        2. How Strings are Stored
      4. How Files are Referred To
      5. File Buffering
    4. File Commands
      1. Introduction
      2. Filenames
      3. Organisation of Examples
      4. Program File Manipulation
        1. SAVE
        2. LOAD
        3. CHAIN
        4. MERGE
        5. *ERA
        6. *REN
        7. *DIR
      5. Data Files
        1. Introduction
        2. Opening Files
        3. File Opening Functions
        4. OPENOUT
        5. OPENIN
        6. OPENUP
        7. CLOSE#
        8. INPUT#
        9. PRINT#
        10. EXT#
        11. PTR#
        12. EOF#
        13. BGET#
        14. BPUT#
    5. Serial Files
      1. Introduction
      2. Character Data Files
        1. Ex 1 - Writing Serial Character Data
        2. Ex 2 - Reading Serial Character Data
        3. Ex 3 - Writing 'AT END' of Character Files
      3. Mixed Numeric/Character Data Files
        1. Ex 4 - Writing a Mixed Data File
        2. Ex 5 - Reading a Mixed Data File
        3. Ex 6 - Writing 'AT END' of Mixed Files
      4. Compatible Data Files
        1. Ex 7 - Writing a Compatible Data File
        2. Ex 8 - Reading a Compatible Data File
    6. Random (Relative) FIles
      1. Introduction
      2. Designing the File
        1. Record Structure
        2. Accessing The Records
      3. Ex 9 - Simple Random Access File
      4. Ex 10 - Simple Random Access Database
      5. Ex 11 - Random Access Inventory Program
    7. Indexed Data Files
      1. Deficiencies of Random Access Files
      2. The Address Book Program
        1. File Organisation
        2. Program Organisation
        3. The Index
      3. Ex 12 (the LAST)
    8. The Binary Chop
      1. Explanation

  6. Operating System Interface
    1. Introduction
      1. File Specifiers
      2. Symbols
    2. Accessing Star Commands
      1. Syntax
      2. Case Conversion
      3. Special Characters
    3. Resident Star Commands
      1. *BYE
      2. *CPM
      3. *DIR
      4. *DRIVE
      5. *ERA
      6. *LOAD
      7. *OPT
      8. *REN
      9. *RESET
      10. *SAVE
      11. *TYPE

  7. Table of ASCII Codes

  8. Mathematical Functions

  9. Error Messages and Codes
    1. Summary
      1. Trappable - Program
      2. Trappable - Operating System
      3. Untrappable - Error Code 0
    2. Details
      1. Accuracy lost
      2. Bad arguments
      3. Bad call
      4. Bad command
      5. Bad DIM
      6. Bad EXIT
      7. Bad FOR variable
      8. Bad hex or binary
      9. Bad name
      10. Bad program
      11. Bad string
      12. Bad subscript
      13. Bad use of array
      14. Can't match FOR
      15. Channel
      16. Close error
      17. DATA not LOCAL
      18. DIM space
      19. Directory full
      20. Disk full
      21. Division by zero
      22. Escape
      23. Exponent range
      24. Failed at nnn
      25. File exists
      26. File not found
      27. LINE space
      28. Log range
      29. Missing ,
      30. Missing "
      31. Missing )
      32. Missing #
      33. Missing ENDCASE
      34. Missing ENDIF
      35. Missing TO
      36. Mistake
      37. Multiple label
      38. -ve root
      39. No GOSUB
      40. No room
      41. No such FN/PROC
      42. No such line
      43. No such variable
      44. Not in a FN
      45. Not in a FN/PROC
      46. Not in a FOR looop
      47. Not in a PROC
      48. Not in a REPEAT loop
      49. Not in a WHILE looop
      50. Number too big
      51. OF not last
      52. ON ERROR not LOCAL
      53. ON range
      54. ON syntax
      55. Out of DATA
      56. Out of range
      57. RENUMBER space
      58. Silly
      59. String too long
      60. Syntax error
      61. Too many open files
      62. Type mismatch
      63. Unknown error

  10. Format of Program and Variables in Memory
    1. Memory Map
      1. The Memory Map
    2. Memory Management
      1. Limiting the Number of Variables
      2. String Management
        1. Garbage Generation
        2. Memory Allocation for String Variables
    3. Program Storage in Memory
      1. Line Length
      2. Line Number
      3. Statements
      4. Line Terminator
    4. Variable Storage in Memory
      1. Integer Variables
      2. Byte Variables
      3. Real Variables
      4. String Variables
      5. Fixed Strings
      6. Array storage

Left HOME

INTRODUCTION Right


Best viewed with Any Browser Valid HTML 4.0!
© Doug Mounter and Richard Russell