6
Programming
Techniques
Chapter 5 covered the basics of programming. This chapter delves
into more sophisticated but useful techniques:
•
Using
subroutines to simplify programs by separating and labeling
portionsof the program that are dedicated to particular
tasks.
The
use of subroutines also shortens a program that must perform a
series of steps more than once.
•
Using
conditional instructions
(comparisons
and
flags)
to determine
which instructions or subroutines should be used in a particular
case.
•
Using
loops
with
counters
to
execute
a set of instructions a certain
number
of
times.
•
Using
indirect addressing to
access
different
variables
using the
same program instruction.
Routines
in
Programs
A
program
is
composed
of
one
or
more
routines.
A
routine
is a
func
tional unit that
accomplishes
something
specific.
Complicated
programs
need
routines
to
group
and
separate
tasks.
This
make§,
a
program
easier
to
write,
read,
understand, and
alter.
90
6:
Programming
Techniques