27220 Parallax Inc, 27220 Datasheet - Page 22

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
BRANCHING – REDIRECTING PROGRAM FLOW
A branching instruction is one that causes the flow of the program to change from its
linear path. In other words, when the program encounters a branching instruction, it
will, in almost all cases, not be running the next [linear] line of code. The program
will usually go somewhere else, often creating a program loop. There are two
categories of branching instructions:
instructions, GOTO and GOSUB that cause unconditional branching.
Here’s an example of an unconditional branch using GOTO:
We call this an unconditional branch because it always happens. GOTO redirects the
program to another location. The location is specified as part of the GOTO instruction
and is called an address. Remember that addresses start a line of code and are
followed by a colon (:). You’ll frequently see GOTO at the end of the main body of
code, forcing the program statements to run again.
Conditional branching will cause the program flow to change under a specific set of
circumstances.
construct.
specifically to redirect program flow to another point based on a tested condition.
Take a look at this listing:
In this example, statements 1- 3 will run at least once and then continue to run as
long as the condition evaluates as True. When required, the condition can be tested
prior to the code statements:
Label:
Start:
statement 1
statement 2
statement 3
GOTO Label
statement 1
statement 2
statement 3
IF (condition) THEN Start
PBASIC includes two distinct versions of IF-THEN; the first is used
The simplest conditional branching is done with an IF-THEN
unconditional
and
conditional
. PBASIC has two

Related parts for 27220