- Subroutine is
a program unit that
can be called (= invoked)
from anywhere in the computer program
- As you will see soon, a
subroutine will
consist of a sequence of
assembler instructions
without any special structure
--- just like the
main program that
you have been writing so far in assembler....
- The start
(= the first instruction)
of the subroutine is
marked with a
label --
this label is
always
the name of
the subroutine
|
- When a subroutine is
called (= invoked),
the program execution is
transfered to
the instructions that
comprise the subroutine
- Program execution will
continue in the
subroutine until
the subroutine
returns
- When the subroutine
returns,
the program execution will
continue
at the next statement
after
the subroutine call instruction
|