R.T.Russell Home Page

R. T. RUSSELL

BBC BASIC (86) Manual



Table of Contents

  1. Introduction
    1. Before You Start
      1. Variants of BBCBASIC(86)
        1. Naming Conventions
      2. Technicalities
    2. Running BBC BASIC (86)

  2. General Information
    1. Introduction
      1. Control Codes and Functions
        1. Generation
        2. What Happens to Control Codes?
        3. Special Control Codes
      2. Line Numbers
      3. Statement Separators
    2. Editing
      1. Introduction
      2. Copy Key Editing
        1. The Copy Key
        2. The Back-space Key
      3. The Line Editor - EDIT
      4. The Screen Editor - *EDIT
    3. Expression Priority
      1. Order of Evaluation
      2. Examples
    4. Variables
      1. Specification
      2. Numeric Variables
        1. Real Variables
        2. Integer Variables
        3. Static Variables
        4. Boolean Variables
        5. Numeric Accuracy
      3. String Variables and Garbage
        1. Strings
        2. Garbage Generation
        3. Memory Allocation
      4. Arrays
    5. Program Flow Control
      1. Introduction
      2. Loop Operation Errors
      3. Program Structure Limitations
      4. Leaving Program Loops
        1. REPEAT...UNTIL Loops
        2. Changing the Loop Variable
        3. Popping the Inner Variable
      5. Local Variables
      6. Stack Pointer
    6. Indirection
      1. Introduction
      2. Query
        1. Byte Access
        2. Query as a Byte Variable
      3. Exclamation
      4. Dollar
      5. Use as Binary Operators
      6. Power of Indirection Operators
    7. Operators and Special Symbols
    8. Keywords
    9. Error Handling
      1. Introduction
        1. Types of Errors
        2. Trapping Errors
        3. Reasons for Trapping Errors
      2. Error Trapping Commands
        1. ON ERROR
        2. ON ERROR LOCAL
        3. ON ERROR or ON ERROR LOCAL?
      3. Error Reporting
        1. ERR
        2. ERL
        3. REPORT
      4. Error Trapping Examples
    10. Procedures and Functions
      1. Introduction
      2. Names
      3. Functions and Procedure Definitions
        1. Starting a Definition
        2. The Function/Procedure Body
        3. Ending a Definition
        4. Single Line Functions/Procedures
        5. Extending the Language
      4. Passing Parameters
        1. Formal and Actual Parameters
      5. Local Variables
        1. Re-entrant Functions/Procedures

  3. Graphics and Colours
    1. Introduction
    2. Display Modes
      1. Available Modes
      2. Graphics Coordinates
    3. Colours
      1. Introduction
      2. Text Colours
        1. Two Colour Graphics Mode
        2. Four Colour Graphics Modes
        3. Sixteen Colour Graphics Modes
        4. Text Only Modes
      3. Graphics Colours
        1. Setting The Colours
        2. Two Colour Graphics
        3. Four Colour Graphics
        4. Sixteen Colour Graphics
    4. The Palette
      1. Logical Colours
      2. Physical Colours
      3. Palettes Available
      4. Setting the Palette
      5. Colours Available
      6. Normal Palette
        1. Normal Palette - CGA Modes
        2. Normal Palette - EGA/VGA Colour Modes
        3. Normal Palette - Text Only Modes
      7. Enhanced Palette
        1. Enhanced Palette - Graphics Modes
        2. Enhanced Palette - Text Only Modes
        3. Enhanced Palette - VGA
      8. Border Colour
      9. Default Colour Setting
    5. Drawing on The Screen
      1. Introduction
        1. Screen Dimensions
        2. The Graphics Area
      2. DRAW
      3. MOVE
      4. PLOT
        1. Basic Modes
        2. Enhanced Modes
        3. Horizontal Line Fill to Non-background
        4. Triangle Plot and Fill
        5. Horizontal Line Fill to Background Right
        6. Rectangle Plot and Fill
        7. Horizontal Line Fill to Foreground
        8. Parallelogram Plot and Fill
        9. Horizontal Line Fill to Non-foreground Right
        10. Flood Fill to Non-background
        11. Flood Fill to Foreground
        12. Draw Circle
        13. Draw Solid Disc
        14. Draw Relative
        15. Logical Inverse Colour
        16. POINT
    6. Windows
      1. Introduction
      2. Text Window
        1. Define Text Window
        2. Clear Text Window
      3. Graphics Window
        1. Define Graphics Window
        2. Clear Graphics Window
        3. Changing the Graphics Origin
        4. Resetting Text and Graphics Windows
        5. Positioning The Cursor
    7. User Defined Characters
      1. Defining a Character
      2. Character Dot Pattern
        1. Double Height Characters
      3. Text Positioning
        1. Text at Graphics Cursor
        2. Text at Text Cursor
      4. Current Character

  4. Assembler
    1. Introduction
      1. BIGBASIC
      2. Statements
      3. Labels
      4. Comments
    2. Language Syntax
      1. Differences from The Intel Syntax
        1. Jumps and Calls
        2. Memory Operands
        3. String Operations
        4. Segment Override
        5. Byte/Word Ambiguities
        6. Based-Indexed Operands
        7. Indexed Memory Operands
      2. Word and String Constants
        1. Define Byte - DB
        2. Define Word - DW
        3. Define Double Word - DD
    3. 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
    4. 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
    5. Conditional Assembly and Macros
      1. Introduction
      2. Conditional Assembly
      3. Macros

  5. Statements and Functions
    1. Introduction
      1. BIGBASIC
      2. Single Key Entry
      3. Syntax
        1. Symbols
    2. ABS
    3. ACS
    4. ADVAL
      1. Positive Argument (1 to 4)
      2. Zero Argument
      3. Negative Argument (-6)
    5. AND
    6. ASC
    7. ASN
    8. ATN
    9. AUTO
    10. BGET#
    11. BPUT#
    12. CALL
      1. Operating System Interface
      2. Parameter Table
      3. Parameter Formats
        1. Example
    13. CHAIN
    14. CHR$
    15. CLEAR
    16. CLOSE#
    17. CLG
    18. CLS
    19. COLOUR
      1. Two Colour Graphics Mode
      2. Four Colour Graphics Modes
      3. Sixteen Colour Graphics Modes
      4. Text Only Modes
    20. COS
    21. COUNT
    22. DATA
    23. DEF
    24. DEG
    25. DELETE
    26. DIM
      1. Dimensioning Arrays
      2. Reserving an Area of Memory
    27. DIV
    28. DRAW
    29. EDIT
    30. ELSE
    31. END
    32. ENDPROC
    33. ENVELOPE
    34. EOF#
    35. EOR
    36. ERL
    37. ERR
    38. EVAL
    39. EXP
    40. EXT#
    41. FALSE
    42. FN
    43. FOR
    44. GCOL
      1. Two Colour Graphics
      2. Four Colour Graphics
      3. Sixteen Colour Graphics
    45. GET/GET$
    46. GOSUB
    47. GOTO
    48. HIMEM
    49. IF
    50. INKEY/INKEY$
    51. INPUT
    52. INPUT LINE
    53. INPUT#
    54. INSTR
    55. INT
    56. LEFT$
    57. LEN
    58. LET
    59. LIST
    60. LIST IF
      1. Limitations
    61. LISTO
      1. Bit Settings
    62. LN
    63. LOAD
    64. LOCAL
    65. LOG
    66. LOMEM
    67. MID$
    68. MOD
    69. MODE
      1. Available Modes
    70. MOVE
    71. NEW
    72. NEXT
    73. NOT
    74. OLD
    75. ON
      1. Limitations
    76. ON ERROR
    77. ON ERROR LOCAL
    78. OPENIN
    79. OPENOUT
    80. OPENUP
    81. OPT
      1. Code Assembled Starting at P%
      2. Code Assembled Starting at O%
    82. OR
    83. OSCLI
    84. PAGE
    85. PI
    86. PLOT
      1. Basic Modes
      2. Enhanced Modes
      3. Horizontal Line Fill to Non-background
      4. Triangle Plot and Fill
      5. Horizontal Line Fill to Background Right
      6. Rectangle Plot and Fill
      7. Horizontal Line Fill to Foreground
      8. Parallelogram Plot and Fill
      9. Horizontal Line Fill to Non-foreground Right
      10. Flood Fill to Non-background
      11. Flood Fill to Foreground
      12. Draw Circle
      13. Draw Solid Disc
      14. Draw Relative
      15. Logical Inverse Colour
    87. POINT
    88. POS
    89. 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
    90. PRINT#
    91. PROC
    92. PTR#
    93. PUT
    94. RAD
    95. READ
    96. REM
    97. RENUMBER
    98. REPEAT
    99. REPORT
    100. RESTORE
    101. RETURN
    102. RIGHT$
    103. RND
    104. RUN
    105. SAVE
    106. SGN
    107. SIN
    108. SOUND
      1. Channel
      2. Loudness
      3. Pitch
      4. Duration
      5. Examples
    109. SPC
    110. SQR
    111. STEP
    112. STOP
    113. STR$
    114. STRING$
    115. TAB
    116. TAN
    117. THEN
    118. TIME
    119. TIME$
    120. TO
    121. TOP
    122. TRACE
    123. TRUE
    124. UNTIL
    125. USR
      1. Operating System Interface
    126. VAL
    127. VDU
      1. BBC Micro VDU Emulation
    128. VPOS
    129. WIDTH

  6. VDU Emulation
    1. Introduction
    2. VDU Code Summary
    3. Description of VDU Codes
      1. VDU 0
      2. VDU 1
      3. VDU 2
      4. VDU 3
      5. VDU 4
      6. VDU 5
      7. VDU 6
      8. VDU 7
      9. VDU 8
      10. VDU 9
      11. VDU 10
      12. VDU 11
      13. VDU 12
      14. VDU 13
      15. VDU 14
      16. VDU 15
      17. VDU 16
      18. VDU 17
      19. VDU 18
      20. VDU 19
        1. Physical Colours
        2. Palettes Available
        3. Setting the Palette
        4. Colours Available
        5. Normal Palette - CGA Modes
        6. Normal Palette - EGA/VGA Colour Modes
        7. Normal Palette - Text Only Modes
        8. Enhanced Palette
        9. Enhanced Palette - VGA
        10. Border Colour
      21. VDU 20
      22. VDU 21
      23. VDU 22
      24. VDU 23
        1. Enable/Disable Cursor
        2. Programming the 6845 CRT Controller
      25. VDU 24
      26. VDU 25
      27. VDU 26
      28. VDU 27
      29. VDU 28
      30. VDU 29
      31. VDU 30
      32. VDU 31
      33. VDU 127

  7. Operating System Interface
    1. Introduction
      1. File Specifiers
      2. Symbols
    2. Accessing Star Commands
      1. Syntax
      2. Non Resident Star Commands
      3. Similarly Named Star Commands
      4. Errors in Star Commands
      5. Case Conversion
      6. Special Characters
    3. Additional OS Interfaces
      1. Current Character - OSBYTE Call
      2. Character Dot Pattern - OSWORD Call
      3. OSRDCH, OSWRCH, OSKEY and OSCLI Calls
    4. Resident Star Commands
      1. *BYE
      2. *CHDIR
      3. *DELETE
      4. *DIR
      5. *DRIVE
      6. *EDIT
      7. *EGA
      8. *ERASE
      9. *ESC
      10. *EXEC
      11. *FX
      12. *HELP
      13. *KEY
      14. *LOAD
      15. *LOCK
      16. *MKDIR
      17. *OPT
      18. *QUIT
      19. *RMDIR
      20. *RENAME
      21. *RUN
      22. *SAVE
      23. *SPOOL
      24. *SPOOLON
      25. *TV
      26. *TYPE
      27. *UNLOCK
      28. *|
    5. BBC Micro Star Commands
      1. *ACCESS
      2. *BACKUP
      3. *BUILD
      4. *CODE
      5. *COMPACT
      6. *COPY
      7. *DESTROY
      8. *DIR
      9. *DISK
      10. *DUMP
      11. *ENABLE
      12. *INFO
      13. *KEYS
      14. *LIB
      15. *LINE
      16. *LIST
      17. *MOTOR
      18. *ROM
      19. *TAPE
      20. *TITLE
      21. *TV
      22. *WIPE

  8. BBCBASIC(86) Disk Files
    1. Introduction
    2. The Structure of Files
      1. Basics
      2. Serial (Sequential) Files
      3. Random Access Files
      4. Indexed Files
    3. Files in BBCBASIC(86)
      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
    4. BBCBASIC(86) File Access
      1. File Buffering
      2. Precautions
      3. Networking - Shared Files
    5. Disk File Commands
      1. Introduction
      2. Filenames
      3. Organisation of Examples
      4. Program File Manipulation
        1. SAVE
        2. LOAD
        3. CHAIN
        4. MERGE
        5. *DEL/*ERA
        6. *REN
        7. *DIR
        8. UNLIST
        9. CRUNCH
      5. Disk 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#
    6. 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
    7. 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
    8. 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)
    9. The Binary Chop
      1. Explanation

  1. Table of ASCII Codes

  2. Mathematical Functions

  3. Error Messages and Codes
    1. Summary
      1. Trappable - Program
      2. Trappable - Operating System
      3. Untrappable - Error Code 0
    2. Details
      1. Access denied
      2. Accuracy lost
      3. Arguments
      4. Array
      5. Bad call
      6. Bad command
      7. Bad DIM
      8. Bad directory
      9. Bad drive
      10. Bad HEX
      11. Bad key
      12. Bad MODE
      13. Bad name
      14. Bad program
      15. Bad string
      16. Can't match FOR
      17. Channel
      18. Device fault
      19. DIM space
      20. Disk fault
      21. Disk full
      22. Disk read only
      23. Division by zero
      24. Escape
      25. Exp range
      26. Failed at nnn
      27. File exists
      28. File not found
      29. FOR variable
      30. LINE space
      31. Log range
      32. Missing ,
      33. Missing "
      34. Missing )
      35. Missing #
      36. Mistake
      37. Multiple label
      38. -ve root
      39. No GOSUB
      40. No FN
      41. No FOR
      42. No PROC
      43. No REPEAT
      44. No room
      45. No such FN/PROC
      46. No such line
      47. No such variable
      48. No TO
      49. Not LOCAL
      50. ON range
      51. ON syntax
      52. Out of DATA
      53. Out of range
      54. RENUMBER space
      55. Silly
      56. Size needed
      57. String too long
      58. Subscript
      59. Syntax error
      60. Too big
      61. Too many open files
      62. Type mismatch
      63. Wrap

  4. Format of Program and Variables in Memory
    1. Memory Map
      1. BBCBASIC(86) Work Space
        1. Workspace RAM
      2. 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. Real Variables
      3. String Variables
      4. Fixed Strings

  5. Utility Routines
    1. Introduction
    2. Program and Data Format Conversion
      1. Transferring the Files
        1. Preparation
        2. Transferring the Comms Program
        3. Transferring a File
      2. Converting the Files Using FCONVERT.BBC
        1. Program Files
        2. Data Files
    3. Serial I/O
    4. Direct Memory Access

  6. BBCRUN/BIGRUN
    1. Introduction
    2. Additional Facilities
      1. User Defined Characters
      2. Command Line Parameters
    3. Using BBCRUN
      1. Files Needed
      2. Running BBCRUN (BIGRUN)
        1. Interactive Mode
        2. Command Line Mode

  7. BIGBASIC
    1. Introduction
    2. General Information
      1. Memory Used
      2. Stack
      3. Variables and Arrays
      4. Indirection
      5. BIGRUN
    3. Assembler
      1. Introduction
      2. Program Counter
      3. Calling Assembler Code Routines
      4. Segment Registers
      5. OSWORD Parameter Block
    4. Keywords
      1. CALL
        1. Parameter Table
        2. Parameter Formats
      2. EVAL
      3. HIMEM
      4. LOMEM and PAGE
      5. TOP
      6. USR
    5. Operating System Interface
      1. *LOAD and *SAVE
    6. Data Structure Format
      1. Integers and Reals
      2. Strings

  8. Teletext MODE7
    1. Introduction
    2. Installing MODE7.COM
    3. Functionality
      1. Character Set
      2. Reveal/Conceal
      3. Double Height Characters

Left HOME

INTRODUCTION Right


Best viewed with Any Browser Valid HTML 3.2!
© Richard Russell