8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly

Page Last Altered:

9741 GCOL

Submitted by Steve Fewell


Get the result of the expression at BASIC Text Pointer A, convert the result to Integer (Type mismatch error if String),
and Set BASIC Text Pointer A to BASIC Text Pointer B value.
Push &2A (the LSB of the Integer value - i.e. the first GCOL parameter) to the stack.

Call &96AC to check for a comma ('Missing ,' error if not found) and get the integer result at the BASIC text Pointer B
location (issuing 'Type mismatch' error if a String value was found).
Call &9B96 to check that the Statement (at BASIC Text Pointer B location) terminates correctly ('Syntax' error is issued
if end of statement marker is not found).

Output character 18 (to start a VDU 18 - GCOL command).
Pop the first Integer from the stack and [&979B] output the character (this is the first parameter to the GCOL command).

Next, output the contents of location &2A (The IWA LSB, which contains the second GCOL parameter), this completes the
GCOL parameters, and the Operating system now executes the GCOL command.
Lastly, jump to &9005 to start processing the next program statement.

Disassembly for the GCOL routine

9741 o 032 111 146 20 6F 92 JSR &926F Evaluate Expression at BASIC Text pointer A convert result to integer
9744 * 165 042 A5 2A LDA &2A
9746 H 072 48 PHA
9747   032 172 150 20 AC 96 JSR &96AC Check for ',', get result of expression and convert result to Integer
974A   032 150 155 20 96 9B JSR &9B96 Check end of Statement (PTR B)
974D   169 018 A9 12 LDA#&12
974F   032 238 255 20 EE FF JSR &FFEE OSBYTE
9752 h 104 68 PLA
9753 F 128 070 80 46 BRA 70 --> &979B


 Back to 8BS