Tandy 1000 Basic Reference Manual page 353

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 11
TECHNICAL INFORMATION
This chapter provides various information of a technical nature.
If you are just beginning to use BASIC, you may want t o skip
this chapter until later.
Interfacing with Assembly-Language
Subroutines
This section is for users who call subroutines written in other
languages from their BASIC programs. BASIC provides for inter-
facing with subroutines through the
USR
function and through
the CALL and the CALLS statements.
You can load your assembly language subroutine into BASIC's
work area or into another segment of memory. We will show you
both methods.
Memory Allocation Outside BASIC's
Work
Area
When you load BASIC, the DS (data segment) register is set to
the address of BASIC's work area. To access an area of memory
outside this work area, execute a DEF SEG statement to specify
the address of the segment of memory you are accessing. If you
don't execute a DEF SEG statement, your CALL, CALLS, or
USR
statements transfer control to a n area within BASIC's work
area. After returning from the subroutine, execute another DEF
SEG statement to restore the DS register to its original value.
See DEF SEG in Chapter
10
for more information.
Memory Allocation Inside BASIC's
Work
Area
To set aside memory space for a n assembly language subroutine
within BASIC's work area, use the
IM:
switch when you load
BASIC. See Chapter 2 for a review
of
the start-up procedure.
351

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents