Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

21 then the computer will regard that as instruction number 10 and it will not do it immediately, but expect other instructions to follow. Instruction number 10 is usually referred to as line 10. Again: if there is a line number then the statement is part of a program; if there is no line number then it is a command which the computer must obey immediately. When you have given the computer a set of instructions and you then want it to carry them out, you type the word RUN on the keyboard. The computer will then carry out the instructions that you asked it to do one at a time and in line- number order. In other words, it will ‘execute’ the program that you have typed in.

Just to check that you have got the idea of what is going on, here is a small program that you can type in. 10 REPEAT 20 PRINT "GIVE ME A NUMBER"; 30 INPUT B 40 PRINT "12 TIMES ";B;" IS ";12*B 50 UNTIL B=0 When you RUN the program line 20 will print the message GIVE ME A NUMBER Line 30 will print a question mark on the screen and wait for you to type in a number (followed by RETURN – as usual). The number you type in will become the value of the variable ‘B’. on the screen. Line 40 will first print the words 12 TIMES followed on the same line by the number you typed in, followed on the same line by the word IS followed by the result of the calculation.

The semi-colons tell the computer to print the next item on the same line as the previous one and right up against it. Line 50 sends the computer back to line 10 unless B=0, when the program will stop. Another way of stopping the program is to press the ‘panic button’ which is marked ESCAPE (it’s at the top left of the keyboard). If the computer seems to be ignoring you because it’s too busy running a program. You can nearly always get its attention by pressing the ESCAPE key. When you do that it will stop running your program and print a > prompt to show that it has stopped the program and is waiting for your command. When the computer shows a > it is in command mode.

You can change your program, give it commands for immediate execution, or tell it to RUN the program (in its memory) again. It doesn’t forget a program when you press ESCAPE .