LMC Conditional Structures

GCSE Computer Science Resources
14-16 Years Old

48 modules covering every Computer Science topic needed for GCSE level, and each module contains:

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module
View the GCSE Resources →

KS3 Computing Resources
11-14 Years Old

We’ve created 45 modules covering every Computer Science topic needed for KS3 level, and each module contains:

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module
View the KS3 Resources →

The following program will show the use of branch instructions to create an IF/ELSE/ENDIF conditional structure in a program.

Running the program: when prompted, INPUT two numbers, if they are different then the program will OUTPUT a 0 (FALSE) and if they are the same then the program will OUTPUT a 1 (TRUE),

NOTE: The 'if' label has no function and is added to aid clarity.

INP
STA value1
INP
SUB value1
if BRZ else
   LDA false
OUT
BRA endif
else LDA true
OUT
endif HLT
value1 DAT
true DAT 1
false . . .

This content is restricted to subscribers