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 #355 background imageLoading...
Page #355 background image
Chapter
11
I
Technical Information
Poking
a
Subroutine into Memory
You can code short subroutines in machine language and use the
POKE
statement
to
put the code into memory.
To
do
so,
follow
these steps:
1.
Code the machine language instructions
for
your subroutine.
2.
Put the assembly instruction code
for
each byte
of
the ma-
chine language code into DATA statements, preceded by the
&H
symbols
to
denote that they are hexadecimal values.
Execute
a
loop that reads the DATA statements and POKES
them into an area
of
memory.
3.
For example, the instruction code
for
the statement
PUSH
BP
is
55.
The DATA statement
for
that instruction is
DATA
&H55
After the loop is complete, the subroutine is in memory. Whether
you are using the
USR
function
or
the CALL statement
to
call
the subroutine, you must set the value
of
the subroutine entry
point as the location specified in the first POKE statement.
CALL
Statement
When the CALL statement is executed, the following occurs:
1.
For each parameter in the parameter list, the two-byte offset
of
the parameter’s location within the data segment
(DS)
is
pushed onto the stack. If the parameter is a string variable,
the offset points to the
string descriptor.
See the section
“Ac-
cessing String Parameters” in this appendix.
The BASIC return address code segment (CS) and offset (IP)
are pushed onto the stack.
Control is transferred
to
the subroutine by an
8086
long call
to
the segment address given in the last DEF SEG state-
ment and the offset given in
uariabk.
2.
3.
353

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