Tandy 1000 Basic Reference Manual page 140

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I
BASIC
Keywords
DEF SEG
Statement
DEF SEG[
=
address]
Assigns the current segment address. The segment address is
used by BLOAD, BSAVE, CALL, PEEK, POKE, and
USR.
Address
is a number in the range 0 to 65535, and may be speci-
fied as an integer or a hexadecimal value. If you specify a num-
ber outside this range, BASIC returns an "Illegal function call"
error and uses the previously set address. If you omit
address,
BASIC sets the current segment address t o its data segment
(DS).
If you specify
address,
do so on a 16-byte boundary. BASIC
shifts the value to the left
4
bits, which is the same as multiply-
ing it by 16 decimal (10 hexadecimal).
Note: BASIC does not check the validity of the result-
ant segment
+
offset address.
When you load BASIC, the data segment
(DS)
register is set t o
the address of BASIC's workspace. You must, therefore, execute a
DEF SEG statement before executing BLOAD, BSAVE, PEEK,
POKE, USR, or CALL (unless you used the
/M:
switch when you
loaded BASIC). Without the DEF SEG statement or the
i M :
switch, BASIC's workspace could be destroyed.
If you execute a DEF SEG to change the DS register, you must
execute another DEF SEG to restore the DS register
t o
BASIC's
data segment (DS).
Separate DEF and SEG with a space. Otherwise, BASIC inter-
prets it as the variable DEFSEG.
138

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents