AT&T 6300 Programmer's Manual page 636

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

Advanced Features
Observe the following rules when coding a
subroutine:
• The called routine must preserve segment
registers DS, ES, SS, and BP. If interrupts are
disabled in the routine, they must be enabled
before exiting. The stack must be cleaned up
on exit.
• The called program must know the number
and length of the arguments passed. The
following routine shows an easy way to
reference arguments:
push
BP
mov
BP,SP
add
BP, (2*number of arguments)+4
Then:
argument 0 is at BP
argument 1 is at BP-2
argument n is at BP-2*n
(number of arguments=n+
1)
• Variables may be allocated either in the Code
Segment or on the stack. Be careful not to
modify the return segment and offset stored on
the stack.
B·lO

Advertisement

Table of Contents
loading

Table of Contents