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.
if BRZ else
else LDA true
true DAT 1
false . . .
This content is restricted to subscribers