For an example with N = 256,
CC
=
.32
f.Lsec
at
3.125
MHz;
Byte time
= 6.7
f.Lsec.
A match search routine with minimum
memory usage
is
given below:
Search Cmp M compare byte
RZ
return if match
INX
H else increment pointer
OCR
C has the entire
JNZ search
block been searched?
STC
If
so
set
no
match flag
RET
and
return.
In
this application, a user may want to
have
several tempera-
ture ranges which can be swapped
in
and
out with a block
move subroutine. Similar code can be developed for this as
shown
below for a 4 byte move group:
BLKMV
LXI
H,
OOOH
clear HL
Loop
DAD
SP move SP
to
HL
SHLD SAVESP save
sP
MOV
H,
B move Block move
MOV
L,
C Source address
SPHL
To
SP
XCHG Move Block move
POPB
POP 0
MOV
M,
C
INX
H
MOV
M,
B
INX H
MOV
M,
E
INX H
MOV
M.
0
INX
H
OCR
A
JNZ Loop
LHLD
SAVESP
SPHL
RET
address
to
HL
fetch four bytes from
source store
1st
byte
at
destination
2nd
3rd
4th
check for end of
Block move
return
old
SP
return
Once the count less than match
is
found
in
the application the
HL register has
10
added
to
it
which points it at the corre-
sponding temperature
(lines 79-82). This temperature
is
then
displayed
in
the address field
of
the SDK 85 display using
user
available monitor routines.
If
the temperature is out of
range the code detects
it
(lines 69-74) and outputs
1's
on
Port
A or Port B if the temperature was too
low or too high respec-
tively (lines
101-105
"too low"
and
lines
108-112
"too high").
A1-31