Index

abbreviating programs 73      
ABS function 24, 143, 163     
absolute addressing 118       
absolute,X addressing 119     
absolute,Y addressing 119     
accounting 13                 
accumulator (A) 98            
 A register 122               
accuracy loss of 13           
ACK code 131                  
acknowledgements 1            
ACS function 163              
actions in flowcharts 21      
ADC instruction 98, 181       
add (+) operator 158          
adding two-byte numbers in
    assembler 101             
address memory 96             
addressing modes 118          
 modes permitted 181          
addressing modes:             
 absolute 118                 
 absolute,X 119               
 absolute,Y 119               
 immediate 103, 118           
 indexed 117, 119             
 indirect 120                 
 post-indexed indirect 121
 pre-indexed indirect 121     
 zero-page 119                
 zero,X 120                   
 zero,Y 120                   
advanced graphics 79          
algorithm Euclid's 35         
AND (&) operator 15, 158      
 connective 30, 143           
 instruction 113, 182         
Animals program 70            
animated graphics 85          
APPEND equivalent 142         
appending text 142            
apple tart recipe 20          
Arbitrary Precision Powers
    program 55                
arbitrary-precision arithmetic
    47, 55                    
arrays AA to ZZ 45            
 assigning to 46              
 dimensioning a5              
 floating-point 161           
 in BASIC 45                  
 multi-dimensional 50         
 of strings 62, 63            
 subscript checking for 50
ASCII code for characters 59, 131
ASL instruction 115, 182          
ASN function 163                  
assembler 99                      
  compared with BASIC 95          
  delimiters ([ and ]) 171        
  formats 181                     
  listing 100, 171                
  mnemonics 181                   
  program 99                      
  programming 95                  
  syntax definition 202           
assembly conditional 175          
  in-line 178                     
  listing suppressing 173         
  two-pass 172                    
assigning to arrays 46            
assignment (=) operator 12        
  string 58                       
asterisk (*) in COS commands 139
at (0) symbol 103, 118, 156       
ATN function 163                  
                                 
backspace 132                     
backward references 172           
baffled what to do if 91          
base sixteen 96                   
  ten 96                          
BASIC calculating in 11           
  characters and operators 155
  compared with assembler 95      
  language 11                  
BASIC program writing a 23        
BASIC statements, functions, and
    commands 143                  
  syntax definition 199           
BCC instruction 106, 182          
BCS instruction 106, 182          
BELL code 132                     
BEQ instruction 106, 182          
BGET function 68, 144             
binary conversion to 112          
  digits 111                      
  notation 111                    
bistables 111                     
bit high-order 112                
BIT instruction 183               
bit least-significant 112         
  low-order 112                   
  most-significant 112            
bits 111                          
bleep 6, 132                      
Bleep program 114                 
bleep routine 125                 
_211_
Block Move program 178           
block zero RAM 168               
  RAM locations 194               
blocks file 10                   
BMI instruction 183              
BNE instruction 106, 183         
bounds of array or vector 92     
BPL instruction 183              
BPUT statement 67, 144           
brackets 156                     
  in BASIC programs 74            
branches conditional 106         
break flag 122                   
BREAK key 6                      
BRK instruction 174, 183         
BS code 132                      
Bulls & Cows program 127         
BVC instruction 183              
BVS instruction 184              
byte 98                          
  indirection (?) operator 53,
    158                          
byte vectors 53                  
  dimensioning 53                 
bytes 112                        
  for program free 24             
                                
calculating in BASIC 11          
calculations fixed-point 13      
  floating-point 161             
  with money 13                  
Calculator program 137           
call by reference using vectors
    54                           
calls operating-system 192       
CAN code 132                     
cancel 132, 155                  
carry flag 101, 108, 122         
cassette database on 70          
  input from 68                  
  interface setting up 8         
  operating system 139           
  output to 67                   
  saving data on 68              
cassette-interface signals 194
CAT command 9, 139               
central processing unit 98       
CH function 59, 97, 144          
changing memory locations 15, 97
  text spaces 135                
character codes 134              
  extraction 59                  
  return 59                      
character set 134                
characters ASCII code for 59, 131
  internal representation 97     
  inverted 131                   
  printing special 64            
Chequebook-Balancing program 39
circle of random hex characters
    84                          
CLC instruction 98, 184         
CLD instruction 184             
clear screen 6                  
CLEAR statement 28, 79, 144, 167
CLI instruction 184             
clock plot 87                   
Clock program 85                
CLV instruction 184             
CMP instruction 109, 184        
co-routines 42                  
codes control 65                
  cursor-movement 65             
  error 205                      
  screen control 65              
Coleridge 7                     
colour graphics 88, 167         
COLOUR statement 167            
comma (,) separator 156         
  in PRINT statement 12, 75      
command abbreviations 73        
commands 7                      
commands:                       
  LIST 7, 149                    
  LOAD 9, 135, 139, 149          
  NEW 7, 149                     
  OLD 7                          
comments in assembler 172       
  in BASIC 24                    
compare in assembler 109        
  macro 178                      
concatenation of strings 61     
conditional assembly 175        
  branches 106                   
conditions in BASIC 28          
conjunctions AND and OR 30      
connecting up 3                 
connections to ATOM 2           
connectives:                    
  AND 30, 143                    
  OR 150                         
  STEP 34, 153                   
  THEN 30, 74, 153               
  TO 153                         
contents memory 96              
control codes 65                
control codes:                  
  ACK 131                        
  BELL 132                       
  BS 132                         
  CAN 132                        
  CR 132                         
  ESC 132                        
  ETX 131                        
  FF 132                         
  HT 132                         
  LF 132                         
  NAK 132                        
  RS 132                         
  SI 132                         
_212_
  SO 132                         
  STX 131                        
                                
control variable in assembler 109
  in NEXT statement 75           
conversion Arabic to Roman       
     numerals 123                
  decimal to hexadecimal 96      
  hexadecimal to decimal 96      
  number-to-string 163           
  string-to-number 165           
  temperature 23                 
  to binary 112                  
coordinates graphics 27          
COPY key 133                     
COS 139                          
COS commands:                    
  CAT 9, 139                     
  FLOAD 141                      
  LOAD 139, 140                  
  MON 141                       
  NOMON 141                      
  RUN 141                        
  SAVE 139, 140                  
COS errors 142                   
  function 163                   
COS messages disable 141         
  enable 141                     
COUNT function 145               
counting in assembler 109        
  in flowcharts 19               
CPU 98                           
CPX instruction 109, 184         
CPY instruction 109, 185         
CR code 132                      
CRC Signature program 93         
CTRL (control) key 6, 194        
  key 140                        
Cubic Curve program 32           
cursor 3                        
  home 132                       
  turn on/off 16                 
cursor-movement codes 65         
curve Sierpinski 81              
Curve Stitching in a Square      
     program 34                  
curve stitching in 4 colours 88
curve three-dimensional 84       
Cycloid program 166              
                                
DATA equivalent 63               
data on cassette saving 68       
Data to Cassette program 68      
data types of 67                 
database on cassette 70          
Day of Week program 62           
debugging in assembler 176       
DEC instruction 185              
decimal mode flag 122            
  to hexadecimal conversion 96
decisions in flowcharts 18       
decoding 60                       
DEG function 164                  
delay random 38                   
DELETE key 6                      
deleting lines 7                  
delimiter statement 14            
demonstration programs 4          
DEX instruction 108, 185          
DEY instruction 108, 185          
Dice Tossing program 27           
Digital Clock program 37          
 Waveform Processing program 48
DIM in assembler 99, 105          
 statement 45, 57, 145            
dimensioning arrays 45            
 byte vectors 53                  
 strings 57                     
disable COS messages 141          
divide (/) operator 11, 158       
DO statement 145                  
DO...UNTIL loop 34                
double quote (") delimiter 155
DRAW statement 28, 80, 145        
drawing lines 28                 
                                 
ear 113                           
editing screen 132                
  text 7                          
eight queens problem 44           
Eight Queens program 44           
enable COS messages 141           
Encoder/Decoder program 60        
encoding 60                       
END statement 145                 
EOR instruction 113, 185          
equal (=) operator 29, 58, 158
equality string 58                
equation root of 41               
error codes 205                   
  handler 137                     
ERROR message 8, 174              
errors                            
  COS 142                         
  floating-point 205              
  logical 91                      
  NAME 10                         
  SUM 10                         
  syntax 91                       
  tape 10                         
  trapping 137                    
ESC code 132                      
  key 7, 24, 106                  
escape 132, 155                   
ETX code 131                      
Euclid's algorithm 35             
examining memory locations 97     
examples graphics 81              
exclusive-OR (:) operator 15, 158
execute file load and 141         
executing machine-code 173        
_213_
  stored text 23                  
execution speed maximising 75
expansion memory 168             
exponent 162                     
expression 143                   
EXT function 145                 
extension floating-point ROM 161
extraction character 59          
                                
factor 143                       
false logical value 31           
Farenheit to Celsius program 23
faster FOR...NEXT loops 76       
faults hardware 92               
  RAM memory 92                  
  ROM memory 92                  
FDIM statement 162               
FF code 132                      
FGET function 164                
FIF statement 162                
file blocks 10                   
  handle 67                      
files named 139                  
  text 9                         
  unnamed 139                    
filter low-pass 49               
FIN function 68, 146             
find input 68                    
  output 68                      
finish loading 141               
FINPUT statement 162             
First Twelve Powers of Two       
    program 31                   
fixed-point calculations 13      
flags status 122                 
flags:                         
  break 122                      
  carry 101, 108, 122            
  decimal mode 122               
  interrupt disable 122          
  negative 122                   
  overflow 122                   
  zero 106, 108, 122             
flip/flops 111                   
FLOAD command 141                
floating-point arrays 161        
  calculations 161               
  errors 205                     
  extension 161                  
floating-point functions:        
  ABS 163                        
  ACS 163                        
  ASN 163                        
  ATN 163                        
  CDS 163                        
  DEG 164                        
  EXP 164                        
  FGET 164                       
  FLT 164                        
  HTN 164                        
  LOG 164                        
  PI 164                         
  RAD 164                        
  SGN 164                        
  SIN 164                        
  SQR 165                        
  TAN 165                        
  VAL 165                        
floating-point operators:        
  indirection (!) 165            
  integer (%) 165                
  power (^) 165                  
floating-point program examples
    166                          
  representation 162             
floating-point statements:       
  FDIM 162                       
  FIF 162                        
  FINPUT 162                     
  FPRINT 163                     
  FPUT 163                       
  FUNTIL 163                     
  STR 163                        
floating-point variables 165     
flowchart Guess a Number 30      
  puff pastry 20                 
  sponge cake 18                 
  symbols 21                     
flowcharts 17                    
  actions in 21                  
  counting in 19                 
  decisions in 18                
FLT function 164                 
FOR statement 33, 146            
FOR...NEXT loop 33               
  graph plotting using 34        
  step size in 34                
FOR...NEXT loops faster 76       
format for graphics screeri 27
formfeed 132                     
forward references 107, 172      
FOUT function 68, 146            
FPRINT statement 163             
FPUT statement 163               
Fractional Multiplication program
    178                          
free bytes for program 24        
function abbreviations 73        
functions string 58              
  trigonometrical 163            
functions:                       
  ABS 24, 143                    
  BGET 68, 144                   
  CH 59, 97, 144                 
  COUNT 145                      
  EXT 145                        
  FIN 68, 146                    
  FOUT 68, 146                   
  GET 68, 147                    
  LEN 59, 148                    
_214_
 PTR 151                         
 RND 24, 152                     
FUNTIL statement 163             
                                
GCD algorithm 35                 
generating tone 25               
GET function 68, 147             
golden ratio 41                  
GOSUB statement 39, 135, 147     
   to labels 41                  
GOTO multi-way switch using 26
   statement 25, 135, 147,       
   with label 25                 
graph plotting using FOR...NEXT
     loop 34                     
graphics advanced 79             
   animated 85                   
   colour 88                     
   coordinates 27                
   examples 81                   
   low-resolution 27             
   modes 79                      
   origin 28                   
   screen format for 27          
graphics space 168, 169          
graphics speed of 85             
   symbols 134                   
graphics symbols pr inting 65
graphics testing points in 87
greater-than (>) operator 29, 158
   or equal (>=) operator 158
greater-than or equal            
     operator 29                 
Greatest Common Divisor program
     35                          
Guess a Number flowchart 30      
   program 29                    
                                
hardware faults 92               
Harpsichord program 124          
hash (#) symbol 96               
hexadecimal (&) operator 14, 96,
     158                         
   (#) operator 14, 96, 157
   characters plotting 84        
   notation 14, 96               
   printing in 14               
   to decimal conversion 96      
high-fidelity equipment testing
     116                         
high-order bit 112               
histogram plot 69                
Histogram program 46             
home cursor 132                  
horizontal tab 132              
HT code 132                      
HTN function 164                 
                                
IF statement 148                
IF...THEN statement 28          
immediate addressing 103, 118
in-line assembly 178         
INC instruction 185          
increment macro 178          
index registers 107, 122     
  routine 125                 
Index Routine program 118
index X register 107, 122
  Y register 107, 122         
indexed addressing 117, 119
indirect addressing 120      
  jump 120                    
indirection (!) operator 165
input from cassette 68       
INPUT statement 23, 58, 14B
input string 58              
input/output parallel 169
  ports 194                   
  routines 191               
inserting lines 7            
instruction mnemonics 98, 181
instructions:                
  ADC 98, 181                 
  AND 113, 182                
  ASL 115, 182                
  BCC 106, 182                
  BCS 106, 182                
  BEQ 106, 182                
  BIT 183                    
  BNI 183                     
  BNE 106, 183                
  BPL 183                     
  BRK 174, 183                
  BVC 183                     
  BVS 184                     
  CLC 98, 184                 
  CLD 184                     
  CLI 184                     
  CLV 184                     
  CMP 109, 184                
  CPX 109, 184                
  CPY 109, 185                
  DEC 185                     
  DEX 108, 185                
  DEY 10S, 185                
  EOR 113, 185                
  INC 185                     
  INX 108, 186                
  INY 108, 186                
  JMP 105, 186                
  JSR 102, 186                
  LDA 98, 186                 
  LDX 107, 186                
  LDY 107, 187                
  LSR 115, 187                
  NOP 187                     
  ORA 113, 187                
  PHA 187                     
  PHP 187                     
  PLA 188                     
_215_
  PLP 188                        
  ROL 116, 188                   
  RTI 188                        
  RTS 188                        
  SBC 102, 189                   
  SEC 102, 189                   
  SED 189                        
  SEI 189                        
  STA 98, 189                    
  STX 107, 189                   
  STY 107, 190                   
  TAX 109, 190                   
  TAY 109, 190                   
  TSX 190                        
  TXA 110, 190                   
  TXS 190                        
  TYA 110, 190                   
integer (%) operator 165        
interface printer 169           
interrupt disable flag 122      
  vectors 193                    
interrupts 193                  
introduction 1                  
Invert String program 59        
inverted characters 5, 131      
  letters 25                     
INX instruction 108, 186        
INY instruction 108, 186        
iteration in BASIC 31           
iterative loop in assembler 108
                               
JNP instruction 105, 186        
JSB instruction 102, 186        
jump indirect 120               
jumps in assembler 105          
                               
keyboard 2, 5, 131              
keys:                           
  BREAK 6                       
  COPY 133                      
  CTRL 140                      
  CTRL (control) 6, 194         
  DELETE 6                      
  ESC 7, 24, 106                
  LOCK 5, 131                   
  REPT (repeat) 6, 194          
  RETURN 6                      
  screen editing 133            
  SHIFT 5, 131, 140, 194        
                               
labels a to z 25, 156           
  GOSUB to 41                   
  in assembler 105, 171         
language BASIC 11               
LDA instruction 98, 186         
LDX instruction 107, 186        
LDY instruction 107, 187        
learning program 70             
least-significant bit 112       
left-string extraction 61       
LEN function 59, 148            
length of a string 59           
less-than (<) operator 29, 158
  or equal (<=) operator 158     
less-than or equal (<=) operator
    29                          
LET statement 74, 148           
letters lower-case 5            
LF code 132                     
line numbers 6                  
Linear Interpolation program 41
linefeed 132                    
lines deleting 7                
  drawing 28                     
  inserting 7                    
  multi-statement 14, 75         
LINK statement 100, 149, 173
LIST command 7, 149             
listing assembler 100, 171      
load and execute file 141       
LOAD command 9, 135, 139, 140,
    149                         
loading finish 141              
location counter (P) 92, 171
locations memory 95             
LOCK key 5, 131                 
LOG function 164                
logical errors 91               
  operations 15, 112             
logical value false 31          
  true 31                        
logical variables 31            
loop DO...UNTIL 34              
  FOR...NEXT 33                  
loops in assembler 108          
  in BASIC 33                    
  mis-nested 36                  
  nested 36                      
loss of accuracy 13             
loudspeaker 114                 
low-order bit 112               
low-pass filter 49              
low-resolution graphics 27      
lower text space 168            
lower-case letters 5            
LSR instruction 115, 187        
                               
machine-code executing 173      
  in BASIC 123                  
  program 100                   
macro compare 178               
  increment 178                 
  parameters 177                
macros in assembler 177         
manipulations string 59         
mantissa 162                    
map memory 195                  
Mastermind game 126             
matrices representation of 51
  using vectors of vectors 56
_216_
maximising execution speed 75
memory address 96               
  expansion 168                 
  faults RAM 92                 
  faults ROM 92                 
  locations 95                  
memory locations changing 15, 97
  examining 97                  
  peeking 15                    
  poking 15                     
memory map 195                  
  screen 15                     
Memory Test program 92          
memory testing 92               
messages:                      
  ERROR 8, 174                  
  OUT OF RANGE 107              
  PLAY TAPE 9, 68, 140          
  RECORD TAPE 9, 68, 141        
  REWIND TAPE 10, 140           
mid-string extraction 61        
mis-nested loops 36             
mnemonic assembler 171          
mnemonics 181                   
  instruction 98                
modes addressing 118            
  graphics 79                   
MON command 141                
money calculations with 13      
most-significant bit 112        
MOVE statement 28, 80, 149      
multi-dimensional arrays 50     
multi-statement lines 14, 75
multi-way switch using GOTO 26
multiply (*) operator 11, 158
music 113, 124                  
  random 115                    
mystery quotation 60            
                               
NAK code 132                    
NAME error 10                   
named files 139                 
negative flag 122               
nested loops 36                 
NEW command 7, 149              
new line (') 156                
  printing 14                   
NEXT statement 33, 149          
  statement control variable in
    75                          
noise generation 116            
  on screen 168                 
noise-free plotting 154         
NOMON command 141               
NOP instruction 187            
not equal (<>) operator 29, 158
notation binary 111             
  hexadecimal 96                
number-to-string conversion 163
numbers random 24               
numeric data reading 64         
  field width 156               
                               
OLD command 7                   
  statement 150                 
ON ERROR GOTO equivalent 137
op code 98                      
operating system 131            
operating-system calls 192      
  routines 191                  
  vectors 193                   
operation code 98               
operations logical 15, 112      
operators:                      
  add (+) 158                   
  AND (&) 15, 158               
  assignment (=) 12             
  byte indirection (?) 53, 158
  divide (/) 11, 158            
  equal (=) 29, 58, 158         
  exclusive-OR (:) 15, 158      
  greater-than (>) 29, 158      
  greater-than or equal (>=) 158
  greater-than or equal (>=) 29
  hexadecimal (&) 14, 96, 158
  hexadecimal (#) 14, 96, 157
  less-than (<) 29, 158         
  less-than or equal (<=) 158
  less-than or equal (<=) 29
  multiply (*) 11, 158          
  not equal (<>) 29, 158        
  OR  \  15, 158                
  pling (!) 156                 
  query (?) 15, 53, 97          
  remainder (%) 11, 158         
  string ($) 57, 157            
  subtract (-) 11, 158          
  word indirection (!) 53, 156
OR  \  operator 15, 158         
  connective 150                
ORA instruction 113, 187        
origin graphics 28              
OSRDCH routine 102, 191         
OSWRCH routine 102, 191         
OUT OF RANGE message 107        
output to cassette 67           
overflow flag 122               
                               
page mode on/off 132            
parallel input/output 169       
parameters macro 177            
PEEK statement equivalent 15
peeking memory locations 15     
permitted addressing modes 181
permutation routine 52          
perspective plottinq 83         
PHA instruction 187             
phi 41                          
PHP instruction 187             
PI function 164                 
_217_
pixels 27, 79, 134               
PIA instruction 188              
PLAY TAPE message 9, 68, 140     
pling (!) operator 156           
plot clock 87                    
  histoqram 69                    
Plot Histogram from Cassette     
    program 69                   
PLOT statement 79, 150           
Plotting Hex Characters program
    84                           
plotting hexadecimal characters
    84                           
  in l3ASIC 87                    
  noise-free 154                  
  perspective 83                  
  points 28                       
  three-dimensional 83, 166       
PLP instruction 188              
point-plotting routine 88        
points plotting 28               
POKE statement equivalent 15     
poking memory locations 15       
  to screen 16                    
port writing to 170              
ports input/output 194           
post-indexed indirect addressing
    121                          
power (^) operator 165           
Powers of Numbers program 36     
 of Two program 31, 48           
pre-indexed indirect addressing
    121                          
prime Numbers program 54         
print Hex Digits program 176
 Inverted String program 117     
 Registers on BRK program 174
PRINT statement 11, 150         
 statement comma in 12, 75       
 statement quotes in 12          
print-field size (@) 13          
printer end 131                  
 interface 169                   
 start 131                       
printing a character in assembler
    102                          
 graphics symbols 65             
 in hexadecimal 14               
 new line 14                     
 special characters 64           
 str ing s 12, 58                
 the alphabet in assembler 110
prize 60                        
problem eight queens 44          
processor 6520 98                
program assembler 99             
 counter PC register 122         
 machine-code 100                
 planning a 17                   
programming service 93           
programs abbreviating 73         
programs:                        
  Animals 70                     
  Arbitrary Precision Powers 55
  Bleep 114                      
  Block Move 178                 
  Bulls & Cows 127               
  Calculator 137                 
  Chequebook-Balancing 39        
  Clock 85                       
  CRC Signature 93               
  Cubic Curve 32                 
  Curve Stitching in a Square 34
  Cycloid 166                    
  Data to Cassette 68            
  Day of Week 62                 
  Dice Tossing 27                
  Digital Clock 37               
  Digital Waveform Processing 48
  Eight Queens 44                
  Encoder/Decoder 60             
  Farenheit to Celsius 23        
  First Twelve Powers of Two 31
  Fractional Multiplication 178
  Greatest Common Divisor 35     
  Guess a Number 29              
  Harpsichord 124                
  Histogram 46                   
  Index Routine 118              
  Invert String 59               
  Linear Interpolation 41        
  Memory Test 92                 
  Plot Histogram from Cassette 69
  Plotting Hex Characters 84     
  Powers of Numbers 36           
  Powers of Two 31, 48           
  Prime Numbers 54               
  Pr int Hex Dig its 176         
  Print Inverted String 117      
  Print Registers on BRK 174     
  Random Coloured Lines 168      
  Random Noise 116               
  Random Rectangles 80           
  Random Walk 65                 
  Reaction Timer 37              
  Renumber 136                   
  Replace 123                    
  Roman Numerals 123             
  Rotating Rectangle 28          
  Saddle Curve 166               
  Sierpinski Curve 81            
  Simultaneous Equations 51      
  Sine and Tangent 166           
  Sorting 47                     
  Square Root 35                 
  Three-Dimensional Plotting 83
  Tower of Hanoi 42              
  322 Hz 26                      
  4-Colour Plot 88               
prompt 3                         
_218_
pseudo-random sequence 116       
PTR function 151                 
puff pastry recipe 19            
PUT statement 67, 151            
                                
query (?) operator 15, 53, 97
quotation mystery 60             
quoted strings 57                
quotes in PRINT statement 12     
                                
RAD function 164                 
RAM block zero 168               
  memory faults 92               
Random Coloured Lines program 168
random delay 38                  
  music 115                      
Random Noise program 116         
random number seed 152           
  numbers 24                     
Random Rectangles program 80     
  walk program 65                
Reaction Timer program 37        
READ equivalent 63               
reading and writing data from
    BASIC 67                     
  and writing speed of 70        
  numeric data 64                
  text 63                        
recipe analogy 17                
  apple tart 20                  
  puff pastry 19                 
  sponge cake 17                 
recipes subroutines in 20        
RECORD TAPE message 9, 68, 141
recursion in BASIC 42            
recursive subroutine calls 42
references backward 172          
  forward 172                    
registers index 107              
registers:                     
  accumulator A 122              
  index X 107, 122               
  index Y 107, 122               
  program counter PC 122         
  stack pointer SP 122           
  status S 122                   
relational expression 143       
  operators 29                   
REM statement 24, 152            
remainder (%) operator 11, 158
Renumber program 136            
renumbering programs 136         
  using screen memory 136       
Replace program 123              
representation of matrices 51
REPT (repeat) key 6, 194         
reset 6                          
return 132, 155                 
    character 59                  
RETURN key 6                    
  statement 39, 152              
REWIND TAPE message 10, 140      
right-string extraction 61       
RND function 24, 152             
ROL instruction 116, 188         
ROM extension 161                
  memory faults 92               
Roman Numerals program 123       
root of equation 41              
ROR instruction 116, 188         
rotate instructions 115          
Rotating Rectangle program 28
rounding 13                      
routines in different text spaces
    135                          
  input/output 191               
  operating-system 191           
routines:                        
  OSRDCH 102, 191                
  OSWRCH 102, 191                
RS code 132                      
RTI instruction 188              
RTS instruction 188              
RUN command 141                  
  statement 23, 135, 152         
                                
Saddle Curve program 166         
SAVE command 139, 140            
  statement 9, 135, 139, 152      
saving data on cassette 68       
  programs or text on tape 8      
SBC instruction 102, 189         
screen clear 6                   
  control codes 65                
  editing 132                     
  editing keys 133                
  end 132                         
  format for graphics 27          
  mapping 134                     
  memory 15                       
  memory renumbering using 136
  noise on 168                    
  poking to 16                    
  scrolling 6                     
  start 131                       
scrolling screen 6               
SEC instruction 102, 189         
SED instruction 189              
seed random number 152           
SEI instruction 189              
separator space as 155           
service programming 93           
SGET statement 68, 152           
SGN function 164                 
Shell sort 47                    
shift instructions 115           
SHIFT key 5, 131, 140, 194       
SHUT statement 152               
SI code 132                      
Sierpinski Curve program 81      
_219_
signal sync 194                    
signals cassette-interface 194     
Simultaneous Equations program 51
simultaneous equations solving 51
SIN function 164                   
Sine and Tangent program 166       
SO code 132                        
solving simultaneous equations 51
sort Shell 47                      
Sorting program 47                 
space as separator 155             
spaces in BASIC programs 74        
special characters printing 64     
speed of graphics 85               
  of reading and writing 70         
sponge cake flowchart 18           
  recipe 17                         
SPUT statement 67, 153             
SQR function 165                   
Square Root program 35             
STA instruction 98, 189            
stack pointer SP register 122      
statement abbreviations 73         
  delimiter 14                      
  terminator (;) 156                
statements:                        
  BPUT 67, 144                      
  CLEAR 28, 79, 144, 167            
  COLOUR 167                        
  DIM 45, 57, 145                
  DO 145                           
  DRAW 28, 80, 145                 
  END 145                          
  FOR 33, 146                      
  GOSUB 39, 135, 147               
  GOTO 25, 135, 147                
  IF 148                           
  IF...THEN 2S                     
  INPUT 23, 58, 148                
  LET 74, 148                      
  LINK 100, 149, 173               
  MOVE 28, 80, 149                 
  NEXT 33, 149                     
  QlD 150                          
  PLOT 79, 150                     
  PRINT 11, 150                    
  PUT 67, 151                      
  REM 24, 152                     
  RETURN 39, 152                   
  RUN 23, 135, 152                 
  SAVE 9, 135, 139, 152            
  SGET 68, 152                     
  SeUT 152                         
  SPUT 67, 153                     
  UNTIL 153                       
  WAIT 37, 153                     
status flags 122                   
  S reg ister 122                  
status-reg ister flags 181         
STEP connective 34, 153            
step size in FOR...NEXT loop 34
stopping a BASIC program 24     
stored text executing 23        
storing text 6                  
STR statement 163               
string ($) operator 57, 157     
  assignment 58                  
  equality 58                    
  functions 58                   
  input 58                       
  length of a 59                 
  manipulations 59               
string right 143                
string variables 57             
string-to-number conversion 165
strings arrays of 62, 63        
  concatenation of 61            
  dimensioning 57                
  in BASIC 57                    
  printing 12, 58                
  quoted 57                      
STX code 131                    
  instruction 107, 189           
STY instruction 107, 190        
subroutines in BASIC 39         
  in recipes 20                  
  uses of 40                     
subscript checking for arrays 50
substrings 61                   
subtract (-) operator 11, 158
subtraction in assembler 102
successive approximation 35     
SUM error 10                    
suppressing assembly listing 173
switch using GOTO multi-way 26
switches in BASIC 26            
symbols flowchart 21            
sync signal 194                 
syntax definition 199           
  errors 91                      
                               
TAB equivalent 145              
TAN function 165                
tape errors 10                  
  saving programs or text on 8
TAX instruction 109, 190        
TAY instruction 109, 190        
teletype mode l31               
temperature conversion 23       
testable expression 143         
testing high-fidelity equipment
    116                         
  memory 92                     
  points in graphics 87         
text editing 7                  
  files 9                       
text space lower 168            
  upper 168                     
text spaces changing 135        
  routines in different 135     
_220_
text storing 6               
text-space pointer 135       
three-dimensional curve 84
  plotting 83, 166           
Three-Dimensional Plotting
    program 83               
timing BASIC lines 170       
  in BASIC 37                
TO connective 153            
tone generating 25           
TOP function 24, 153         
Tower of Hanoi program 42
trapping errors 137          
trigonometrical functions 163
true logical value 31        
TSX instruction 190          
turn on/off cursor 16        
two-pass assembly 172        
TXA instruction 110, 190     
TXS instruction 190          
TYA instruction 110, 190     
typewriter mode 131          
                            
unitialised variables 91     
unnamed files 139            
UNTIL statement 153          
upper text space 168         
                            
VAL function 165             
variables A to Z 12          
  floating-point 165         
  logical 31                 
  string 57                  
  unitialised 91                 
VDU 133                          
vectors call by reference using
    54                           
  in BASIC 45                    
  interrupt 193                  
  of vectors 56                  
  operating-system 193           
versatile interface adapter 169
vertical tab 132                 
VIA 169                          
  timers 170                     
visual display unit 133          
VT code 132                      
                                
WAIT statement 37, 153           
what to do if baffled 91         
word indirection (!) operator 53,
    156                          
word vectors 53                  
writing a BASIC program 23       
  to port 170                    
                                
zero flag 106, 108, 122          
zero-page addressing 119         
zero,X addressing 120            
zero,Y addressing 120            
                                
322 Hz program 26                
                                
4-Colour Plot program 88         
                                
6520 processor 98                
_221_