Radio Shack EC-293 Technical Information Page 21

  • Download
  • Add to my manuals
  • Print
  • Page
    / 42
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 20
TECHNICAL INFORMATION
25 mS Heartbeat Interrupt
A clock circuit in the Expansion Interface provides an
Interrupt
to
the Z-80,
40
times each second. When such an
Interrupt
is received,
the Z-80 gets instructions from ROM telling it to
go
to
a specific
RAM
address for further instructions. Normally, these
"further
instructions" simply tell the Z-80
to
return from the interrupt
sequence and continue where it left off.
If
you
have enough experience with the Z-80 Instruction Set (and
with assembly-language programming in general),
you
can link up an
Interrupt Service Routine which accomplishes some simple fore-
ground task before it returns control
to
the interrupted program.
For
example,
you
can set up a real-time clock which keeps time
regardless
of
what
the
current program is - BASIC command mode,
BASIC program execution, machine-language routine, etc. Here's
how it's done:
1.
Write an
Interrupt
Service Routine
to
a. Disable Interrupts
b. Read FDC status register 37ECH
to
clear it
c. Read
Interrupt
Status in
37E0H
d. Increment
the
software clock
counter
e. Read from 37E0H again to reset
Interrupt
Latch
f.
Enable Interrupts
g.
Return
to
interrupted program
2. Disable Interrupts
3. Replace the
Interrupt
Default link at
4012H
- 4014H with a
jump
to
your
Service Routine
4. Enable Interrupts
to
turn on the clock
Here's a BASIC program which POKES the necessary code
into
addresses
32680
- 32767. Note: Before using this program, reset
your
TRS-80 and answer MEMORY SIZE with
the
number
32679.
Note: This program
is
for
LEVEL II only.
Don't
try
to use
it
with
DISK BASIC (use the TRSDOS clock instead!).
20
Page view 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 41 42

Comments to this Manuals

No comments