Tandy 1000 Basic Reference Manual page 107

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10
I
BASIC Keywords
CALL
Statement
CALL variable [(parameter list)]
Transfers program control to an assembly-language subroutine
stored at
variable.
Variable
contains the offset into the current segment where the
subroutine starts in memory.
Variable
may not be an array vari-
able. The offset must be on a 16-byte boundary.
Parameter list
contains the variables that are passed to the ex-
ternal subroutine. The number, type, and length of the parame-
ters being passed must match with the parameters expected by
the assembly-language subroutine.
If you omit
parameter list,
BASIC executes an 8086 CALL in-
struction. Your assembly-language subroutine should return with
a simple RET instruction.
When you execute a CALL statement, BASIC transfers control to
the subroutine through the address given in the last DEF
SEG
statement and the segment offset specified by
variable.
See the
section "Interfacing With Assembly-Language Subroutines" in
Chapter 11 for more details.
Example
1 0 0
I = 4 5
:
J = 1 0 0
:
K
=
5 5
1 1 8 MYROUT
=
A H 0 8 8 8
1 2 0 DEF S E G
=
A H 1 7 0 0
1 2 0 CALL M Y R O U T C I , J , K )
The subroutine, MYROUT, begins at offset 0 in the segment
that begins at 1700. The values of I, J, and
K
are passed to the
routine.
105

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents