LMC Branching – Instructions To Implement Decisions

46 Computer Science Topics

We’ve created 46 modules covering every Computer Science topic needed for GCSE level. These are transferable across AQA, CIE, Edexcel, CIE & Internationally. Suitable for teachers or home educators alike.

Whether you’re a brand new Computer Science teacher, or you’ve been teaching ICT for years, our resources will save you hours and hours of lesson preparation every single week.

View the resources →

The following program will demonstrate the use of the three branch instructions: BRZ, BRP and BRA.

Running the program: INPUT a number and the program will OUTPUT a sequence of numbers, starting at 1 and finishing with the INPUT number. The program will continue until a 0 is entered.

start LDA zero
STA count
BRZ finish
STA maxNumber
loopTop LDA count
ADD step
STA count
SUB maxNumber
BRP endLoop
BRA loopTop
endLoop BRA . . .

This content is restricted to subscribers