EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #356 background imageLoading...
Page #356 background image
Chapter
11
I
Technical Information
When the CALL statement is executed, the operating system
loads the CS (code segment) register with the value specified in
the last DEF SEG statement. If you are CALLing a subroutine
within BASIC’s work area, and no DEF SEG is required, the CS
register is loaded with the address of BASIC’s work area. This
address
is
shifted left
4
bits;
in
other words, which
is
the same
as multiplying it by 16 decimal (10 hexadecimal). Then, the
off-
set of the subroutine is added to the segment address.
Example
17100
+
0020
=
17120
17120 is the absolute address of the first instruction in the
subroutine.
Technical Functions
The called routine may destroy the previous contents of all regis-
ters.
If
you want to save the contents of the registers, the first
instructions in the subroutine must be
a
PUSH
for
each register,
and the last instructions in the subroutine must be a POP to re-
store the registers to their original value. You must execute a
POP for every PUSH
to
maintain stack integrity.
The subroutine may refer to the passed parameters as positive
offsets to the Base Pointer (BPI. The CALLed routine must
PUSH BP on the stack and then move the current stack pointer
into BP. BP should be the first register you PUSH
so
that the
parameters may be referenced as an offset
to
BP. The first
4
bytes of the stack contain the IP and CS register values that
BASIC saves when the CALL
is
executed. To calculate the pa-
rameters offset from the BP, use this equation:
2
*
(total parameters
-
parameter position)
+
6
=
offset
For example, the address of parameter
1
is at 10(BP), parameter
2 is at S(BP), and parameter
3
is at 6(BP).
354

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals