
Some programming techniques 75
the pointer is reduced by 2. This method allows subroutines to be
nested to an arbitrary depth, so long as enough stack space is available.
In any program that is to use subroutines, the designer must allocate
space for the stack. The number of cells needed
is
strictly twice the num-
ber of subroutine 'levels', but it is always wise to allow a substantial
extra number in case any new subroutines are ever used at a later date.
A stack of 50 cells is enough for most programs. It can be declared,
amongst other data items, by a sequence like:
STACKBOTTOM: 0 t THIS DECLARES THE LOWEST CELL IN
t THE STACK
. = .+48 t