Jump Instructions and
Subroutine Programming
Chapter 11
1113
Figure 11.10
(a) Three Levels of Nested Subroutines
(b) A Subroutine Can Call Itself or Loop
Subroutine
Level 1
Subroutine
Level 2
Subroutine
Level 3
( JSR )
( RET )
( JSR )
( RET )
( RET )
02
03
( JSR )
01
Main
Program
LBL
01
LBL
02
LBL
03
a
b
c
d
e
f
Subroutine Area
(A.)
LBL
( SCT )
01
051
| / |
15
( JSR )
051
01
PR 999
AC 000
( JSR )
01
Main
Program
Subroutine Area
(B.)
( CTR )
051
PR 009
AC 000
( RET )
Your Subroutine
End XXXXX
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com