EMAC PRIMER Instruction Manual page 65

Table of Contents

Advertisement

s you can see, a subroutine CALL acts like a user-defined op code. A subroutine can perform a task without changing the
registers, as in the program above, or it can change the registers according to the rules that you define when writing the
subroutine. For example, you could write a subroutine that would take the value of the B register and multiply it by the C
register and return the result in the BC register. Programmers usually have a library of useful subroutines like this which
can be included in their programs.
Subroutines can also make CALLs to other subroutines, and those subroutines can call others and so on. The only limit is
the amount of memory the stack can use.
65

Advertisement

Table of Contents
loading

Table of Contents