CALIFORNIA STATE UNIVERSITY, NORTHRIDGE
8085 BASED PH CONTROLLER
A graduate project submitted in partial
satisfaction of the requirements for
the degree of Master of Science in
Electrical Engineering
by
Sirisak Adulratananuwat
January 1987
The graduate project of Sirisak Adulratananuwat is
approved:
( 6ZhflG:arrera)
California State University, Northridge
ii
{\
TABLE OF CONTENTS
PAGE
CHAPTER
INTRODUCTION
CHAPTER 2
SPECIFICATIONS
CHAPTER 3
OPERATION ·
CHAPTER 4
CHAPTER 5
3
3.1 INTRODUCTION
4
3.2 DISPLAY AND INDICATORS
4
3.3 KEYBOARD
6
3.4 DEADBAND
7
3.5 TIME DELAY
7
3.6 TEMPERATURE COMPENSATION
8
3.7 OPERATIONAL PROCEDURES
8
HARDWARE DEVELOPMENT
4.1 MICROPROCESSOR
12
4.2 EPROM
12
4.3 RAM, I/0, TIMER
12
4.4 A/D CONVERTER
14
4.5 KEYBOARD/DISPLAY INTERFACE
16
4.6 1 OUT OF 8 BINARY DECODER
17
4.7 ANALOG SECTION
17
4.8 POWER SUPPLY
18
SOFTWARE DEVELOPMENT
5.1 MAIN PROGRAM
19
5.2 KEY INPUT INTERRUPT SUBROUTINE
24
5.3 DISPLAY SUBROUTINE
24
iii
.
,,
CHAPTER 6
5.4 CALCULATION SUBROUTINE
29
5.5 DIVISION SUBROUTINE
29
5.6 MULTIPLICATION SUBROUTINE
32
5.7 BINARY TO BCD SUBROUTINE
32
5.8 BCD TO BINARY SUBROUTINE
35
5.9 A TO D SUBROUTINE
35
PERFORMANCE EVALUATION AND CONCLUSIONS
6.1 PREFORMANCE EVALUATION
37
6.2 CONCLUSIONS
37
REFERENCES
38
APPENDIX A.
39
APPENDIX B.
44
iv
LIST OF TABLES
PAGE
TABLE 1
PROBE OUTPUT CHANGE AS A FUNCTION OF
THE TEMPERATURE AND PH FACTOR
v
9
LIST OF FIGURES
PAGE
FIGURE 3. 1
INSTRUMENT PANEL
FIGURE 4. 1
MEMORY AND I/0 MAPPING
13
FIGURE 5. 1
MAIN PROGRAM
20
5
FIGURE 5.2A KEY INPUT ROUTINE FLOW CHART A
25
FIGURE 5.2B KEY INPUT ROUTINE FLOW CHART B
26
FIGURE 5.3
DISPLAY ROUTINE FLOW CHART
27
FIGURE 5.4
CALCULATION ROUTINE FLOW CHART
28
FIGURE 5.5
DIVISION ROUTINE FLOW CHART
30
FIGURE 5.6
MULTIPLICATION ROUTINE FLOW CHART
31
FIGURE 5.7
BINARY TO BCD ROUTINE FLOW CHART
33
FIGURE 5.8
BCD TO BINARY ROUTINE FLOW CHART
34
FIGURE 5.9
A TO D ROUTINE FLOW CHART
36
vi
ABSTRACT
8085 BASED PH CONTROLLER
by
Sirisak Adulratananuwat
Master of Science in Electrical Engineering
The purpose of this project was to design a 8085 based
pH controller.
This instrument has a capability to measure
and control pH levels of solutions for industrial
applica-
tions.
The
digital
list
display
of features includes a
keyboard
of the measured pH level,
high
input,
and
a
low
limit relays for pumps, calibration for a pH probe, automatic
and
manual temperature
compensation,
deadband, and an adjustable time delay.
vii
an
adjustable
CHAPTER 1
INTRODUCTION
It is often necessary to measure and control pH levels
of waste water, pools, chemicals process streams, and other
effluent
probe
conditions common to the industrial sector.
is used to sense the pH levels and
produces
output
voltages.
Since
ture,
must be compensated according to the temperature
it
the output varies linearly with
A pH
tempera-
reading.
The purpose of this project was to design a controller
for measuring and .controlling the pH levels by using the pH
probe as an input sensor. The controller turns the power on
to
a pump to introduce neutralizing solution whenever
the
pH
level
set
limit.
the
of
the solution being monitored exceeds
a
The time delay provides a safety feature that warns
operator of a system malfunction when the pH level
is
not adjusted within a predetermined time limit. When either
set
point
is exceeded,
neutralizing
the timer
is
actuated.
If
the
solution does not produce the expected change
in pH within the acceptable limit,
an alarm is provided to
warn the operators and the power to the pump is turn off.
The development of this instrument is described in six
chapters.
The
The
specifications are presented in Chapter
operations are explained in detail in Chapter
hardware
development
is
discussed
1
in
Chapter
3.
4.
2.
The
The
2
software
presented
Chapter 6.
development is discussed and the flow charts
in
Chapter 5.
The conclusions
are
stated
are
in
Finally, the block diagram, the schematic diag-
rams, and the program listings are presented in appendices.
Q '
Q
CHAPTER 2
SPECIFICATIONS
Design
requirements of the instrument are
summarized
as following:
Range
2 pH to 12 pH.
Resolution
0 •0 1
Accuracy
.± 0.01 pH.
Display
4 digit numeric,
1
pH.
digit alphanumeric,
3 LED indicators for pump
high, pump low, and alarm.
Dead band
0.01 pH to 5.00 pH.
Time delay
1 minute to 99.99 minutes.
Temperature compensation
manual or automatic
0.00
0
C to 99.99
0
C.
Relay contact rating
SPDT, 10 A 120 VAC.
Power requirements
120 VAC, 60 Hz.
Operating temperature
0
3
0
C to 55
0
C.
•
CHAPTER 3
OPERATION
3.1
INTRODUCTION
An instrument panel has a 4-digit display, a mode dis-
play,
a 8-key keyboard, and 3 LED indicators. A picture of
the panel is shown in Figure 3.1.
3.2
DISPLAY AND INDICATORS
The
4-digit displays the value corresponding
to
the
mode-display. A decimal point between the second digit and
the
third digit will always light up when power is on.
In
the
run mode,
4-
digit
the mode-display displays blank and the
displays the pH value of the solution (range
2.00 pH to 12.00 pH ).
from
There are 5 different display modes
as following:
1. Mode F, the mode-display displays a letter "F" and
the
4-digit
displays
the high
limit
set
point
(range from 2.00 pH to 12.00 pH).
2. Mode L, the mode-display displays a letter "L" and
the 4-digit displays the low limit set point (range
from 2.00 pH to 12.00 pH).
3. Mode C, the mode-display displays a letter "C" and
the 4-digit displays the temperature for manual
temperature
99.99
0
compensation (range from 0.00
C).
4
0
C to
5
4
"Dl~rLFIY
-5JI(:d 1
.
L __ _ _ _ _ _ _ _ _ _ _ _ _ __
I
D
~GJW~
[]]IT_] [I]~
ON
ON
d rll
Off
M~1N
FIG. 3.1
Off
f.UTO
B
MANUAL
~Lf''($
INSTRUMENT PANEL
0
PUM'P HIGH
0
PUMP Lov-J
D
1\LAR..M
6
4. Mode 0, the mode-display displays a letter "O" and
the 4-digit displays the deadband (range from 0.01
pH to 5.00 pH).
5. Mode E, the mode-display displays a letter "E" and
the 4-digit displays the time delay (range from 1
minute to 99.99 minutes).
3 LED indicators,
for pump high, pump low, and alarm,
light up when the corresponding relay is energized.
3.3
KEYBOARD
There
are 8 keys for programming and calibrating
the
pH probe as following:
1. Program
key
(P),
this key is used
to
enter the
program mode.
2. Mode select key (M), this key is used to change the
mode display in sequence from F-+ L.....
3. Digit
select key (S),
the digit for
from digit
this key is used to select
increment or
1~ 2
~ 3 -+4.
c.... o... E.
decrement in
The selected
sequence
digit
will
blink.
4. Run key (R), this key is used to enter the run mode
5. Increment key (t), this key is used to increase the
number of the blinking digit in sequence from
0~1-+2
---
~9.
6. Decrement key (t), this key is used to decrease the
number of the blinking digit in sequence from
7
o.... g ... 8-----+1.
7. Calibration key (C),
the
pH probe.
this key is used to calibrate
pH probe
The
before using because of
must be
calibrated
the different characteris-
tics.
8. Reset key
(RE),
this key is used
to reset and go
back to the beginning.
3.4
DEADBAND
A
deadband is the pH value which is added to the
low
limit set point or subtracted from the high limit set point
to
determine
off.
the
the pH level which the pump will
For example,
be
turned
if the deadband is set at 0.50 pH,
low limit set point and
and
the high limit set point
set at 8.00 pH and 11.00 pH respectively,
if the pH
are
level
of the solution is higher than 11.00 pH, the pump high will
be
turned on to add the acid solution.
turned
off when the pH level of the solution is less
10.50 pH.
tion
This pump will
On the other side,
is less than 8.00 pH,
to add the alkaline solution.
be
than
if the pH level of the soluthe pump low will be turned on
This pump will be turned off
when the pH level of the solution is higher than 8.50 pH.
The deadband is adjustable from 0.01 pH to 5.00 pH.
3.5
TIME DELAY
A time delay provides a safety feature that warns
the
8
operator
of a system malfunction when the pH level is
adjusted
within the predetermined time limit.
set point is exceeded,
ralizing
the
not
When either
the timer is actuated. If the neut-
solution does not produce the expected change
pH level within the period of time
delay,
the
in
alarm
will be turned on and the pump will be turned off.
The time delay is adjustable from 1.00 minute to 99.99
minutes.
3.6
TEMPERATURE COMPENSATION
For automatic temperature compensation, a pH/RTD probe
will be used. The 1000nRTD element (Resistance Temperature
Detector) is a thin film platinum chip that is embedded
in
the body of the pH probe. It is a stable temperature device
that
has
the
same
time response as
the
pH
probe
to changes in temperature as
shown
and
responds
linearly
in
Table 1.
For manual temparature compensation, a regular pH
probe
will be used and a 1000n fixed resistor is used
in
place
of
to
measure
this
the
temperature sensor.
The
operator
has
the actual temperature of the solution and program
temperature into the unit.
The compensation will
be
done by the software.
3.7
OPERATIONAL PROCEDURES
Upon
power up,
the unit goes into the run
order to prevent any misoperation,
mode.
the following data
In
are
9
TABLE 1
PROBE OUTPUT CHANGE AS A FUNCTION OF
THE TEMPERATURE AND PH FACTOR
25 °C
50 "c
100 °C
mV
mV
mV
mV
2
+270.3
+295.8
+320.2
+370.2
3
+216.8
+236.6
+256.5
+296.1
4
+162.6
+177.5
+192.4
+222.1
5
+108.4
+118.3
+128.2
+148.1
6
+ 54.19
+ 59.15
+ 64.12
+ 74.03
0 °C
TEMP
PH
7
(
0
0
0
0
8
- 54. 19
- 59. 15
- 64.12
- 74.03
9
-108.4
-118.3
-128.2
-148.1
10
-162.6
-177.5
-192.4
-222.1
11
-216.8
-236.6
-256.5
-296.1
12
-270.3
-295.8
-320.2
-370.2
RTD
1000.0Jl
1094.9.Cl
'
1189.011
1375.0fl
10
pre-programmed.
The high limit set point (mode F)
12.00 pH
The low limit set point (mode L)
=
=
The temperature (mode C)
=
25.00
The deadband (mode 0)
=
The time delay (mode E)
=
To
given.
explain
how to operate this unit,
2.00 pH
°c
1 • 00 pH
99.99 minutes
an example
is
If we want to control the solution between 8.00
pH
and 11.00 pH, manual temperature compensation (the temperature
0
of the solution is 25 C)
,
the deadband is 0.50
pH,
delay is 5.00 minutes.
the time
1 • Connect the 1 ooo..n fixed resistor instead of the RTD
sensor and move the temperature compensation switch
to the manual position.
2. Turn the power switch to the on position.
3. Depress
the program key to enter the program mode.
The mode-display displays the letter "F".
4. Depress
the
digit select key,
the
first
digit
blinks.
5. Depress
change
the increment key or
the decrement key to
the number of the first digit and set it to
1•
6. Depress
the digit
select key,
the
second
digit
blinks.
7. Set
the display to 11.00 by using the digit select
key, the increment key, and the decrement key.
11
8. Depress
the mode select key (M),
the mode-display
displays the letter "L".
9. Follow step 4, 5, 6, 7 to set the display to 8.00.
10. Follow step 8 and 9 to set the display to 25.00 C.
11. Follow step 8 and 9 to set the display to 0.50 0.
12. Follow step 8 and 9 to set the display to 5.00 E.
13. Depress
the run key
to exit from the program mode
and enter the run mode.
14. Place the probe
press
in a
the calibration
7.0
buffer solution and de-
key.
The display
displays
7.00.
15. Place the probe in a
press
the calibration
10.0
buffer solution and de-
key.
The display
displays
10.00. If the operating range is below 7.00 pH, use
a
4.0
buffer solution instead of the
10.0 buffer
solution.
If
the temperature of the buffer solutions is
rent from the temperature of the solution,
diffe-
the calibration
of the probe has to be done first by programming the temperature of the buffer solution.
For automatic temperature compensation,
be the same except step 1 and step 10.
RTD
sensor
instead
all step will
In step 1,
of the fixed resistor
and
temperature compensation switch to the automatic
Omit step 10.
use the
move
the
position.
CHAPTER 4
HARDWARE DEVELOPMENT
4.1
MICROPROCESSOR
The
8085A
microprocessor is a single chip
channel microprocessor.
8-bit
N-
It has a built-in crystal oscilla-
tor circuit that requires only the connection of a parallel
resonant crystal for operation.
this
A 2 MHz crystal is used in
system and the crystal frequency is divided by two to
derive its basic clock cycle which is 1 MHz.
The
8212 which is 8-bit input/output port is used
as
the low address latch for EPROM 2716.
The 8085A performs the following functions:
AID converter,
from
calculate and display
data,
read data
display
keyboard data entries, control time delay, alarm and pumps.
All
these events are controlled by the software
pro-
gram discussed in detail in Chapter 5.
4.2
EPROM
The control program is stored in a 2716
8
bit
ultraviolet erasable and electrically
which is 2K x
programmable
read only memory (EPROM).
4.3
RAM, I/0, TIMER
The
bit RAM,
input data are stored in a 8155
I/0,
and Timer.
which is 256 x 8
I/O port A is programmed to
12
be
13
MEMORY MAPPING
0000 H
07FF H
ROM 2K x 8
0800 H
LBEN
AID LOW BYTE ADDRESS
1000 H
HBEN
AID HIGH BYTE ADDRESS
1800 H
KDATA
KEYBOARD DATA ADDRESS
1900 H
KCOM
KEYBOARD COMMAND ADDRESS
2000 H
20FF H
RAMST
STPTR
2100 H
FFFF H
NOT USED
(2716}
RAM 256
STACK
X
8
(8155}
I/0 MAPPING
0020 H
lOST
0021 H
PORT A
(OUT}
0022 H
PORT B
(IN}
0024 H
LTR
LOW BYTE TIMER REGISTER
0025 H
HTR
HIGH BYTE TIMER REGISTER
FIG 4.1
I/O STATUS ADDRESS
MEMORY AND I/0 MAPPING
14
PA5 for alarm, PA6 for pump high, and PA7 for
output port,
pump
I/0 port B is programmed to be input port,
low.
for
or auto switch,
manual
PB7 for status bit
from
PB6
A/D
converter.
A 14-bit programmable timer is also included on
the
Since the clock frequency of the 8085A is
chip.
high,
ICM7242
the
which is a long delay
time
very
generator
generates a low clock frequency for the timer in the
The frequency is given by f
=
1 /256RC. For
R
8155.
= 234Kn
, C
=
0.01j.lF.
1
=
f
X
10
3
256 X 234 X 0.01
=
1.699 Hz
The active low timer out from the 8155 is connected to
a
trap interrupt of the 8085A which is a nonmaskable
tart
interrupt and has the highest priority of any
resinter-
rupt.
4.4
A/D CONVERTER
The
A/D
converter
used in this project is
the
ICL
7109. It is a 12-bit A/D converter degigned for easy interface with microprocessors.
The 12 bit binary plus polarity
outputs can be directly interfaced to a microprocessor bus.
The ICL 7109 is in the direct mode when the
is
low.
parallel
In
this
interface
mode the output interface is
with a chip enable (CE/Load)
byte enables (HBEN and
LBEN).
mode
a
pin
simple
and
two
The least significant 8 bits
15
of data are enabled when both CE/Load and
eBEN are low. The
upper
enabled
4 bits of data,
and polarity are
whenever
CE/Load and HBEN are low.
A read performed while the data latches are undergoing
updates
will
lead to scrambled data.
One way of
solving
this problem is to read the status output as well. If it is
low,
a
the readidng is correct. If it is high, read the data
second
time after a delay of about
clock period.
half
a
converter
If the status is still high, the first read-
ing is correct.
If the status is now low, the second read-
ing is correct.
The frequency of the oscillator is determined by using
R&C of the correct values. When the oscillator select input
is
high or left open (the input is provided with an inter-
nal pullup resistor), and the internal clock will be of the
same
phase
and frequency as the signal
at
the
buffered
oscillator output. Oscillation will occur in the circuit at
a frequency given by f
= 0.45/RC.
For R
=
100 KI.l, C
= 70
pF.
9
0.45 X 10
f
= 64285
:
100 X 70
When
the
continuously
of
8192
64285 Hz
Run/HOld input is tied
high,
the
performs A/D conversions with a fixed
clock cycles per conversion.
For clock
Hz
ICL7109
length
cycle
=
16
Number of conversions per second
=
64285
= 7.8
8192
4.5
KEYBOARD/DISPLAY INTERFACE
The 8279 programmable keyboard/display interface is an
I/0
IC.
board
It provides a microprocessor interface to a
and
a
seven-segment
multiplexed display output for
displays.
key-
driving
LED
It drives external displays using
its four out lines (BO to B3). It receives information from
a keyboard via
scan
the three RL (RLO to RL3) lines.
The three
counter outputs (SLO to SL2) are used to control
keyboard
line being scanned and
also to
determine
the
which
display is being selected.
A
to
counter in a timing chain further divides the clock
provide the timing for keyboard
scan,
row
display
scanning.
control
that the microprocessor has to supply.
scan,
and
This effectively reduces the amount
of
The micro-
processor only has to communicate with the 8279 when a
key
has been pressed or when the microprocessor wants to change
the
data being displayed.
When the key has been
pressed,
the
8279 will send an interrupt signal to the microproces-
sor (restart interrupt 6.5).
The
decoder
74LS48
74LS156 dual 1 of 4 decoder is used as a 1
to scan the keyboard and select the
display.
of
8
The
BCD to seven segment decoder accepts 4-bit BCD data
~
.
17
from the 8279 and provides seven active high decoded output
to drive 7-segment displays (MAN 74A).
4.6
1 OUT OF 8 BINARY DECODER
The 8205 high speed 1 out of 8 binary decoder is
as
a
chip select decoder.
address
(A11
following
to A13),
chips:
It accepts a three bit
decodes,
the 2716,
and selects one
the 8155,
the 8279,
used
binary
of
the
or
the
7109.
4.7
ANALOG SECTION
The
cess
is
TLC27M4 quad operation amplifier is used to
an analog signal from the pH probe.
used as a buffer providing high
second
the
pro-
The first op amp
input
impedance.
The
op amp is used for zero adjustment (compensate
for
offset voltage at the input of the op amp).
op amp is used as a gain control for automatic
compensation.
Refer to Table 1,
The third
temperature
for pH2 solution,
the pH
0
probe
0
will generate 295.8 mV and 320.6 mV at 25 C and 50 C
respectively.
0
The resistances of RTD at 25 C
0
and 50 C are
1094.9fi and 1189.011.
0
at 25 C
1000 X 295.8
output voltage
:: 270.1 mV
::
1094.9
18
0
at 50 C
1000 X 320.6
output voltage
The
output
=
= 269.6
mV
change
with
1189.0
voltage is constant and does not
temperature.
For
resistor
manual temperature compensation,
a 1000A
is used instead of the RTD.
output
The
fixed
voltage
will change when the temperature changes. The software will
do the calculation compensate to this change.
4.8
POWER SUPPLY
The
power
supply
bridge
rectifier.
output
is
a
The
is a linear power
supply
input is a 120 VAC 60 Hz
+12 V unregulate.
The +12 V
regulator
converter
7109.
is
to generate +5 V.
An
and
unregulate
supplied to the coils of the relays and a LM317
voltage
ICL7660
the
is
voltage
to
zener diodes are used to generate ±2.5
supply to the TLC27M4.
a
adjustable
used to convert +5 V to ±5 V supply
LM336-2.5
with
the
V
CHAPTER 5
SOFTWARE DEVELOPMENT
In this chapter the software development is explained.
The assembly program listings are given in Appendix B.
control
software consists of one main program,
The
two inter-
rupt routines, and several subroutines.
Each
of them will be discussed separately
throughout
the chapter.
5.1
MAIN PROGRAM
The flow chart of this program is shown in Figure 5.1.
This
program
reset.
is
enabled by hardware
Before executing the program,
initialized.
reset
or
software
the system should be
System initialization consists of the follow-
ing.
1.
Initialization of
an
the 8279,
the display is to be
eight-digit display with left entry.
board will
be
The key-
scanned by the 8279 and the system
is to have two-key lockout. The clock frequency of
100 KHz yields
a keyboard scan time of 5 ms and a
keyboard debounce time
FIFO
status are cleared
of 10 ms.
The display and
and the interrupt output
line is reset.
2.
Initialization
of
the
8155, port
B is an input
port. Port A and port C are output ports.
19
/_
20
Initialization
Enable Interrupt
4.7 sec. Delay
Disable Interrupt
Read Data From A/D
Calculate pH
NO
NO
<.HDST>
=0
Off Pump High
Stop Time Delay
<LDST'>
=0
Off Pump Low
Stop Time Delay
FIG. 5.1 MAIN PROGRAM
...
21
=0
3.
Timer status is cleared (((TST))
).
4.
High deadband status is cleared ((<HDST))
5.
Low deadband status is cleared (((LDST))
6.
The interrupt mask for the restart interrupt is
= 0 ).
= 0 ).
cleared (for keyboard interrupt).
1.
The
following data
are programmed
to the memory
in RAM.
The high limit set point (mode F)
The low limit set point (mode L)
The temperature (mode C)
The deadband (mode 0)
= 1.00
The time delay (mode E)
=
=
=
=
PH7
CON
CON1
CON1
= 25.00
= 12.00 pH
= 2.00 pH
0
C
pH
= 99.99
minutes
0000 H
0100 H
171E H
(for manual temp.)
152C H
(for automatic temp.)
= 0).
8.
Program key status is cleared (((PKEY>)
9.
= 0).
Display pointer is cleared (((DPTR>) = 0).
On or off status is cleared (((ONOFF)} = 0).
10.
11.
Display mode is cleared (((DMODE))
Since
the
calibration
manual
temperature compensation
for the probe are controlled by the
and
software,
the explanation of the calculation is given by the
follow-
ing
example.
the
pH probe will generate 295.8 mV and 320.6 mV at 25
and
50
0
C
From the data in Table 1,
the
respectively.
for pH2 solution,
The calculation is
made
by
0
C
a
22
following formula.
1
7.00-
The voltage generate by the pH probe in mV
T
=
=
The temperature of the solution in
pH
=
7.00-
=
7.00- 4.997
=
2.003
=
7.00 -
=
7.00 -
v
at 50
[54.:
=
pH
0
+ .2T
295.8
]
[ 54.2 + .2(25)
C
pH
ec
J
320. 6
[ 54.2 + .2(50)
4~994
= 2.006
The
data in Table 1 are the data for an ideal
The offset value
design
with
the
=0
mV,
the efficiency
= 100 %.
unit will be able to calibrate for
the offset value
=±
pH
=
7. 00 -
[
In
the
30 mV and the efficiency
The calculation is made by a following formula.
V - A
]
54.2 + .2T
F
probe.
this
probe
= 90 %.
23
When the unit is initialized, A is equal to 0 and F is
equal to 1 (for ideal probe).
with
When the probe is calibrated
a 7.0 buffer solution,
A is equal to
v7 .
When
the
probe is calibrated with a 4.0 buffer solution.
F
3(54.2 + .2T)
=
v4 After
always
v7
the probe has been calibrated,
the reading
is
correct regardless of the offset and the efficiency
of the probe.
The formula used in the software is modified as
shown
below.
pH
=
The
( 2BC H) -
binary
[((TEMP> - <.PHT>) x ( 514 H) x <CON>]
<CON 1)
numbers are used in the
order to explain in detail,
calculation.
In
the following example is given
and all the numbers are BCD.
For
pH2 solution at 25
0
C,
the probe
will
generate
295.8 mV. Assume that the probe is ideal.
( PH7)
= 0000
<CON>
= 01.00 (compensate for the efficiency
(compensate for the offset of the probe)
of
probe
(TEMP)
=
mV X 10
(input voltage from A/D)
1.3
the
,, .
24
295.8 X 10
=2275
=
1.3
.(CON1 > = 5420 + ( . 2 X T X 100)
= 5420 + (.2 X 25 X 100)
(514 H)= 1300
(compensate for temp. )
= 5920
(compensate for A/D conversion)
(2BC H)= 0700
227
pH
:
pH
= 0700 - 0500
pH
= 0200
The
0700 -
[ (
:
: OOOO )
9 0
X
1300
X
01.00]
display will display 2.00 ( The decimal point
is
always displayed).
5.2
KEY INPUT INTERRUPT SUBROUTINE
This
routine is enabled by the interrupt request from
the 8279 when the keyboard is depressed.
The flow chart of
this routine is shown in Figure 5.2A and Figure 5.2B.
5.3
DISPLAY SUBROUTINE
This routine is used to send the new data to the
8279
for display. The mode which will be displayed is determined
by the content in the address <DMODE> •
0,
1,
mode),
tively.
blank,
2,
3,
mode F,
If
The
The content can be
4, or 5 and the display will be mode R (run
modeL,
mode C, mode 0, or mode E respec-
the first digit is zero,
the display will
flow chart of this routine is shown in
be
Figure
25
PC
=0000
H
YES
Select Digit
1-------..;~~
RET
FIG. 5.2A
KEY INPUT ROUTINE FLOW CHART A
26
<.PKEY> = 0
<TST > = 0
<HDST> = 0
<'LDST> = 0
Off Alarm
Stop Time Delay
Convert Data
BCD to Binary
Calculate CON1
{. LDB>
<HDB>
= Low Limit + Deadband
= High Limit - Deadband
Read Data From A/D
Store In PH7
FIG. 5.2B
lcalculate CON
!
KEY IN PUT ROUTINE FLOW CHART B
27
L
H
:
HI..
HI..
= (HI..) + (HI..)
(L) + (<DMODE>)
= RBFR
=
L
' c
: RBFR
B
:
HI..
= 05
B
c
A
HI..
C
+ 1
(HI..) + (BC)
= 90
= 03
<KCOM~
(KDATA
(<DMODE>)
= 00 H
= O'fi..l + (HLl
=
> :
=
=
H
H
H
((HI..))
A
(HI..) + 1
(C) - 1
NO
B
A
=
=
(B) - 1
:
OFF H
(<HI..>)
NO
A
FIG. 5.3
DISPLAY ROUTINE FLOW CHART
28
. C = ((TEMP))
B = (<TEMP + 1>)
C = (C) + (<PH7>)
B = (B) + ((PH7 +
NO
c
= (c>
+
o1 H
B = (B) + (CY)
(POL) = OFF H
<DD>
= (C)
<DD + 1> = (B)
<DR>
= ((CON1))
(DR + 1> = ((CON1 + 1>)
DIV
CALL
= ((QU>)
(MPD >
<MPD + 1> = ((QU + 1>)
<MPR >
= 14 H
<MPR + 1) = 05 H
MULT
CALL
FIG. 5.4
CALCULATION ROUTINE FLOW CHART
1)) +
(CY)
29
5.4
THE CALCULATION SUBROUTINE
This
routine
is used to add a 16-bit number
<TEMP + 1 > to a 16-bi t
address
<TEMP> ,
address
<PH7 > , <PH7
+ 1>
.
number
in
the
in
the
The result is changed from 2' s
complement form to sign magnitude form and the sign bit
in the address <POL> (00 H =plus,
stored
This
OFF H =minus).
number is divided by a 16-bit number in
CON1
, CON + 1
is
the
address
and multiplied by 514 H. The flow chart of
this routine is shown in Figure 5.4.
5.5
DIVISION SUBROUTINE
This
routine
is used to divide a 15-bit number by
15-bit number and the quotient is a 15-bit integer and
bit
decimal
fraction.
shown in Figure 5.5.
and the divisor
(DD + 1).
a
16-
The flow chart of this routine
in
The routine assumes that the dividend
are already stored in
the address
< DD >,
and (DR> , <DR + 1 > respectively. The quotient is
stored in the address (QU>, (QU + 1), (QU + 2>, (QU +
3>.
The divisor is checked for leading zero and aligned by
shifting
"1".
left until the second most significant bit
is
a
Compare the divisor with the dividend, if the divisor
equal or less than the dividend;
subtract the divisor from
the dividend and shift a "1" into the least significant bit
of
quotient;
otherwise shift a "O".
Then shift left
the
30
Check Leading Zero
Of Divisor And Set
01xx • • .xx
Shift "1" To Quotient
Shift
Shift Left (DD>
Decrement Counter
NO
Shift Right Quotient
With Appropriate Time
RET
FIG. 5.5
DIVISION ROUTINE FLOW CHART
"O"
To Quotient
31
COUNTER
E
D
C
B
= 10
=
=
=
=
H
((MPD))
(<MPD + 1))
((MPR>)
((MPR + 1>)
HL
= 00 H
HL
= (HL)
RAL
RAL
C
B
HL
C
= (HL)
= (C)
+
(HL)
+
+
+
(DE)
(CY)
(CY)
YES
B
COUNTER
= (B)
= (COUNTER)
- 1
NO
<PRO> = (L)
. <PRO + 1> = (H)
(PRO + 2> = (C)
<PRO + 3 ) = (B)
FIG. 5.6
MULTIPLICATION ROUTINE FLOW CHART
,, .
32
dividend. Finally the quotient is aligned by shifting right
with the appropriate time.
5.6
THE MULTIPLICATION SUBROUTINE
This
routine is used to multiply two 16-bit
numbers.
The flow chart of this routine is shown in Figure 5.6.
routine
plier
assumes that both the multiplicand and the
are
and (MPR),
already stored in the address <MPD>,
< MPR + 1 >respectively.
32- bit number
The
multi-
<MPD + 1>
The product which is a
is stored in the address <PRO>,
< PRO + 1 >
,
(PRO + 2>, <PRO + 3).
The multiplier is shifted out one bit at a time,
most
significant bit first out. If that bit is a "1", add multiplicand to the product.
Otherwise add zero to the product.
Then shift left the product.
5.7
BINARY TO BCD
SUBROUTINE
This routine is used to convert a 14-bit binary number
to
a 4-digit BCD.
in Figure 5.7.
The flow chart of this routine is shown
This routine assumes that the 14-bit binary
is already stored in the address <BIN>,
<BIN + 1>.
The 4-
digit BCD is stored in the address (BCD), (BCD + 1).
The
number is shifted into the decade
bit at a time,
of
each
registers
one
most significant bit first in. The contents
decade are tested before each shift and a
three is added to any decade containing five or more.
binary
33
E
BIDEC
= (E) A OF H
= (<BIN>)
L
H
= (<BIN
= 00 H
E
D
B
=
=
+
1))
00 H
10 H ,
= (E)
=
+
03 H
(D) + (CY)
L
RAL
RAL
RAL
H
RAL
D
B - 1
E
=
B
(E)}\ OFO H
NO
E
~BCD·>
<BCD+
1)
= (E)
= (D)
D
= (E)
=
+
(D} +
30 H
(CY)
(I:; /\OF H
+
D
FIG. 5.7
= (D) 1\
BINARY TO BCD ROUTINE FLOW CHART
03 H
OFO HI
34
L
H
E
D
B
CY
RAR
RAR
RAR
RAR
B
H
FIG. 5.8
=
(H)
= (<BCD'>)
= (<BCD
+
= 00 H
= 00
H
H
= 10
=
1>
0
H
L
D
L
H
(L)
= (H)
=
- 03 H
- (CY) ·
L
= (L) 1\ OFO
H
= (H) - 03 H
H
= (H)
E
=
-
(B) -1
30
H
BCD TO BINARY ROUTINE FLOW CHART
f\
H
OFO H
I
35
5.8
BCD TO BINARY SUBROUTINE
This routine is used to convert a 4-digit BCD to a 14-
bit binary number.
The flow chart of this routine is shown
in Figure 5.8. This routine assumes that the 4-digit BCD is
already
stored in the address (BCD),
<BCD + 1>.
The
14-
bit binary number is stored in the address <BIN>, <BIN + 1>.
The number is shifted out of the decade registers
bit
at a time,
tents
of
binary
least significant bit first out.
each decade are tested after each
one
The con-
shift
and
a
three is subtracted from any decade containing five
or more.
5.9
A TO D SUBROUTINE
This
converter.
Figure 5.9.
routine is used to read the input data from
The
flow
chart of this routine
is
shown
A/D
in
The routine will store the data in the address
(TEMP>, (TEMP + 1).
36
Counter
Read Data From A/D
Delay 35 ms
Read Second Data
NO
Average 4 Data
Store In <TEMP>
FIG. 5.9
A TO D ROUTINE FLOW CHART
CHAPTER 6
PERFORMANCE EVALUATION AND CONCLUSIONS
6.1
PERFORMANCE EVALUATION
The
a
pH
unit was built on breadboards and tested by using
simulator.
source
shown
corresponding
in
Table 1.
specifications in
and
The pH simulator generates
effective
to the pH level and
The unit performed
Chapter 2.
the
voltage
temperature
according
to
as
the
The keyboard entry is simple
allowing easy data entry and
display.
The
designed
in
time delay was obtained as designed.
6.2
CONCLUSIONS
The
8085
accordance
with
based
the
pH
controller
hardware
and
was
software
development
presented in Chapter 4 and 5.
The
up
for
unit can be improved by providing a battery
the RAM memory in order to retain the data
back
during
power failure.
The
design
experience.
of
this
unit has given
me
a
lot
of
This will enable me to attack more complicated
problems.
37
REFERENCES
Intel Corporation. MCS-80/85 Family User's Manual. Santa
Clara, California: Intel Corporation, 1983.
Intel Corporation. Intel Component Data Catalog. Santa
Clara, California: Intel Corporation, 1978.
Omega Engineering, Inc. Temperature Measurement Handbook
And Encyclopedia. Stanford, Connecticut: Omega
Engineering, Inc. , 1985.
Greenfield, Joseph D. Microprocessor Handbook. Rochester,
New York: John Wiley & Sons, Inc., 1985.
Maxim Integrated Products, Inc. Maxim CMOS Data Acquisition
Catalog. Sunnyvale, California: Maxim Integrated
Products, Inc. , 1984.
38
APPENDIX A.
BLOCK DIAGRAM AND SCHEMATIC DIAGRAMS
39
40
_j
~
......
\$;
....
.-1
II
I,
v
.I
l~
..
~
:z
c
......
\-
\J
w
\/)
J. 1--P.
II
)-
I
I
I
""
{).
-.......
<(
1-?'
.Jl
I.JJ
>
z
s
.A
Iv
oL
:).iy
...
I""
1-
d
lJ::t
rcr.
lA
_I
I""
w
t--
r:.,;J.
I
w
~
C)
c..
)~
~
......
_,
..J
r"'
z.....
::J. D
\,)
-..!)
0
-.1
...:
2
<
....
1
Iv
2.
0
i=
v
w
V\
"""~
\/'i
u..l
p::>
"'"' ~
0-r;J..
4..
BLOCK DIAGRAM
~
Iv
.11
I--
-.:1-17
a.
...
....
\/\
A
<.a.-· ~
r
0
...a~
... >"" "''
i.J .....
y
V'\
I"
:.../.
-'
:::i:~
.lt.--.,_
A
l-
d.
p..
)-
ti
Cll..
c:(,
0
~
MklN 60P.Ri>
·-··
.Jr ~0· FIllto\Mj~~Z(W
,_...
D
AJ>.
H.v
llt~n~
41,.
r
·I
"Oa
K ---
;"'-11
l'
12
Atl IS
ll.l~l1 Ul
u-~
-!,:-
..-v
•• " ' '
00.
llOs
115T6.S
f1Ue1 OUT
~
MOLt
!>
'
IIJ
A..
oo.
II
'
"'
~
107 19
2
116
11
,
,.,
07 n
ll
DSa
~''•'SY
·~~
"'", ,
1
_
·
~
-
a·
DS, 11
6'4D
\\:c
Es
'• Vs!o
·~
..._
fl.
.,
r.i t-
~ 1-
r=£~t-
V.:t
ii;-1.;.;:.
rIll-
~~
.:.:.
'"
... ,.,
6WII
"•O
2\(i2ftjf
I
*'
.!'..
1 .. :
I
~..r7
:1>74 LSl2
3
f.=--
~·..,
I
L!_ to/ii\
• if.
3
+W L
-1..!_
-·2 .f~~
~~
~I
T
7z.\2
t~
••.,
3
lC.M
_
'1'1MER IN
~"
•"'
"'I
4
5
((
20 \1\6
F
1_2!. P&t,
[
T
t,
-:b-
,..v
wa •• •uu
I L!!. t.\.E
I u 'fliO\tli OUT
tl
o, 12
ll
0..
•4
soT .,T
1
-t
)
J
·- ,
"'"
&.,
U 1-
0111
I-
....
N~PUY
10~1'0
Iii-
D5
zo~
.......~ll
10
''
o.
o, ;;-:..:-.
0,
2716
18 -
,_!-
-
"•
"• 8Z05
0) I]
0., I'
7
/'\
r.o
11
l>le
Vee
i"'i _
1o _
10
n
20 Ol
8212
~-
Ooi!J
·~
0(, 16
"13
,.,, · _.toiA
. 1",1111,.
\ ..ll
12
.
I'S
iii ~
'"""'
llo
IO
t.LR
...._, ....l
\'"
Oa
01,
M)s 17
II
,.....
~""
I
t'5 "
~
" "''
.,. 37
(lV. OUT
~RST7.5
;.!. RST!>.S
•
0,
~
~
ri6
r
7 t.,
') llllt
~o. n:u
= I'EIII't
~
...
I
00s 6
ll01 I
l6. 1115
ALIE lO
,s
'IO
DO, ""
Ola
lj,
,._,,
,.. ~
3 Ollt
7
· "" ''
~ V,,
~-~
5
~
~::
r-f(;--
AOs !~
A~
aoasA
1
'I
-~----2 '-
--
-- -·· . - - - - - - · _-:
I
1
I
..-.,
8155
(. T -·
"", Ill
Alii 18
ra, I~
t-~
.J -_
"D., 17
-;-
A\14 ::
,.~»1
"
f- \TO
7 f8 1- l'fMIR
12
~I-
AJ>a
""'
I)
~U
~ ,__
"D• z&
PA7
..,.,
r-
t.
~-
n
~~~
~-
26
'"'
I
......
~f- j
·)
.j:::"
--"
l>lSPLA"(
BO~Rl>
+5V
+5V'
-T
l4o Vee.
-l
"'~'w
to•lt.t
_,
_,
10 iii
SL2 ~'
. ll Dllo
11&,
-",,
IS
SL 1
usn
II
IL w"
-(,
TO
~Lo
J
f
-5
8279
ll&,
-I
ll
_,
10
...:ii
II
-~.~
:a.~
lll.e
"-Lt
·~
l~
I
,,
e,
s..
v,,·~
...
cs
P&7
8a
7US
Ooca l7
0
15&
~'
!
£a
o~~
o.
i".,
r
~
R
r
IOOA
L.....! 8
..___!
looA
bIt
c.
'"hl
16
I!PQ.
I
100A
C II
100Jl
8i
cJ.IO
e 9
'looA.
ll8l
f IS
1AIOA
i:T
3 I+
' D
~
Yoo
g
--{>o-
1
-;>--
soon.
2eOA
7~ (( 11
2N
H04-
J
IK
12
d.
~
re
MAll
0~
1
C( IZ
7H
f
I
L Ia
"
~
t)
K
us
IC.
"
~-15
I(
7, 7, ,r, r,
Cltp
f~cc
c.c:!
'd.
11
4
Ct
(I
I
14=
I
Ia
(.
II~
"~
t
"
-J
".. ~
7+A.
It
cc•
I• It
1
.
A
MA.,
74A ((
re ?" ref
ej cl
r• ra
l, !· ~
t(
~f.-
cc ~r-
j_ I
..J")i
I
Vss
~
4.11< "-"IS
l_L
tl
9
cc.!
f I
..
~.'l'i
RE.
7
"'""
h
•
)
vl Ia
..!cl
'"a. ~ ~"
e
8
'DEC
lN(
Te Ttl ·..
f
10
.,!;
s
v·
M
!.''
(
Cl I!
--{)--
&HI>
p
~
iD ~
74LH8
12
II
;_ '\
11
----{)---
~ iND
'
A.
-;.:._
)
~
-t::--
·~
~-
II
74L50lt
s'
--=-
~0
*
w
to
02.b
,..!.. 4
~
if::f":·~, '.._ ~
·~
Vtc.
-r;; £.,
,.
a. .'M
ll8s
"·
3 "''
Cl
"-la 1
~~~~
"'
"
-~
u
cu.
... 110.
:t
-1
_..,
--
Vee.
-··-·---
----
_J:::1\)
r--
~{J-i
.
POWER.
.. .
tO~~~~
+!IV
~
..L....
~y-t
lSY
L-
lltUYI
~
fUMP{
"l'"
)9.Ul +llY IM"I6.
~
39.10.
.cJ
t
.t;\,l'(
~=ltjJ~t
Ill
)90-
*.~~~~
24.9
¥·•41
s
P-··~
19.14.
3904
4.'J5.
*'"
't••••~E.D
::,.
J-
...
IC.'
""""
TO
4."1'SK
.ot)*f
•. ~~=---~------__j
r---4 II(
~1:.0
....
......
K
lll
.cJ
+SV
+'5V
~
MklM
aot.k))
TtSY
w-.. ..---
I
IM
T\.C. 17M"
J;:
w
APPENDIX B.
PROGRAM LISTINGS
44
45
ASM80 aFl:PHC.SRC XREF
ISIS-II 8080/8085
LOC
OBJ
~ACRO ASSE~B~ER,
LINE
V4. 1
MODULE
PAGE
1
SOURCE STATEMENT
1 SMOD85
2
43
5
6
0000
00E:4
0034
0040
2000
E:0F~='
1900
1800
0800
!000
87
9
10
11
1a
13
14
15
16
17
'
,' .............................
I*
PH CONTROLLER
*
, •••••••••••••••••••••••••••••
'
RESET
INTRPT
INTRPK
START
RAMST
STPTR
KCOM
KDATA
LBEN
HBi::N
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
I
10012'H
;RESET RDDR
;TIMER INTERRUPT ENTRY
1KEYIN INTERRUPT ENTRY
1START OF MAIN PROGRAM
tSTART OF DA7A STORAGE
;START OF STACK
'KEY CO~., STATUS ADDR
tKEY DATA AODR
tA/0 LOW BYTE ADDR
;AID HlGM BYTE ADOR
EQU
EQU
EQU
EQU
EGU
EQU
20'"1
21H
22H
23H
24M
25H
;I/0 STATUS ADDR
'PORT A ADDR <OUT>
;PORT B ADDR <IN>
;PORT C ADDR <OUT)
;L..OW BYTE TIME~ REGISTER
;HIGH BYTE TIMER REGISTE~
ORG
RAMST
24H
34H
41H
2000H
20FFH
1900H
1800H
08~0H
18 '
0020
0021
00<:2
002!
IZ:~E:4
002~
2000
2000
2005
200A
200F
2014
2019
201E
20a0
2022
2124
2126
2028
202A
202B
202C
202D
202E
2030
21Z32
2034
c:e3e.
19
20
21
2a
23
24
25
2E.
27
28
29
;
;I/0
'
,
lOST
PORTA
PORTB
PORTC
LTR
HTR
30
31
32 '
33 '
34 RBFR:
35 FBFRa
3£ LBFRa
37 C:BFRa
38 OBFRa
39 EBFRa
41 FBa
41 LBa
lt2 CBa
43 OBa
44 EBr
45 RBI
lt6 PKEY1
47 DMODEa
48 DPTRa
49 ONOFFa
50 VALla
51 VAL2a
S2 VAL..3a
53 VAL4a
54 YALSa
DS
5
DS
DS
DS
DS
DS
DS
DS
DS
DS
s
s
5
s
s
DS
2
DS
DS
DS
2
DS
DS
DS
DS
DS
DS
DS
2
2
2
2
1
1
1
1
2
2
2
2
2
,MODE R CURRENT PH BUF~ER
tMODE F HIGH PH BUFFER
;MODE L LOW PH BUFFER
1MODE C TE~P. BUFFER
1MODE 0 DEADBAND BUFFER
1MODE E TIMER BUFFER
1BINARY HIGH PH
1BINARY LOW PH
1BINARY TEMP
1BINARY DEADBAND
1BINARY TIMER
1BINARY CURRENT PH
1PROB. KEY STATUS
1DSPL.Y MODE
1DSPLY POINTER
10N-OFF STATUS
1FIRST OPERAND FOR SUBR. ADD
1SECOND OPERAND FOR SUBR. ADD
;RESULT FROM SUBR. ADD
10PERAND FOR 2'COMP. CONVERSION
;RESULT FROM 2'COMP. CONVERSION
1~6
lS!S-11
LOC
8080/8~8~
OBJ
2~38
203A
203C
2040
2042
.::044
2048
204A
~04C
204E
2~5IZI
2051
2059
21215A
;::esc
21Z'5E
;;.~e.IZ!
20E.1
~ACRO
ASSEMB~ER,
V4.1
MOOu:..E
PAGE
SOURCE STATEMEN7
LINE
'55 MPD:
'5E. MPR:
'57 PRO:
S8 DO:'
59 OR:
60 QU:
61 BIN:
62 BCD:
63 PH7:
64 CON:
65 POL:
66 TEMP:
67 TST:
68 CON1:
e.g HOE<:
70 LOCI:
71 HOST:
71:. LOST:
OS
OS
OS
DS
OS
OS
DS
OS
DS
DS
DS
DS
OS
DS
DS
OS
OS
DS
2
2
4
2
2
4
2
2
2
2
1
e
1
2
2
2
1
1
;f'IIULTii'i..!CA!\1.,.
; f'IIUL T I PL.IEI1
;PRODUCT
;DIVIDEND
;DIVIDER
;QUOTIENT
;E!INARY NO. TO & FROM CONV::RS:ON
;BCD NO. TO & FRO~ CDNVERS:w~
;STORE PH7 DATA FOR CA~IE!RA-ION
;CONSTANT MULTIPLIER ~DR CA~.
;POLARITY OF INPUT SIGNAL.
;TEMP. STORAGE FOR INPUT SIGNAL
;TIMER STATUS
;CONSTANT DIVIDER FOR CAL.
;HIGH DEADE!AND PH
;LOW DEADBAND PH
;HIGH DEADBAND STATUS
;LOW DEADBANO STATUS
73
74 ;
75 ;•••************************
76 ;*
RESE7 E~TRY
*
77
0000
78
79
;•••························
ORG
RESET
821
81
82
83
84
;
85 ;*************************************
TIMER INTERRUPT ENTRY
*
86 ;•
87 ;•************************************
88
0024
0024 C32602
0034
ORG
INTRPT
89
90
91
Jf'IIP
TIMER
92
93
94
9'5 !*************************************
96 ;•
KEVIN INTERRUPT ENTRY
*
97 '*************************************
98
gg
ORG
INTRPK
100
101
0034 C33902
102
JMP
KEVIN
103
104
105 ;****************************
106 ;•
MAIN PROGRAM
*
107
108
;•••·························
1~9
47
ISIS-II Mae/8885 MACRO ASSEMBLER, Y4.1
..,..
LDC
OBJ
. .48 31FF28
N43 218019
N46 36M
M48
804A
MltC
HltE
362A
36DF
3£40
DJae
8050 3£00
8052
8055
0058
1058
00SD
MSE
8061
ee63
806£
8067
8068
80£9
806A
8068
006E
0071
0073
1074
8076
0079
0079
007C
007E
325920
326020
326120
3E0C
30
218207 .
1623
110sz0
7E
12
23
13
IS
C26600
214Ce8
3600
23
3600
214E20
3600
23
3601
215A20
e081 361E
0083
0084
108£
M89
HBB
NBC
HBE
eeaF
. .91
le92
23
3617
215C20
364C
23
3684
23
3621:
23
3681
1894 DIM!£
en6U48
. .98 CAA:Jee
M98 115Ai!e
ee9E 362C
MAe 23
eeAt 3615
MAl 212A28
MAf. 3£M
HA8 77
''
118
3
DRS
START
LXI
LXI
""'1
MYl
MYI
MYI
OUT
MYI
STA
STA
STA
MYI
SP,STPTRtPUT STACK AT END OF MEM.
H,KCDM
1BET ICJDE KEVIN, DSPL.V
lt.IMIH
M,2AH
4PROS. Ct..DO< 1M KHZ
M,IDDFH cCLEAR DSPL.Y, FIFO
A,4DH
tlNITIALilE 8155, PORT 8 • IN
lOST
tPORT A,C • OUT
A,eeH
TST
tCLEAR TIMER STATUS
HDST
tCLEAR HIGH DEADBAND STATUS
LDST
tCLEAR LOW DEADBAND STATUS
A,8CH
ti!IASK RST 7.5
119
128
121
122
123
124
125
~SIM
LXI
126
127
MVI
LXI
128
129 BLKI'IOVa MOV
STAX
130
INX
131
INX
132
DCR
133
JNl
134
LXI
135
MVI
136
INX
137
MVI
138
139
L.XI
MVI
140
INX
141
MVI
142
143
LXI
144
MVl
145
INX
146
fiN I
147
LXI
MVl
148
INX
149
MVI
158
INX
151
MYI
152
INX
U53
lilY I
lS4
IN
&55
II&
PAGE
SOURCE STATEMENT
LINE
118
111
112
113
114
115
116
117
MODULE
157
lSI
159
161
161
162 MAINt1
163
164
Mil
JZ
H,F:_~r:R!'I tADDR OF DATA IN ROM
B,23H
D,FBFR
A,M
D
H
D
B
BLKMOV
H,PH7
M,HH
H
M,00H
H,CON
M,80H
H
M,llH
H,CONl
M,lEH
M,17H
H,HDB
M,4CH
H
M,I4H
H
M,2CH
H
R,I1H
PORTS
....
lilY I
LXI
H, PKEV
LXI
INX
M\11
MDV
tMOVE HHH TO <PH7)
tMOIIE 8UI0H TO <CON>
tMOVE 171EH TO <CDNl)
H
MA1N1
H,CONl
M,2CH
H
M,15H
lilY I
tSET COUNTER
tADDR OF DATA IN RAM
ti'IOV DATA IN ROM TDtDSPL.V BUFFER IN R~
A,leH
M,A
1MOllE 844CH TO <HDB)
1MDYE 112CH TO <LD8)
10tED< FOR MtiJAL OR AUTO.
.Q£0(
liT 6
1IF ZERO, .JUMP TO MAlNl
1IF NOT ZERO
tiiiDYE 152CH TO <CONU
1CLEAR PROGRAM KEY STATUS
48
ISIS-II 1861/8885 MACRO ASSEMBLER, Y4.1
LOC
OBJ
HR9 23
eaAA 77
NAB
MAC
80RD
eeAE
NAF
eeee
8083
0086
8087
10&'3
ee&B
008C
I0BF
10C0
10C3
00C4
10C7
~IZICR
IIZICD
HCE
80CF
el02
8103
8004
0105
100f.
1007
0~::>6
1008
eeoE
eeoF
IIE0
e1E1
10E2
eeEJ
eeE4
IIE7
IlEA
10EB
81EC
HED
eeEE
23
77
23
77
3A0019
A7
FAAFie
FB
163F
0EFF
eo
C28B00
05
C2B901
F3
CD731E.
CDA404
213Ca0
23
23
113820
7E
12
23
13
7E
12
214E20
113R20
7E
12
23
e3
7E
12
CD7505
213C20
23
4E
23
46
JASen
eeF1 A7
MF2 FAFF•
.., ...
..-s.,
. .6 .
88F7 CU1.
MFA 78
HFB 2F
IIFC CEee
liFE 47
HF'F 3EBC
INX
MOY
INX
INX
MDV
LOA
ANA
A
MDV
DELAYs
JM
EI ~
MVI
OELRV1a MVI
DELAV2a DCR
JNZ
OCR
JNZ
DI
CALL
CALL
LXI
INX
CHt<a
217
H8
LDA
&18
... 11
at :a
at4
215
216
217
218
219 MAIN2a
ATO
CAL
H,PRO
H
B,MPO
A, IIi
B
ST~lt
MQ\1
MVI
SUB. CRLCULRTE
~~OVE
RESULT TO
;MOVE
((CQ~}l
<~PO>
TO (f!IPR>
A,"'
H
B
A,"'
B
MULT
H,PRO
H
c,M
H
B,M
POL.
A
81H
C,A
A,B
ACI
MDV
1CA~~
8
ADI
MDV
MDV
CMA
.-'..?
8
A,M
B
H,CON
B,I'IPR
A,C
a.
.
H
,...
..,
ANA
10N-DFF STATUS • e
tOHECK IF DSPLY IS READY
~ELAY2
~!J_YJJ·'il
B
rffU
DELAYl
LXI
fiiOV
STAX
INX
INX
f!IOV
STAX
u::
1DSPLY POINTER • e
C,eFFH
~YHj
H
L.XI
MOV
STAX
INX
INX
MOY
1DSPLY MODE • RUN Ull
DELAY
INX
2e6
2ft
H
M,A
H
M,A
H
M,A
KCOM
CALL.
LXI
INX
MDV
INX
ate
4
PA6E
SOURCE STATEMENT
LINE
165
166
167
168
169
178
171
172
173
174
175
176
177
178
179
181
181
182
183
18-lt
185
:.8e.
187
188
189
190
191
192
193
1'34
195
196
197
198
199
211
2iii
212
213
214
215
MODULE
MAIN2
1CALL. SUB. M~LTIP~Y
1MOVE RESU~T TO BC
'CHECK POLARITY
4 IF MINUS, JUMP TO MAIN2
tlF PLUS, 2. COMPLEMENT
.....
I, A
A,IBCH
1ADD 828CH TO BC
49
ISIS-II 8080/8085 MACRO
LOC
O&J
0112'1
a:
010a
0103
0:;.05
0106
0107
010A
0108
010C
0l0D
0110
0111
0112
0113
0llE.
0119
011C
0! 1E
011F
0121
0122
0123
0124
0126
0127
0128
0129
012A
012£1
012C
012D
012E
0131
0133
0134
0137
0i38
0138
013E
013F
0142
0145
0146
0149
011tC
014F
e1s0
0151
et53
0154
IU55
CU 58
015£1
015D
0160
4F
3E02
88
47
214820
71
23
70
212820
71
23
70
CDB205
214A2~
0100.::0
1E02
7E
EE.0F
0.:.
03
7E
E6F0
1F
lF
lF
1F
i.2
23
03
1D
C21E01
JEFF
0a
3A5'320
A7
C2F30i
3A6020
A7
C2A401
3A6120
A7
C2CD01
211E20
012820
23
n
1602
eA
BE
CA£701
DAE.D01
JEFF
32E.020
3E40
ASSE~&~ER,
V4. 1
P ..,.;.:.
~-
LINE
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
£3e.
237 MAl"\3:
238
239
240
241
242
243
244
245
C:46
247
248
249
250
251
25.:!
253
254
255
ADD
II!OV
I'IVI
ADC
MDV
LXI
MOV
INX
I'IDV
LXI
MDV
INX
MDV
CALL
LXI
LXI
I'IVI
I'ICV
AI\; I
STAX
INX
MDV
ANI
RAR
RAR
RAR
RAR
STAX
I "..X
INX
OCR
.J!'IIZ
I'IVI
STAX
LOA
ANA
c
C,A
A,02H
B
8,A
H,8!N
fii,C
H
M,B
;MOVE <8C> TO <RB>
H,RB
M,C
H
fii,B
&IDE:
H,&CD
8,R£1FR
E,02H
0F0H
""
.
t,f,.,
"' ) f'> Vd l
H
.,
{! '1'''/
/i<t:Acv-•><•tir..·f,}Z.·,~l•
Et
E
MAIN3
A,0FFH
B
TST
;OSPLY
B~ANK
FCR MODE
;CHECK TIMER STATUS
A
I'I~IN1S
HOST
,CHECK HIGH OEAOBANO
STA:~s
A
MAIN10
L.DST
,CHECK LOW DEAOBRNO
STRT~S
A
MAIN13
H,FB
B,RB
L.lCl
INX
INX
H
MVI
D,02H
L.DAX
CMP
JZ
JC
B
I'IVI
;SET CCu"'•ER
B
,::,M
Jt..IZ
STA
MVI
PC~
<R~=~>
0FH
LOA
ANA
.JNZ
L.DA
ANA
JNZ
268 lilA I N4a
269
270
271
272
273
274
TC
e
256
265
266
267
;CA~L S~B. &I~.
;~DVE RESU~T TO
~,~
257
258
259
260
261
262
263
264
LXI
,MOVE <BC> TO <&:!\;)
,coMPARE <<RB>> TO <<FB>>
8
'SET COUNTER
M
MAINS
MAIN6
R,0FFH
HOST
A,40H
'IF EQUAl,JUMP MAINS
;IF LESS,JUMP MRIN6
,SET HIGH DEADBR~O STATUS
;IF MDRE,ON PUMP HIGH
50
MCDUL.E
ISIS-II 8080/8085 MACRO ASSEMBLER, V4.1
LOC
08J
0160::
0164
0167
0168
0169
016A
016D
0170
0173
0174
0175
0177
0178
0179
017C
017F
0181
0184
0l86
0188
0188
e:8;:
0180
018E
0191
0194
0195
0:97
0198
D3i21
C39101
28
08
15
C25301
2120.:':0
012820
23
03
1602
0A
BE
CA8B01
O.::F301
JEFF
30::6120
3E0::0
28
08
15
C27701
21260::0
7E
0324
2:::
7E
IZ!S'3
F68~.
3l4
019~
D325
3ECD
0320
C3F301
21Si:E:0
012820
OUT
305
MVI
306
OUT
307
JMP
308
30'3 MAIN10& LXI
LU
310
0190
019F
01Al
01A4
01A7
01AA
01AB
01AC
0:AE
01AF
0180
0183
0186
0188
eu~e
01BD
01BF
01C1
01C4
e1c5
01C6
01C7
0:CA
01CD
C39~0~
6
SOURCE STATEMEII:T
LINE
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
300::
303
0321
PAGE
MAIN5&
MAIN6&
MAIN?:
MAINS:
MAIN9:
OUT
JMP
DCX
DCIC
DCR
JNZ
LXI
LXI
INIC
INX
MVI
LDAX
CMP
JZ
JNC
MVI
STA
MVI
OUT
JMP
DCX
DCX
DCR
JNZ
LXI
MOV
OUT
INX
IIIOV
oq:
INX
c:~
311
03
1602
0A
BE
CAC401
D2F301
3E00
32602111
D321
3E4D
D320
C3F301
28
es
15
C2AE01
C3F301
215E20
INIC
312
MVI
313
314 MAIN11: LDAX
CMP
315
316
JZ
317
JNC
MVI
318
STA
319
OUT
320
321
MVI
322
OUT
JMP
323
324 MAIN12a DCX
DCX
325
326
DCR
JNZ
327
JMP
328
329 MAIN13a LXI
PORTA
MAIN9
H
8
D
MAIN4
H,LB
B,RB
H
,cOMPARE CCR8>> TO CCLB>>
D,02H
B
1SET COUNTER
e
"'MAINS
MAIN!6
A,0FFH
LOST
A,20H
POPl"!'"A
;IF EOUA~,JUMO MA~~8
;IF MORE,JUMP ~AI~16
;SET LOW DEAOBAND STATWS
1IF LESS,ON PUMP LOW
MA~~'>'3
H
B
D
MAIN7
H,EB
A,M
LTR
H
A,M
8121f'
HTR
A,0CDH
IOST
I'IAIN16
H,HD8
B,R8
1COMPARE CCRB>> TO <<HOB>>
H
8
D,02H
B
MAIN12
"'IIIAIN16
A,00H
HOST
PORTA
A,4DH
IOST
MAIN16
H
B
D
MAIN11
MAIN16
H,LDB
1SET COUNTER
1IF EDUAL,JUMP MAI~12
1IF MORE,JUMP MAIN16
1CLEAR HIGH DEADBAND STATUS
'TURN OFF PUMP
,STOP TIMER
1 COMPAR~
CCRB>> TO C<LDB>l
51
ISIS-II
LOC
8080/808~
OBJ
0100 012820
0103 23
0104 03
010~ 1602
0101 eA
0108 BE
0l09 CAED01
010C OAF30l
010F 3E00
01El 326120
01E4 0321
01E6 3E40
01E8 0320
0!EA C3F301
01ED 28
01EE 08
01EF 1~
01F0 C20701
01F3 3A2A20
QllFf. R7
01F7 C20502
01FA 3E00
01FC 322820
01FF 3a2C20
0202 C32002
0205 3A2D20
0208 R7
0.203 2F
020R 322020
0200 FA2002
0210 JA.::c.::e
0213 F680
021~ 320019
0218 3E0F
021A 320~18
0a10 C3B61Z10
0220 CD£.904
0223 C3BE.00
0226
0227
0228
0229
la22A
la22C
022E
0230
0.;;33
0234
e
cs
DS
FS
3E80
0321
JEFF
32S920
Fl
01
MACRO ASSEMBLER, V4.1
LINE
I'IODU!..E
PAGE
7
SOURCE STATEMENT
B,RB
LXI
INX
H
INX
8
D,02H
tSET COUNTER
I'IVI
LOAX
B
33~
CMP
M
I'IAIN1S tiF EQUAL,JUI'IP I'IAIN15
336
JZ
337
JC
I'IAIN16 tiF LESS,JUI'IP I'IAIN16
tCLEAR LOW DEAOBAND STATUS
338
I'IVI
A,00H
339
STA
LOST
PORTA
340
OUT
t TURN OFF PUI'IP
341
I'IVI
A,4DH
;STOP TIMER..
342
OUT
IOST
343
JMP
IIIAINlE.
344 MAIN15: OCX
H
34~
OCX
Eo
346
OCR
D
MAIN lit
347
Jr-.;Z
;CHECK PROG. KEY STATUS
PKEY
348 I'IAIN16: LOA
343
RNA
A
CHK1
3~0
JNZ
A,00H
3~1
I'IVI
;DSPLV I'IOOE • RUN C0>
OMODE
352
STA
DPTR
;DSP!..Y POINTER • 0
353
STA
354
JMP
CHK2
;CHECK ON-OFF STATUS
3:5 CHK1s
LOA
ON OFF
A
356
RillA
357
CMA.
;COMP-EI':ENT A
ONO;:"F
358
STA
CI"K2
35'3
JM
DPTR
;CHECK OSPLY POINTER
360
LOA
36;.
ORI
801-1
362
STA
KCOM
tSELECT DIGIT
A,0FH
363
I'IVI
364
STA
KDATA
;DSPLV BLANK
CHK
3E.5
JI'IP
DSPLV
36E. CHK2 1
CAl..L
3E.7
JI'IP
CHK
368 '
3E.9
370 ', •••••••••••••••••••••••••••••••••••••••
. 371 1*
TIMER INTERRUPT PROGRAM
*
372 , •••••••••••••••••••••••••••••••••••••••
373 1
374 1
H
37S TIMEA1 PUSH
PUSH
376
8
PUSH
377
D
PUSH
PSW
378
A,80H
379
MVI
PORTA
;SET ALARM
OUT
380
A,0FFH tSET TIMER STA7US
I'IVI
381
TST
STA
382
POP
PSW
383
384
POP
D
330
331
332
333
334 MAIN14a
52
ISIS-II 8060/8065 MACRO ASSEMBLER, V4.1
LOC
OBJ
0235
0236
0237
0236
C1
E1
FB
C9
0239
023A
0231:!
023C
0230
023F
E5
C5
05
F5
3E40
32121019
0242
3A00~6
0245
0247
024A
0240
024F
0-:.,.::>
0254
0257
025A
0250
02E..Z
FED1
C24D1212
C3000121
FECB
C21003
3E00
322A20
325'320
32E.020
32£120
_,_
---·
D.,=·•
0262 3E4D
0264
02E.6
02£9
02E.A
0260
02E.F
0272
0274
0275
0276
032121
211E20
E5
210520
1605
014A20
1E02
23
7E
17
0277 17
0278 17
0279 17
027A EE.F0
027C 28
0270 BE>
027E 02
027F 23
0280 23
0281 03
0262 10
0263 C27402
02BE. CD120E.
0269 23
02BA E3
LINE
PAGE
B
SOURCE STATEMENT
365
386
387
POP
POP
EI
RET
388
389
390
391
392
393
394
395
396
397
396
39'3
40121
401
402
403
404
405
40E.
407
406
40'3
410
411
412
413
414
415
41E.
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
436
439
MODULE
B
1-i
'
,.''***************************************
KEVIN INTERRUPT
*
PROGRA~
'***************************************
;
I
KEV.IN:
KEV:
RUN1:
RUN2:
PUSH
PUSH
PUSH
PUSH
MVI
STA
LOA
CPI
JNZ
JMP
CPI
JNZ
MVI
STA
STA
STA
STA
OUT
MVI
OUT
LXI
PUSH
LXI
MVI
LXI
MVI
INX
MOV
RAL
RAL
RAL..
RAL
ANI
DC: X
ORA
STAX
INX
INX
INX
DC:R
.JNZ
CALL
INX
XTHL
H
B
D.
PSW
A,40H
KI;:OM
-~P_ATA\
001H
KEV
RESET
0C6H
KEV1
A,00H
PKEY
TST
HDSi
LDST
PORTA
A,4DH
IOST
H,FB
H
H,FBFR
0,05H
B,BCD
E,02H
;READ
COMMAI"~
;KEYII\: DATA
;COMPARE KEY ''RE"
,Jutt:=> IF NOT 11 RE''
(' e
~:i.l '~! ~ Lo
;COMPARE KEV IIR"
) loo
I c.:) (
;JUMP IF NOT HRII
;CLEAR PROG. KEV STAiUS
;CLEAR TIMER STATUS
;CLEAR HIGH DEADBA~D S~~T~S
;CLEAR LOW DEADBA'JD ST.:TUS
;C:...EAR P:..AR~
;ST:JP TIMER
;SAVE FB IN STACK
;MOVE
< <FBFR>)
TO <BCD>
H
A,M
0F0H
H
M
B
H
H
B
E
RUN2
DECBI
;CALL SUB. BCD TO BINARY
H
;SWAP HL,S'ACK
(ooo
'·" _, I
53
ISIS-II 8080/8085
LOC:
08J
0288
028E
028F
0290
0291
014820
0A
77
23
03
0A
77
23
E3
1:5
C:2£F02
El
212220
013820
7E
02
23
03
7E
02
DB22
EE.4121
CAB602
213820
3E00
77
23
77
213A20
3E.33
23
3e.00
CD7:50S
213C20
23
4E
23
46
3E2C
81
4F
3E15
88
47
215A20
71
23
78
212420
012020
115£20
0A
86
12
23
0~92
0293
0294
0295
029£
0297
029A
0298
029E
02A1
02A2
02A3
02A4
02A5
02AE.
02A7
02A9
02A£c
02AE
02Bl
0283
0284
021:15
02Et6
0289
02BEt
ease
028E
02C1
02C4
02CS
02C6
02C7
02C8
02C:A
02CB
02CC
02CE
02CF
0200
02D3
0204
0205
1206
8209
112DC
020F
02E0
02E1
02E2
MA~RO
ASSEI'IBLER, 1,14.1
LINE
440
441
442
443
444
44:5
44£
447
448
449
450
4:51
4:52
453
454
455
45£
457
458
459
4E.0
4E.1
462
4E.3
4E.4
465
466
467
4E.8 RUN3:
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
48£
487
488
489
490
491
492
493
494
MODU:..E
PAGE
9
SOURCE STATEI'IENT
LXI
LDAX
MDV
INX
INlC
LDAlC
IIIOV
INX
lCTHL
DC:R
JNZ
POP
LXI
LXI
I'IOV
STAlC
INX
INX
I'IOV
STAX
IN
ANI
JZ
LXI
I'IVI
I'I!JV
INX
I'IOV
LXI
I'IVI
INX
MVI
CAl..L
LXI
INX
MOV
INX
MOV
MVI
ADD
IIIOV
IIIVI
ADC
MOV
LXI
MDV
INX
MDV
LXI
LXI
LXI
LDAX
ADD
STAX
INX
8,BIN
8
M,A
H
8
8
M,A
H
D
RUNt
H
H,C8
B,I'IPO
A,ll'l
B
H
,MOVE <<BINl) TO <F8)
,SWAP HL,STAC:K
,II'IOVE <<CS>l TO CI'IPOl
B
A,M
Es
PORTS
40H
RUN3
H,MP::>
A,00H
I'!, A
H
II:, A
H,MPR
11'1,33H
,CHECK FOR MANUAl OR AWTO
;CHECK BIT 6
'IF ZERO, JUMP TO RUN3
;IF NOT ZERO
,lf!OVE 0000H TO <MPO>
;I'IOVE
0~33H
TO I'IPR
H
11'1,00H
MULT
H,PRO
,CALL SUB. MULTIPLV
'MOVE RESUL-T TO <VALl>
H
C,M
H
B,M
A,2CH
1ADD RESULT WITH 15i2CH
c
C,A
A,1SH
B
I, A
H,CON1
M,C
H
M,B
H,OB
B,LB
D,LD8
8
Ill
D
H
ti'IOIJE
RESULT TO <CONU
1((08)) + C<L8))
,sTORE IN <LDB>
54
ISIS-II
8080/808~
LOC
OBJ
02E3
0ZE4
eaE!i
02E6
02E7
02E8
02E9
0.2EC
02EE
02EF
02F0
02F1
02F4
02F5
02FE.
02F8
02F9
02FA
02FB
02FC
02FE
0:::FF
e30a
0305
0306
0307
0308
030'9
0.10A
0308
03
13
lA
8E
12
A7
F2F102
3E00
12
18
12
212420
7E
2F
C601
SF
23
7E
2F
CE00
57
21!E20
01sca0
78
86
02
23
03
7A
SE
ec:
C35E04
FEC0
C22503
JEFF
322A20
3E01
322B2f8
CD£904
C35E04
47
3A2A20
A7
FA3. .3
C3B803
78
FEC1
C24Ae3
3A2B20
3C
FE06
C24103
3E01
322820
CD£904
03~c
0300
e310
0312
0315
0317
031A
f83iC
031F
0322
0325
8326
0329
832A
8320
0330
1331
8333
8336
8339
033A
033C
033F
0341
8344
MODU:...E
MACRO ASSEMBLER, V4.1
10
SOURCE STATEMENT
LINE
49~
496
497
498
499
~00
~01
:502
~03
~04
~05
~06
PAGE
RUN4z
507
508
509
510 .
511
512
~13
514
515
516
~17
~18
519
520
521
522
50:.3
524
525
526
527 KEV1a
528
529
~30
531
532
~33
~34
S3S KEV2a
S36
S37
S38
S39
S40 KEV3a
S41
S42
S43
S44
S4S
S46
S47
S48 KEVSa
S49
INX
INX
LDAX
ADC
STAX
ANA
.JP
MVI
STAX
DCX
STAX
LXI
MDV
CI'IA
ADI
MDV
INX
MDV
CMA
ACI
MDV
LXI
LXI
I'IIDV
ADD
STAX
INX
INX
MDV
ADC
STAX
.JI'IIP
CPI
.JNZ
MVI
STA
MVI
STA
CALL
JMP
MOV
LDA
ANA
.JM
JMP
MCV
CPI
JNZ
LDA
INR
CPI
JNZ
MVI
STA
CALL
B
D
B
M
D
A
RUN4
A1 00H
D
D
D
H,OB
A, I'll
1CHECK POLARITY
1IF PLUS .JUMP RUN3
1IF MINUS
1MOVE 0000H TO <LOB>
12'COMPLEMENT <<OB>>
01H
E,A
H
A,M
00H
D,A
H,FB
B,HDB
A,E
,
1 ( <FB> > - C <DB>>
;STORE IN <HOB>
B
H
B
A,D
B
"'KEV10
0C0H
KEV2
A,0FFH
PKEY
A,01H
DMODE
DSPLY
KEY10
B,A
PKEY
A
KEV3
KEV12
A,B
0ClH
KEV4
DMODE
A
0E.H
KEYS
A1 01H
DMODE
DSPLY
ICOI'!PARE KEY "P"
1JUI'IP IF NOT wpu
1SET PROG KEY STAiUS
1DSPLY MODE • F <1>
1SAVE KEV DATA
1CHECK PROG. KEV STATUS
1 IF SET CONTI NLE
ti:<EV DATA TO A
tCDMPARE KEV "M"
tJIJtiiP IF NOT •fll"
tlNCREASE DSPLV MODE
1IF • 6, MOVE 1 TO A
Q
•
55
ISIS-II
LOC
8080/808~
OBJ
e347 C3~E04
034A FEC2
0341: C2E.803
034F 3A.2C.20
03~2 3C
0353 FE04
035~ C2SA03
03~8 3E00
03~A 322C20
035D 3E00
035F 3"D20
0362 CD€.'304
03£5 C35E04
0.3E.8 FEC9
03E.A C<='3003
03E.D 3A28.20
0370 2600
037a 6F
0373 29
0374 2'3
0375 85
037E. E.F
0377 010020
037A 09
037B 3A.::C20
037E 85
037F 6F
0.380 7E
0381 3C
0382 FE0~
0384 ca8'3e3
0367 3E00
038'3 77
038A CDE.9;214
0380 C35E04
03'30 FECA
0392 C25E04
0395 3A2B20
0398 2£00
039A E.F
0398 29
039C 29
0390 85
039E E.F
039F 110020
13A2 e9
13A3 3A2C20
13A6 85
13A7 6F
03A8 7E
03A9 3D
03AA FEFF
03AC C2B103
03AF 3E09
1!1381 77
MODUl..E
MACRO ASSEMBLER, V4. 1
KEY41
55£
5~7
5~8
~~9
~£0
KEY71
561
~62
~63
KEYE.:
~64
5E.5
~66
~67
~e.8
5E.'3
~70
~71
:sn:
~73
~74
~75
~7e.
~77
~78
579
~80
581
~82
KEY9a
583
~84
~85
11
SOURCE STATEMENT
LINE
~~0
~~1
~~2
~~3
~~4
~55
PAGE
KEYS:
~86
~87
~88
~89
~90
591
592
593
594
595
59£
597
598
599
£00
£01
£02
603
604 KEY11a
JMP
CPI
JNZ
LOA
INR
CPI
JNZ
MVI
STA
MVI
STA
CALL
JMP
CPI
JNZ
LOA
MVI
MOV
DAD
DAD
ADD
MCV
LXI
DAD
LOA
ADD
IIIOV
MOV
INR
CPI
JNZ
MVI
MOV
CALL
JMP
CPI
JNZ
LDR
MVI
MOV
DAD
DAD
ADD
JIIOV
LXI
DAD
LOA
ADD
JIIOV
JIIOV
DCR
CPI
JNZ
MVI
MOll
KEV10
ec2H
KEY£
DPTR
A
14H
KEV7
A,00H
DPTR
A,00H
ONOFF
DSPi..Y
KEY10
0C9H
KEYS
D~ODE
H,00H
L,A
H
H
L
L,A
B,RBFR
B
DPTR
L
L,A
A,M
A
0Ar-i
KEY9
A,0o!H
M, A
DSP!..Y
KEY10
0CAH
KEV10
DMODE
H,00H
L,A
H
H
L
L,R
B,RBFR
B
DPTR
L
L,A
A,M
A
0FFH
KEY11
A,09H
M,A
;COI"PARE KEY "S"
;JUMP IF NOT "5"
;ADJUST DSPLY POINTER
;IF • 4, MOVE 00H TO A
;COMPARE KEY "INC"
;JUI'I:P IF NOT "I!\IC"
;LOA::l DSP:..Y !'\ODE
;CLEAR H
;<DSP~Y
MODE>•:S
; BUFFER ADDR. IS II\; HL
;COM~ARE KEY "DEC"
;JUMP IF NOT "DEC••
56
ISIS-II
808~/8085
LOC
OBJ
e3e2
1.3BS
1398
13B9
i13BB
03BE
03C1
03C4
03C5
03C6
03C7
03CA
03CD
03CE
03:1='
0.3D!
03D2
03D3
0304
0305
0307
0308
03DB
030C
030E
03E1
03E4
03E7
03EA
03ED
03EE
03F'0
03F3
03F6
03F9
0.3FC
03FD
03FE
i1400
0401
0402
il403
0404
i1406
e407
I411A
1408
040C
0400
1410
0413
0416
0417
0418
04!9
CD6904
C3SE04
78
FED0
C2SE04
CD7306
215120
23
7E
A7
F2E703
215120
7E
2F
C601
4F
23
7E
2F
CE0~
47
C21004
7'3
FEE7
CA0704
DA0704
C3~004
C2!0r214
215120
7E
FEE7
CAF'303
OAF903
C31004
215120
7E
2F
C601
4F
23
7E
2F
CE0il
47
211tc2e
71
23
71
CJSEII4
CDA404
213C20
23
23
23
7E
MODULE
MACRO ASSEMBLER, V4.1
12
SOURCE STATEMENT
LINE
60S
£0£
607
608
609
610
611
612
613
614
615
616
617
618
619
620
60::1
622
£23
624
625
626
627
628
629
630
631
632
633
6.34
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
651
6:51
652
653
654
655
656
657
658
659
PAGE
KEY12a
CALL
JIIIP
MDV
CPI
JNZ
CALL
LXI
INX
MOV
ANA
JP
LXI
MOV
CMA
ADI
MOV
INX
MOV
CMA
AC:
MOV
JNZ
MOV
CPI
JZ
Cia
JC
JI'IP
JNZ
L.XI
MOV
CPI
JZ
C2:
C3a
Cit a
JC
JMP
LXI
MOV
CMA
ADI
MOV
INX
MOV
CMA
ACI
MDV
LXI
MDV
INX
MDV
JMP
CALL
LXI
INX
INX
INX
I'IOV
DSPi..V
KEV10
A,B
000H
KEY10
ATD
H,TEMP
H
A,M
A
C1
H,TEMP
A,M
1MOVE KEY DATA FRO~ B TO A
eCOMPARE KEY CAL
1CALL SUB. ATD
1CHECK POL.ARITY
tiF PLUS, JUMP TO C1
1IF MINUS, 2'5 COMPLEMENo
01H
C,A
H
A,M
01211-i
B,A
C4
A,C
0E7H
C3
C3
C4
C4
H,TEfllP
A,M
0E7H
C2
C2
C4
H,TEMP
A, Ill
;IF HIGH BYTE ) 0, JUMP TO C4
;COMPARE LOW BYTE TO E7n
; IF EQUAL, JU~P TO C3
; IF LESS, JUM;:l '!'0 C3
; IF MORE, JU:'IIP TO C4
;IF HIGH BYTE ) 0, JU!':P TO C4
;COI'IPA~E LOW BYTE TO E7H
;IF EQ~~:..., JUMP TO C2
1 IF LESS, JUMP TO C2
tiF MORE, JU~P TO C4
;2'9 COMPi..EMENT
01H
C,A
H
A, Ill
HH
I, A
H,PH7
M,C
H
eMOVE CBC> TO <PH7>
111,8
KEY18
CAL
H,PRO
H
H
H
A,l'l
tCAL.L. SUB. CALCULATE
;COMPARE HIGH BYTE TO 01H
57
MODULE
ISIS-II 8080/8085 MACRO ASSEM&LER, V4.1
LOC
OBJ
041A A7
FE01
0410 C:~5E04
0420 211
04'1 7E
0422 FE2C:
0424 C:A£004
0427 DA2D04
04'A C:35E04
0420 FE0E
04E:F CA3804
0432 D2381Z14
0435 C:35E04
0438 214020
043E< 3e..::c
0430 a3
043E 3E.~1
0440 213C20
0443 2.3
0444 23
044!; 0142~0
0448 7E
0449 00::
044A 23
044B 03
044C 7E
0440 02
044E CD03~5
045: 214420
0454 23
0455 014E20
0458 7E
045'3 02
045A 23
045& 03
045C 7E
0450 02
045E 3EC2
0460 320019
0463 F1
0464 01
0465 C:l
0466 E1
0467 FB
0468 C:9
04~£<
LINE
660
661
662
663
664
665
666
667
668
669 CS:
670
671
672
673 ce.:
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
E.89
E.90
691
69£
693
694
695
696
697 KEY10:
698
699
700
701
702
703
704
705 '
SOURCE
ANA
CPI
JNZ
DCX
MOV
C:PI
.JZ
.JC:
.JMP
C:PI
.JZ
.JNC
.JMP
LXI
MVI
INX
MVI
LXI
INX
INX
LXI
MOV
STAX
INX
INX
MOV
STAX
CA~L
LXI
INX
LXI
MOV
SiAX
INX
INX
MOV
STAX
MVI
ST~
POP
POP
POP
POP
EI
RET
PAGE
STATEME~T
A
01H
KEY10
H
A,M
2CH
C5
C5
KEY10
0EH
C6
C:6
KEV10
H,DD
M,2CH
1IF NQ; EQUAL 01H, JUM~ TO KEV10
ICOMPARE LOW BYTE TO 2CH
1IF EQUAL, JUMP TO C:5
1IF LESS, JUMP TO CS
;COMPARE LOW BYTE TO 0EH
;IF EQUAL, JUMP TO C6
1IF MORE, JUMP TO C:6
;MOVE 012CH TO <DO>
H
M,IZ!lH
H,PRO
;MOVE <<PRO>l TO <DR>
H
H
B,DR
A,r-:
B
H
8
...,., , .,..
B
o:v
H,QU
,cALL SUB. ~IVIDE
;MOVE <<OUll TO <CON>
1-i
B,CON
A,M
II
H
9
A,M
B
A,0C2H
tCLEAR FIFO
KCOI'I
PSw
D
B
H
706
707 ,' ••••••••••••••••••••••••••••••••••
708 I*
DISPLAY SUBROUTINE
•
709 , ..................................
710 '
0469 ES
046A C5
04E.B 05
711 '
712
DSPLV&
713
714
PUSH
PUSH
PUSH
13
H
B
D
58
MODULE
ISIS-II 8080/8085 MACRO ASSEMBLER, V4. 1
LOC
OBJ
04E.C
1460
1470
0472
0473
0474
0475
0476
0477
047A
I47B
0470
0480
048Z
0484
0485
0488
0489
04SA
0480
048£
0491
0494
0495
1496
0497
049A
049C
049e
04A0
04!:!
04AO:.
04A3
F5
3A2B20
04A4
04A5
04A6
04A7
04A8
I4A8
04AC
14AD
04AE
04lH
04B2
14B3
04Ec4
1485
0486
260~
EoF
29
29
85
EoF
0100C:0
09
3E90
320019
1605
0E0J
7E
3200l8
23
00
CA9404
05
C28404
C39F04
05
7E
A7
C2S504
JEFF
C3S504
F1
01
C1
El
C9
E5
C5
D5
F5
215120
4E
23
4£
214C:20
7E
81
4F
23
7E
ee
14
SOURCE STATEMEII:T
L:NE
715
716
717
718
719
720
721
722
723
724
725
72£
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
7:11
752
753
754
755
756
757
758
759
760
7£1
762
7£3
764
7£5
7££
7£7
768
769
PAGE
PUSH
LDA
MVI
MDV
DAD
DAD
ADD
MOV
LXI
DAD
MVI
STA
MVI
fi!VI
DSPLV1: I'IOV
DSPLVa: STA
INX
OCR
JZ
OCR
JNZ
JMP
DSPLV3: DCR
lf!OV
ANA
JNZ
MVI
JMP
os::~:...v4: POP
POP
POP
POP
RET
PSW
Dill ODE
H,I0H
L,A
H
tLDAD DSPLY MODE
sCLERA H
H
L
L,A
B,RBFR
B
A,90H
KCO!Il
B,05H
C,03H
A,M
KDA'rA
H
;BUFFER ADDR IS IN HL
tWRITE DSPL..Y
;DIGIT DSPLY COUNTER
;lf!OVE DA";A TO A
;lf!OVE <Al TO DSPL..V
c:
DSPLV3
B
DSP:...Y1
DSPLV4
8
A,M
A
OSCL.V2
A,0FFH
DSPLV2
PSI-:
D
8
H
I
,'....................................
CALCULATE SUBROUTINE
,&*.•..................................•
''
PUSH
CALl
PUSH
H
PUSH
PUSH
LXI
MDV
INX
MDV
LXI
MDV
ADD
MDV
INX
MDV
ADC
8
D
PSW
H,TEMP
C,M
H
sMDVE C <TEMP>) TO Be:
H,PH7
A,M
1 C <PH7> ) + <BC)
;STORE IN <BC>
.....
c
C,A
H
A,M
B
59
ISIS-II 8080/8085 MACRO
L.OC
0487
0496
04EIB
04BC
0480
04BF
04C0
04C1
04Ca
04C4
04C5
04C7
04CA
04CO
I4CF
0402
0405
0406
0407
0408
0408
040E
040F
04£0
04E1
04E2
04E3
14E4
04E7
04EA
04ED
04EE
04EF
04F0
04=-1
04F2
04F3
04F6
I4F8
04F9
I4FB
04FE
I4FF
1500
1501
OBJ
LINE
47
770
771
F2C0~4
79
2F
C601
4F
78
2F
C:E00
47
3EFF
325020
C3D204
3E00
32S020
214020
71
23
70
215A20
014220
7E
02
23
03
7E
e.::
CD0305
214420
0:.3820
7£
02
23
03
7E
02
213A20
3614
23
3605
CD7505
F1
D1
C1
E1
1502 C9
ASSEM8~ER,
PAGE
15
SOURCE STATEMENT
772
773
774
775
776
777
778
779
780
781
782
783
784
785 CAL.2:
786
787
788
789
790
791
792
793
794
795
79E.
797
798
79S
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
MOOi.JL.E
\14.1
MOV
JP
MDV
B,A
CAL.l
A,C
AOI
MDV
MDV
CI'IA
ACI
MDV
MVI
STA
JMP
MVI
STA
LXI
MDV
INX
MDV
LXI
LXI
MOV
STAX
INX
INX
MOV
STAX
CALL.
LXI
LXI
MDV
STAX
INX
INX
MDV
STAX
LXI
MVI
INX
MVI
CALL.
POP
POP
POP
POP
RET
11H
C,R
R,B
1IF PLUS. JUM~ TO C~-1
llF MINUS, 2' COI'I~~E~ENT
CMA
10H
8,A
A,0FFH
POL
CRL.2
A,00H
POL
H,DD
M,C
ISET POLARITY
1CLEAR POLARITY
II'IOVE RESULT TO <DO>
H
M,B
H,CON!
8,DR
;MOVE
t<CO~l>>
R,l'l
B
H
B
A,rw:
8
DIV
H,QU
B,MPD
;CALL SU9. DIVIDE
;MOVE RESULT TO <MPD>
A, !'I
B
H
B
A,M
B
H,MPR
M,14H
1MOVE 0514H TO <MPR>
H
M,ISH
MULT
PSW
1CALL. SUB. MULTIPLY
D
B
H
.
',,'................................
*
.................................
'
1*
TO <DR>
DIVIDE SUBROUTINE
1THIS SUBROUTINE DIVIDE 15 BITS BINARY WITH 15 BITS
1BINARY, THE QUOTIENT IS 15 BITS INTEGER A~D 8 BITS
1DECIMAL FRACTION
60
ISIS-II
LOC
8080/808~
08J
0503 E:i
C!5
050~ D:i
0506 F!5
0507 011000
0S0A 2A4220
0500 29
0~0E 04
050F 020005
0512 1602
0!514 7C
0515 lF
0516 67
0~~7 70
0518 lF
0519 6F
051A 05
0~1& lS
051C C:2140S
05~F E8
0520 C:i
0521 010000
0524 2A4020
0527 7C:
0528 BA
0529 DA.3F0S
052C C2340S
05.:.~ 10
0530 BB
053: DA3F0S
0534 A7
0535 70
0S36 98
0S37 6F
0~04
MACRO ASSEMBLER, V4.1
'
'
DIVa
RGTa
DIV1a
853
ass
sse.
8:57 DIV2a
8SB
8S9
860
0:538 7C
961
0~39
9A
053A
0S38
0:i3C:
053F
1541
1541
1!542
1:543
1!544
0:54:5
1546
0547
e!548
0!549
054A
11!54D
1!54E
67
37
C3400:i
A7
79
17
4F
78
17
47
29
E3
20
E3
CCZ705
E1
3E0F
862
863
864
865
866 DIV3a
867 DIVIta
869
870
871
872
873
874
875
876
877
878
879
16
PUSH
H
PUSH
PUSH
PUSH
8
LXI
8,0010H tS•COUNTER1 FOR Ill, C•COUNiER~
tMOVE <<DR>> TO HL
DR
H
tCHECK FOR LEADING ZERO
LHLD
C:NT1a
654
868
PAGE
SOURCE STATEMENT
LINE
82!5
826
8C:7
828
829
831
831
832
833
834
83S
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
MODU~E
DAD
INR
JNC:
MVI
MOV
RAR
MOV
MOV
RAR
MOV
OCR
OCR
JNZ
XCHG
PUSH
LXI
LHLD
MOV
CMP
JC
JNZ
MOV
CMP
JC
ANA
MOV
S8B
MOV
MOV
S88
MOV
STC
JI'IP
ANA
D
PSW
8
CNT1
D,02H
A,H
H,A
A,L
L,A
8
0
RGT
B
8,00H
DD
A,H
D
DIV3
DIV2
A,L
E
DIV3
A
A,L
E
L,A
A,H
tSHIFT 1 TO BC
DIV4
A
RAL
JIIOV
MDV
C,A
A,B
MDV
DAD
H
I, A
XTHL
XTHL
JNZ
POP
MVI
1IF LESS, JU~P TO DIV3
;IF MORE OR EQ~A~,
; < <DD> l - ( <DR> l
tSTORE IN <DD>
H,A
A,C
DCR
;MOVE DIVIDER TO DE
tSAVE COUNiERS IN SiAC~
;CLEAR <BC> FOR OWC:IEN:
;MOVE <<DD>> TO HL
;CO~PR~E HIGH BYTE
;OF <<DD> l 1'0 <<DR> l
;IF LESS, JU~P TO D!V2
tiF MORE, JU~P TO OIV2
;IF EQJA~, CO~PARE ~0~ BYiE
D
MOV
RAL
1SET DIVIDER 01XXX •••• XXX
,SHIFT 0 TO BC
,sHIFT LEFT HL,AOJUST <<DOll
,LOAD COUNTER2 FOR DECREMENi
L
DIV1
H
A,lllFH
tLOAD COUNTER1, ADJUST CCQU>l
tlllFH - COUNTER1
61
(1
ISIS-II
1080/808~
LOC
OBJ
11:5~0
~~~~1
94
67
11N00
A7
78
1F
47
79
lF
4F
7A
1F
:57
78
lF
SF
25
I:S:SZ
0555
esse.
0557
esse
0559
0S5A
0558
esse
0550
05SE
0~5F
05£0
05E.1
05£2
05£3 C25:5~S
05£6 214420
05£9 73
05E.A
23
0568 U:.
ese.c 23
0560 7l
0SE.E 23
0~E.F 70
0570 Fl
0571 Dl
057.:: Cl
057.::. E1
0574 C9
MODULE
MACRO ASSEMBLER, V4.1
PAGE
SOURCE STATEMENT
LINE
880
881
882
883 CNT21
884
88:5
886
887
sse
sue
H
H,A
D,00H
A
A,B
MOV
LXI
ANA
MOV
RAR
MOV
M0\1
RRR
M0\1
M0\1
RAR
MOV
MCV
RAR
MOV
DCR
JNZ
LXI
MOV
INX
MOV
INX
MOV
INX
MOV
POP
POP
POP
POP
RET
tCLEAR <<DE>> FOR
C,R
889
A,D
890
891
D,A
892
A,E
893
894
E,A
895
H
896
CNT2
897
H,QU
898
M,E
899
H
900
fi:,D
901
H
902
fi':,C
903
H
904
I'I,Et
905
PSio:
906
D
907
8
908
H
90S
910
911 I
912 I
913
MU~TIPLY SUBRO~TINE
914
*
915
916
TWO 16 BITS BINARY
917 1THIS SUBROUTINE
,.., 32MULTIPLY
SITS
91& ;THE PRODUCT
919 I
920 I
PUSH
H
921 MULTI
PUSH
B
922
PUSH
D
923
PSW
PUSH
924
C,leH
MVI
1SET COUNTER
925
PUSH
B
926
LHU)
IIIPD
tMOVE <<MPD)) TO DE
927
XCHG
928
MPR
LHLD
1MDVE C<MPR>> TD BC
929
MDV
B,H
930
1110\1
931
C,L
LXI
H,00H
I CLEAR <HL) FOR PRO
932
DAD
H
tSHIFT LEFT HL
933 MLT11
MOV
A,C
tSHIFT CARRY TO BC
934
'
E5
C5
D5
FS
8E18
C5
2A3820
EB
2R3A20
44
40
210000
29
79
DECIMA~
B,A
A,C
•..................................
,.,,...................................
11575
0576
11sn
0578
0579
8578
857C
857F
8580
0583
1584
0585
1588
0589
17
.....
'
62
ISIS-II
LOC
8080/808~
OBJ
158R 17
0~88
4F
0SBC 78
0580 17
IIS8E 47
0S8F D29BIIS
0592 19
11593 79
1594 CE00
0596 4F
11597 78
0598 CE00
0S9A 47
0~38 El
059C 2D
0590 E3
0S9E C2880S
05Al 223C20
05A4 2!3C20
05Ai 23
0SA8 23
05A'? 71
0SAA 23
liSA& 70
05AC C1
05~0 Fl
05AE Dl
0~PF
Cl
05&0 E1
~!;E~ C9
MACRO
ASSEM8~ER,
LINE
V4.1
SO~RCE
935
936
937
938
939
940
941
942
943
944
945
946
947
948 C:HCNT&
949
950
951
952
953
954
955
9SE.
9:57
958
959
9e.0
961
962
963
9E.4
9E.S ;
RAI..
MDV
MDV
RAL
JIIOV
JNC
DAD
MDV
ACI
MDV
JIIOV
ACI
JIIOV
XTHL.
DC:R
XTHI..
JNZ
SHL.D
LXI
INX
INX
MOV
INX
MDV
POP
POP
PO:J
POD
POP
RET
MODULE
PAGE
18
STATEMENT
aCHEC:K MSB OF C<MPR>>
C,A
A,B
B,A
CHC:NT
D
A,C
80H
C,A
A,B
1IF • e, NO ADD
1 1 IF • 1, <<MPD)) + (<PRO>)
1ADD CARRY TO BC
00H
B,A
L
MLTt
PRO
H,PRO
H
H
III,C:
H
M,B
8
PSW
D
e
H
966
'
967 , ••••••••••••••••••••••••••••••••••••••••
968 1*
BINARY TO BCD SUBROUTI~E
*
969
970
,........................................
'
'
0~C4
05C:3 67
78
971 aTHIS SUBROUTINE CONVERT 14 BITS BINARY INTO 4
972 ;DIGITS BCD
973
974
H
975 BIDEC& PUSH
PUSH
8
976
PUSH
D
977
PUSH
PSW
978
BIN
aMOVE <<BIN)) TO HL
LHLD
979
D,0000H 1CLEAR <DE>
980
LXI
cSET COUNTER IN B
MYJ
8,10H
981
MDV
A,L
1SHIFT MS8 OUT FROM <HL>
982 SHTI
RAL
983
MOV
L,A
984
A,H
MDV
985
RAL
986
JIIOV
987
JIIOV
aSHIFT MSB FROM CHI..) TO DE
988
05C:S 17
989
0582 E5
0~83
cs
05&4
0585
1586
0589
D5
FS
2A4820
118001
esse 8618
0S&E 7D
eSBF 17
05C0 6F
e5t1 7C
05C:2 17
'
RAL
63
ISIS-II
LOC
8080/808~ ~RC~C ASSEMB~ER,
OBJ
05C6 SF
05C7 7A
esce 17
05C9 57
05CA IDS
0SCB CA0'306
0SCE 3E0F
0500 A3
0501 FE05
0~03
DADE0~
0506 7B
0~07 C603
0509 SF
0!50R 7R
050£4 CE00
0~00 57
050E 3EF0
05E~ A3
05E! FE~0
05E3 DAC:E.zt5
0~ES 78
05E7 Ct.31l
05E'3 SF
05EA 7A
05E8 CE00
05ED 57
05EE 3E0F
05~""0
Aa
0'5F1 FE0~
05FZ DA!='A05
05F6 7A
05;::-7 C603
05F9 57
05FA 3EF0
05FC A2
05~='0 FE50
05FF DA8E05
0600::
/H
0603 C630
0605
0606
0609
060A
57
C3BE05
EB
224A20
0E.0D F1
060E D1
060F Cl
8610 El
8611 C9
LINE
SJU~:E
990
991
992
I'IOV
1'1011
RRL
993
994
JIIOV
OCR
995
JZ
996
MVI
998
999
1000
1001
1002
RNA
CPI
JC
I'IOV
ADI
I'IOV
1003
1'1011
997
1004
RCI
1005
1'1011
1007
1008
10;l3
11Z'10
ANA
CPI
JC
10ll
1012
AOI
I'IOV
I'IOV
ACI
I'IOV
I'IVI
ANA
CPI
JC
MDV
AD:
I'IOV
100£ FSia
1014
1015
10~£
SECt
1017
1018
1e!s
1020
1021
1022
100::3
THO:
1024
1025
1026
1027
10a9
1029
1030
U831
1832
IIIII I
~ov
11l.13
FIN:
IW!ODUt.E
V4.1
!IIIli
ANA
CPI
JC
I'!IOV
ADI
MOV
JMP
XCHG
SHLD
POP
PA~E
19
STR~EMENT
E,R
A,D
D,R
B
FIN
A,0FH
tDECREMENT COUNTER
tiF • 0, <DEl IS BCD
tiF NOT CHECK 4 LSB OF <tEl
E
0SH
FST
R,E
;IF THIS 4 BITS < 5 NO ADD
1IF NOT ADD 3
03H
E,R
A,D
00H
D,R
A,0F01"1
E
50H
SEC
R,E
30H
E,A
A,D
00'1
D. A
A,0FH
;IF THIS 4 B!TS
;!F NOT At:D 3
<
S
0~
ADD
;CHECK NEXT 4 8ITS
D
05""1
THD
A,D
03H
D,A
A,0F0H
: !F TH!S ., S!TS
1IF NO! ADD 3
;CHECK 4 1'158 OF <DEl
D
50H
SHT
~
n
~.-
;IF THIS 4 BITS <
;!F NOT ADD 3
~
NO ADD
30H
D,R
SHT
BCD
;SHIFT NEXT BIT OUT FRO~ CHL)
1SWAP C<DE>> RND CCHL>>
,I'IOVE <HL> TO <BCD>
PSW
1033
POP
1034
D
POP
1035
B
POP
H
1036
RET
1037
1038 I
1039 I
1040 , ........................................
1041 I*
BCD TO BINARY SUBROUTINE
*
104C: , ••••••••••••••••••••••••••••••••••••••••
1043 '
1144 1THIS SUBROUTINE CONVERT 4 DI3ITS B:O TO 14
64
IS~S-Il
~0:
0612
0613
0614
0615
0616
061 9
061C
061E
061F
0620
0621
0622
060::3
0624
06;;;~
0626
060::7
0628
06C::9
062A
06~B
06ac
062F
0E.3l
0632
0634
0637
0t.!&
063A
0638
063C
0E.3E
063;::'
0£41
0642
0644
0647
0t.48
064A
0648
064C
064E
I64F
0651
1652
16:54
0657
0658
065A
0658
0E.5D
16:SE
16E.0
8080/808~
OBJ
MACRO
ASSEMB~ER,
~INE
V4.1
MODUlE
67
3E=-0
A5
FE50
DA4F'06
1082
JC
SECA
7D
D630
6F
7C
DE00
67
lEaF
Alt
FE05
DA5806
7C
0603
67
3EF0
A4
FE50
DA1E06
1083
1084
1085
1086
1087
1088
1089 SECAa
1090
1091
1092
1093
1094
1095
1096 THDA:
1097
1098
10'39
MOV
SUI
MOV
MOV
SBI
MOV
MVI
31JH
L,A
A,H
00H
H,A
A,aFH
ANA
H
CPI
05H
THDA
A,H
E~
DC.~!
E.F
7C
DE0~
20
SOURCE STATEMENT
1045 ,BITS BINARY
1146 '
1047 DECBla PUSH
1148
PUSH
1049
PUSH
1150
PUSH
1051
LH~D
1052
LXI
1053
MVI
10~4 SHTAa
ANA
1055
MOV
1056
RAR
1057
MOV
1058
MOV
1059
RAR
1060
MDV
1061
MOV
1062
RAR
1063
MOV
1064
MOV
1065
RAR
1066
MOV
1067
DCR
1068
JZ
1069
MVI
1070
ANA
1071
CPI
1~72
JC
1073
MOV
1il74
su~
1075
MOV
1076
MOV
1077
SBI
1078
MOv
1079 FSTA:
MVI
108~
ANA
1081
CPI
C:5
D:5
F5
2AAA20
110000
0610
A7
7C
1F
67
7D
1F
6F
7A
1F
57
78
1F
5F
05
CA6A06
3E0F
A5
!='E05
DA31:"06
7D
PAGE
J'C
MOV
SUI
MOV
MVl
H
B
D
PSW
BCD
D,00H
B,10H
A
'MOVE <<BCD>> TO~
;C~EAR <DE>
,SET COUNTER IN B
,sHIFT ~58 OUT FROM
<H~l
A,H
H,A
A,~
L,A
A,D
;SHIFi
~58
FRO~
<H~l
TC DE
D,A
A,E
E,A
B
FINA
A,0FH
;DECREMENT COUNTE~
; IF • 0, <DE> IS BINARY
;IF NOT CHECK 4 ~SB OF <H~l
~
05H
FSTA
A,~
;IF THIS 4 BITS < 5 NO
,IF NOi S!.IBTR. 3
03H
~,A
A,H
00H
H,A
A,0F0H
;CHECK NEXT 4 BITS
~
50H
A,~
~3H
H,A
A,0F0H
AN~
H
CPI
JC
50H
SHTA
1CHECK NEXT 4 BITS
S~B7R.
65
ISIS-II
LOC
8080/808~
OBJ
0£63 7C
0630
0£66 67
0667 C31E06
066A EB
0668 224820
06E.E F1
0E.E.F Dl
0670 C1
0E.71 E1
0672 C9
~6€.4
MACRO ASSEME!:..;;:q,
LINE
1100
1101
1102
1103
1104 FINA:
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114 ;*
E~
c~
067~ D~
F~
0676
0677
0679
067A
0670
0£80
0681
0684
068~
0687
0688
0688
168D
068F
1690
0693
iB694
0697
869A
8698
869£
069F
86A1
86A2
KA!5
2£04
E~
21~120
3A0008
4F
3A0010
47
DEt0::2
A7
F2A706
160D
1EFF
10
C28F06
1~
C28D06
3A0008
~F
3A0018
!57
0822
A7
FAA786
42
061=16 48
e6A7 78
116A&E628
86AA C28Fe6
ee.AD 3E0F
KAF AI
0€.80 47
86Et1 79
0682 2F
MOV
SUI
MOV
JIW:P
XCHG
SHi...D
POP
POP
POP
POP
RET
A,H
30.;
H,A
SHTA
BIN
PSW
1SWAP <<DEll AND ((HL>l
II'IOVE <HLl TO <8I~l
D
8
H
,.........................•.......
A TO D
*
,.•...............................
1116
1117
PUSH
1118 ATD:
'
PUSH
1119
8
111~
0673
0£74
./4.1
SU~ROW71NE
H
PUS!"!
PUSH
MVI
PUSH
LXI
LOA
11~5 ATD4:
I'IOV
1126
LOA
1127
IIIOV
1128
IN
1129
ANA
1130
1131
JP
MVI
1132
1133 DELAV3: MVI
1134 DELAV4: DCR
JNZ
113!5
OCR
1136
JNZ
1137
LDA
1138
MOV
1139
LOA
1140
MDV
1141
IN
1142
1143
ANA
1144
JM
114!5
MDV
MOV
1146
MOV
1147 ATDl1.
ANI
1148
1149
JNZ
MVI
11!50
ANA
11!51
MOV
11!52
MDV
11!53
CMA
11!54
1120
1121
1122
1123
1124
D
PSW
L,04H
;SET COUNiER
H
H,TEMP
LBEN
C,A
HBEN
1MOVE DATA FROM AID TO BC
PORTE!
;CHECK AID STATJS
B,Q
A
ATD1
D,0DH
E,IFFH
;IF STATUS • 0, JUMP TO ATD1
1IF STATUS • 1, WAIT 3~ ~S.
E
DELAV4
D
DELAY3
LIEN
E,A
HI EN
D,A
PORTB
A
1MDVE DATA FROM AID TO DE
1CHECK AID STATUS
ATDl
I,D
C,E
1IF STATUS • 1, JUMP TO ATD1
1IF STATUS • e, MOVE <DEl TO BC
HH
1CHECK POLARITY
1IF NOT ZERO, JUMP TO ATD2
A, I
ATD2
A,IFH
8
B,A
A,C
1IF • 0, 2' COMPLEMENT
66
ISIS-II 8080/&08S MACRO ASSEMBLER, V4.1
LOC
OBJ
LINE
1683
1685
16EIE.
1687
1688
168A
(1688
16BC
168F
06C:I
06C1
06C3
06C4
16C!i
06CE.
06C7
06C8
06C9
06CC
06CO
0600
0602
0603
1604
0605
06DE.
0607
0e.oe
0609
0E.OA
060B
0E.DC
0600
16DE
ee.:: 1
06E3
06E4
06E5
06E8
16E9
06EC
16ED
06EE
16EF
16FI
16Fl
06F2
16F3
16F4
16F7
IE.FA
06F8
06F'::
16FD
06F'E
C601
77
78
2F
CEN
23
77
C3C:516
71
23
3EIF
1155
1156
1157
1158
1159
1161
1161
1162
1163 ATD2a
1164
1165
1166
1167
1168 ATD3:
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179 ATD5:
At!
77
23
E3
2D
E3
C27D0E.
E1
215120
1E03
4E
23
46
23
7E
81
4F
23
7E
88
47
10
CZD506
tE02
78
A7
F2EC0E.
37
C:3EE0E.
37
3F
lF
47
79
lF
4F
lD
C2El16
215120
71
23
71
Fl
01
MODULE
11H
M,A
A,B
... ft'l
ANA
A
1192
1193
1194
1195 ATD6a
1196
1197 ATD7a
1198
1199
12N
1211
1202
1213
1214
1205
1206
1207
1208
1209
JP
AT06
STC:
JMP ATD7
STC
CMC:
RAR
MDV
B,A
IIIOV
A,C
RAR
MDV
C,A
118~
~
......
22
SOURCE STATEMENT
ADI
MOV
MDV
CiliA
ACI
INX
MDV
JMP
MDV
INX
MVI
ANA
MOV
INX
XTHL
DCR
XTHL
JNZ
POP
LXI
MVI
MOV
INX
fiiOV
INX
MOV
ADD
MOV
INX
I'IOV
ADC
MOV
OCR
JNZ
fiiVI
MOV
1181
1182
1183
1184
1185
118E.
1187
1188
1189
1190 ATD81
PAGE
IIH
H
M,A
ATD3
M,C
H
A,IFH
B
M,A
H
;EXCHANGE STACK TOP WITH HL
L
ATD4
H
H,TEMP
E,03H
C,fll
H
B,M
H
A,M
c:
C,A
H
A,M
B
B,A
E
ATD5
E,02H
A,B
OCR
E
JNZ
LXI
MOV
INX
I'IOV
POP
POP
ATD8
H,TEMP
fii,C
H
M,B
PSW
D
;SET COUNiE!:i
;MOVE FIRST OPERAND TO BC
;ADD NEXT OPERAND TO 8C
tSET COUNTER
1CHECK POLAR ITV
1IF PLUS, JIJtiiP TO ATDE.
1IF MINUS, SET CARRY
tCLEAR CARRY
tROTATE RIGHT
tMOVE <BC> TO <TEMP>
67
ISIS-II
L.OC
8880/808~
OBJ
16FF C1
1700 E1
171Dl C9
MACRO ASSEMBLER, Y4.1
IIIDDULE
PAGE
23
SOURCE STATEMENT
LINE
POP
POP
RET
1211
1211
1212
1213
1214
I
H
','...........................
DATA IN ROM
1216 ,.
121~
1702
1704
1706
1707
1709
1708
170::
8170E
0710
0711
81713
1000
1211
04
Ieee
eae0
17
81000
0502
03
1000
1100
171~ 12
1716 0909
1718 1909
171A 09
1711111004
171D CSIZII
171C' C409
17C:1 6400
ln3 IF27
,...........................•
'
IH0H
1F MODE •
1217
1218
1219 '
1220 FIFRI'Ia
1221
1222
. 1223
1224
122~
1226
1227
1228
1229
1230
1231
1232
1233
1234
123:5
1236
1237
1238
1239
1241
DW
DW
DW
DB
DW
1102H
I4H
8001H
11eaH
17H
18001-!
DW
8120~H
DB
DW
DW
DB
13H
0000H
100lH
12H
1909H
1909H
19H
I480H
IICSH
09C4H
10£4H
270FH
DB
DW
DW
DW
DB
DW
DW
DW
DW
DW
END
12.CII0
IL MODE • 2.N
1C MODE • 2:5.H
10 MODE • 1.10
IE MODE • 99.99
1F
IL
IC
10
IE
BINARY
BINARY
&INARY
BINARY
BINARY
PU111.1C SYMBOl..S
EXTERNAL. SYMBOLS
USER SYI'IiOLS
ATD
A 0673
A 1£A7
ATD1
ATD2
ATD~
D
A 16D:5
AT DEi
A IE.EC
ATD7
A 1116EE
ATD8
A 16E3
BCD
BLKI'IOIJ A 11116E.
8
A 13E7
C1
A 1113F9
A 1407
C4
C2
C3
e
CAL
A lli4A4
A III4CD
CAL1
CAi..2
A 14D2
A 211122
CBFR
CB
CHK1
A 120:5
A 1221
6
CHK2
CNTl
A 1119D
CNT2
A IS:5S
CON
DEC& I A 1612
DELAY A IIIIAF
I
DEL.AY1 A 10B9
DEI.AV2 A IIBB
DELFIY3
DIVl
A 1:527
A 1:534
3
DIV2
DIV3
A r.i3F
DI\14
A I:S4111
DMODE
DSPi..V A 1469
DSP:..Yl A 0484
2
DSPL.V2 A 148:5
DSPI.V3 A 0494
DSPLV4
A 201E
FBFR
A 210:5
9
FB
FIN
A 1609
FBFRM A 171112
FINA
F
HBEN
A 1NIII
HDB
A 21:c
HDST
A2161
HTR
INTRPK
A N2S
KDATA A 1801
KCIJIII
A 1911
KEY
A 124D
KEV1
A 1311
KEY11
KEV2
A 132:5
KEY3
A 1331
8
KEY4
A I34A
KEYS
A 1341
KEV6
KEY9
A 1389
KEVIN A 1239
I
A 2120
L.BEN
A 1800
L.BFR
LB
L.TR
A 111124
JIIAIN1 A 10A3
1
I'IA1N12
IIIIAIN10 A 11A4
JIIAIN11 A llllAE
MAll\lS A I1ED
IIIAI!Ii~£ A 1111F3
7
I'IAIN4
I'IAIN2 A 10FF
MAIN3 A i11E
1'1AlN8 A 118£<
MA:N? A IU77
D
•
A 16BF
ATD3
A 1e.cs
ATD4
A 067
A 214A
BIDEC
A 1:5&2
BIN
A 21114
A 141111
cs
A 142D
C£
A 043
A 200F
CHCN'f
A i:l9&
-
'-"r"
A 02-Il
A 21114E
CON1
A 20:5A
DD
A 204
A HSD
DEI.AY4 A 168F
DIV
A
A 2028
DPTR
A 2e.::c
DR
A 204
A I49F
EB
A 211126
EBFR
A 201
A 866A
FST
A ISDE
FSTA
A 163
A 1034
lNTRPT A N24
lOST
A e,z,.::
A e4SE
KEV11
A 1381
KEY12
A 131
A 1368
KEY?
A 13:SA
KEYS
A 039
A 200A
L.DB
A 20:SE
I.DST
A 20£
A 01C4
I'IAIN13 A llCD
A 1'11:53
MAIN~
A 1167
... 1
I'IAIN14 A
1':.::111\i£
05~
0~0
A 0!6
~
.
68
JSIB-11 8080/8085
~ACRO ASSEM~LER.
V4.1
I'! PO
A 0191
MLT1
A 0588
A 2024
OBFR
A 2014
08
PH7
PI<EV
A 214C
ONOFF A 2020
PO~TB
PORTC A 00~3
A 1122
1
PRO
A C:044
RAIIIST
A 203C
au
e
RESET A 0000
RGT
A 0514
A 0274
R:.!l'll3
A 026F
RUN2
RUNl
E
SECA
A 064F
SHT
A 05~E
START A 0040
STPTR
SHTA
A 061E
THOR
A 0£58
TIMER A 0226
A
TST
A 2059
VALl
A 202E
VA'-.2
4
VAL.5
A 2036
MAJN9
s
RSSE~BLV
COMPLETE,
NO ERRORS
~OOULE
PAGE
24
A 2038
MPR
R 203A
MULT
A
A 212A
POL
R
PORTA
A 102
R 2000
RB
A 2028
RBFR
A 21M'
A 0286
RUN4
A 02Fl
SEC
RI5E
20FF
TEMP
A 2051
THO
A 05F
A 2030
VAL3
A 2032
VAL4
A 203
R
20~1
1~7
© Copyright 2026 Paperzz