ChenJin Hwa1988

CALIFORNIA STATE UNIVERSITY ,NORTHRIDGE
IBM PC BASED 50 MHZ LOGIC ANALYZER
A graduate project submit ted in partial sa tis faction of
the requirements for
the degree of Master of Science in
Engineering
by
Jin-Hwa Chen
May, 1988
The graduate project of Jin-Hwa Chen is approved:
Professor Gloria Helara
Dr'':' Yuh Sun
Dr.
Ro~ett
\
'
'
COIRillittee
Y. W!S'ng
I
Chai~tman
'..._,/
California State University, Northridge
11
Table of Contents
LIST OF FIGURES ••••••••••••••••••••.•••••••••.••..•.••• v
ABSTRACT ••••••••••••••.••••••••••••••••••••••••••••••• v 1
CHAPTER 1. INTRODUCTION •••••••••••••••••••••••••.•••••• 1
CHAPTER 2 • HARDWARE DESIGN •.••.•••••••••••••••••••••••. 3
2.1. Clock Generation ••••••••••••••••••••••••••••••• )
2.2. Input Buffering ....•••••••••
4
••••••••••••••••••
3
2.3. Data storage .•.••••••...••••••••••••••••••••••• 5
2.4. Generation of Trigger Position .••.••.•••••.•• 4.6
2.5. Generation of Trigger Word ..•••••••••••••••.••• 7
2.6. Control Signals Interface •••••..••••..•.••••••• 8
CHAPTER 3. SYSTEM OPERATION AND SOFTWARE CONTROL ••••••. 9
3.1. Logic Analyzer Interface ..••.•••••••••••••.•••• 9
3.2. Modes of
Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1.
Selection of Clock Source ••••••••••••• lO
3.2.2.
Selection of Clock Rate ••••••••••••••• 10
3.2.3.
Selection of External Clock Edge •••••• 10
3.2.4.
Setting of Trigger Word ••••••••••••••• 11
3.2.5.
Setting of Trigger Positlon ••••••••••• 11
3.2.6.
Completion of Setting All Parameters •• 12
3.2.7.
Data Displays .......................... 12
3.2.8.
Input Channel Name •••••••••••••••••••• 13
3.2.9.
State L 1st . • . • • • • . . . . . . . • . . . . . . ....... 13
3.2.10. Timing Diagram Display •••••••••••••••• 14
3.2.11. Repeat Mode of Timing Diagram .•....••. 15
i
l
iii
3.2.12. File Hanagement ••••••••••.•••••••••••• 15
CHAPTER 4. EXAMPLES OF OPERATION •••••••••••••••••••••• 17
4.1. An Example of Setting Trigger Condit1on ••••••• 17
4.2. An example of using state list ................. 18
4.3. An Example of Using Repeat Timing Hode •••••••• 19
4.4. An Example of Using External Clock •••••••••••• 20
CHAPTER 5. CONCLUSION • .••••••••••••••••••••••••••••••• 22
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3
APPENDIX A. SCHEMATIC DIAGRAMS •••••••.•.•••••.•••••••• 24
APPENDIX B. PROGRAM LIST ......•.•.•..••••..••••••.•••• 30
iv
LIST OF ·FIGURES
Figure A.l
Clock Generation Circuit •••••••••••••••••• 25
Figure A. 2
Input Buffering and Memory Circuit •••••••• 26
Figure A. 3
Address Generation Circuit •••••••••••••••• 27
Figure A. 4
Control Signals Interface Circuit ••••••••• 28
Figure A.5
Control Signals Generation Circuit •••••••• 29
v
ABSTRACT
IBM PC BASED SO ·MHZ LOGIC ANALYZER
by
Jin-Hwa Chen
Master of Science in Engineering
The objective of this project is to design and develop
a SO MHz logic analyzer which can automatically acquire
sampled data after setting required functions.
The logic
analyzer will provide the user with the means of developing
and debugging a newly designed circuitry and repairing a
improper functioned circuitry.
The logic analyzer is
flexible and relatively easy to use so that a diversified
number of needs and requirements can be met and satisfied.
In addition, the analyzer is very convenient for the user
since it uses the input and output interfaces of an IBM PC
to input commands and display results.
The sampling clock rate is selectable and has a range
from 2S KHz to SO MHZ.
Up to a maximum of 24 channels can
be used simultaneously and it can store up to 1024 words in
the memory.
Both timing and state functions are provided
so that the user can have a very good interpretation of the
acquired data.
The analyzer was designed and constructed.
results indicated that it performed properly.
vi
Test
CHAPTER 1
INTRODUCTION
Rapid advances in large scale integration technology
enable engineers build equipment capa·ble of performing
larger and larger logic functions.
In designing the
equipment, it has become extremely difficult for an
engineer to analyze and debug the equipment.
Although oscilloscopes still play an important role in
circuit analysis, they are more useful on the analog
circuits than on the digital circuits.
contains many digital circuits.
Digital equipment
Each circuit must produce
a proper sequence of signals in synchronism with the
outputs of the other circuits.
In order to verify that a
circuit is operating properly, its output waveform and
outputs waveforms of other circuits must be observed at the
same time.
Circuits involved memories, address
information, data bus 1nfozmation and information on
various part of the system must be examined over several
memory cycles.
Occurrences of fault conditions can be
detected by looking backward in time over the memory
cycles.
This project involves the design of a logic analyzer
to be interfaced with an IBM PC.
The analyzer is capable
of receiving and displaying up to 24 data channels at the
sampling rate up to 50 HHz.
1
The sampled data are stored in
2
the memory, processed and displayed on the monitor in
binary form, hexadecimal form, decimal form, or timing
diagram.
Also, the data can be stored in the diskette by
specifying a certain file name and can be retrieved later.
CHAPTER 2
HARDWARE OESIGN
2.1
Clock Generation
The clocks generated by the circuit are 50 MHz, 5 MHz,
1MHz, 500KHz, 100 KHz, 50 KHz, and 25 KHz.
A 50 KHz
crystal and a 74F04 inverter gate are used to generate the
50 MHz clock.
Due to the large time constant of the
inverter gate, a emitter follower is used to reduce time
constant to generate a 50 MHz clock with sharp leading and
trailing edges.
A 74F74 Flip-Flop gate is used to divide the 50 MHz
clock by two to generate a 25 MHz clock.
The 25 HHz clock
is fed into a 16R8 PAL to be divided by 5 or 25 to generate
a 5 MHz or 1 HHz clock.
The 1 MHz output is further fed
into a 16R8 PAL to be divided by 2, 10, 20, or 40 to
generate a 500 KHz, 100 KHz, 50 KHz, or 25 KHz clock.
action is controlled by a 8255 PPI through software.
The
A
78L05 power regulator is used to make the clock more
stable.
2.2
Input Buffering
Up to 24 channels of signals can be connected to the
analyzer.
Three cables with 28 clippers
~re
used for the
transmission of the signals.
There are two problems occur in the transaission of
3
4
high frequency signals.
First, the stray capacitor causes
coupling between two transmission lines to produce
crosstalk.
This problem can be solved by shielding each of
the lines.
The shieldings are then grounded to isolate the
signals.
The second problem is that there exists a voltage
difference between two ends of a line, due to the
inductance of the line.
To deal with this problem, the
input impedance is matched by the use of an input buffering
circuit.
Three 74F374s, octal D-type edge triggered flip-flops
with tri-state output buffers, are used as input buffering
circuit.
Also three 100 K Ohm resistor arrays are used to
increase the input impedance.
A 74F251 multiplexer is used
to gate the internal or external clock to the 74F374 flipflops.
The clock is used as triggering clock for the flip-
flops to latch the incoming signals.
As
to which of the
clocks will be used is controlled by 8255 PPI through
software.
The external clock is inputted to a 74F86 XOR gate to
form the external clock used by the analyzer.
A 100 K Ohm
resister is used to increase the input impedance of the
74F86 gate.
The 74F86 gate is also controlled by the 8255
PPI through software to specify the triggering edge of the
external clock.
5
2.3
Data Storage
There are total 24 channels.
1024 events each
channel can be stored in the memory to be processed.
The
analyzer has to process signal up to 50 MHz, which is
equivalent to process data within 20 nano-second.
The IBM
PC XT or AT with operating speed of only 8 MHz can not be
used to process the data.
A~thod
of
~rocessing
the data
in re.al time involved the design of high speed hardware.
High speed RAMs are used and the address for these RAMs are
generated by high speed counters to achieve the data
processing requirement.
Six 2148s, 1024 X 4 high speed static RAMs, are used
to store the acquired data and are capable of storing data
up to 1024 X 24 words.
The access time for the 2148 is 20
nano-second.
Three 74F161s, high speed counters, are used to
generate the address of the 2148 RAMs.
These three
counters are cascading together so that they can count up
to 4096.
Since only 1024 counts are needed, the last two
bits of the last
co~nter
are ignored.
The counters are
triggered by the output of a 74F251 multiplexer .which gates
the selected clock rate through a 74F04 inverter to form
low to high pulses for the rising edge triggered counters.
The output enable of the_ 74F374 flip-flops and the
write enable of ·the 2148 RAMs are connected together to
enable the latched data be written to the memory.
This
control line is active when a trigger word is matched.
6
2.4
Generation of Trigger Position
The trigger position can be set at any multiple of 64
boundary within the 1024 memory locations.
When debugging a system, condi-tions after trigger
point and conditions prior to the trigger point must be
known.
With this in mind, a circuit was designed to allow
the viewing of different length of pre-trigger data and
post-trigger data.
Three 74F161s, counters with pre-load capability, are
used to fulfill this requirement.
These counters are pre-
loaded with trigger position value which is controlled by
the 8255 PPI.
As long as the trigger condition is met,
these counters start to count up with the clock from the
74F251 multiplexer.
At the beginning, when the trigger
condition is satisfied, the outputs of these counters are
not all "high" which causes the output of the 748134 gate
"high".
Through an inverter, this output becomes "low"
which is used to enable the latched data to be written into
memory.
After these counters count up to all "high", the
output of 748134 gate becomes "low" which will disable
74F374 flip-flops to output the latched data.
Data is
prevented from written into the 2148 RAMs. At .this· moment,
the counters continue to count up.
A command is issued
from the 8255 PPI to disable the 748134 qate.
After the
74S134 gate is disabled, it will become floating.
A 330
Ohm resistor is used to pull the output to "low" to ensure
the proper operation.
A 47 pf capacitor is used at this
1
point to minimize hiqh frequency noise.
2.5
Generation of Trigger Word
All 24 channels of the analyzer can be set to a
trigger condition of "1", "0", or "don't care".
After the
trigger condition is met, the counters will start to count
for a certain length of time according to the trigger
position.
The trigger word selected by the user is using as
address to set the corresponding location to "1" and all
other locations to "O".
The "don't care" bit is cleared to
"0" for the address generation.
When the incoming word is
the same as the trigger word, the memory outputs the preset
"1" to start the proper operations.
Two 2141s, 4096 X 1 static RAMs, are used to set
trigger word.
The trigger word location is set to "1"
through the 8255 PPI by software.
of each 2141 is 12.
The address line number
With two 2147 RAMs, 24-bit trigger
words can be recorded.
When the incoming word matches with the selected
trigger word, both the 2147 RAMs will output "1" to start
proper operation.
Twenty four 21 Ohm resisters are used to
prevent the damage of 8255 PPI and 74F374 flip-flops when
both of them are in output mode.
8
2.6
Control Signals Interface
Two 8255 PPis are used to generate all the control
signals and the trigger word through software controls.
A
PAL is used to decode the I/O address for inputting the
counters' condition to the IBH PC to start certain
operation.
A 74F74, D-type flip-flop, is used to start the
counting of the three trigger position counters and keep
them active.
CHAPTER 3
SYSTEM OPERATION AND SOFTWARE CONTROL
3.1
Logic Analyzer Interfaces
The system was designed easy to use.
There are on
screen manuals displayed on the monitor for the user to
follow.
All procedures are controlled by a BASIC program
running in the IBM PC.
Listings of software is shown in
Appendix B.
The procedures of installation are as follows:
1)
Turn the IBM PC XT or AT system power off.
2)
Open the cover of the IBM PC.
3)
P~ug
the logic analyzer interface card in an empty
expansion slot.
4)
Close the cover of IBM PC.
5)
Insert the system program diskette into drive A.
6)
Turn the IBM PC XT or AT power on.
7)
After the installation procedures are completed, the
monitor displays the manual on screen.
3.2
Hodes of
Operation
After booting the system, follow the instructions that
are shown on the screen.
The details are described ln the
following subsections.
9
10
3.2.1
Selection of Clock Source
There are two kinds of clock source.
The first one is
internal clock source which samples data asynchronously.
The second clock source is external one which samples data
in a synchronous way.
Users can depress "s" to enter the
mode of selecting clock source at any time.
Use function
key "F1" to select internal clock source and function key
"F2" to select external clock source.
3.2.2
Selection of Clock Rate
There are seven different clock rates can be selected
by the user when the clock source is in internal mode.
The
clock rate selected should be higher than the frequency of
the incoming signal.
otherwise, the input control changes
can be missed and therefore ignored by the system.
Generally, if the sampling rate is at least five times
greater than the data rate, then resolution is probably
adequate for functional timing measurements..
Press "r" to
enter the mode of selecting clock rate at any time.
function key "F1", "F2", "F3",
"F4"~
Use
"F5", "F6", or "F7" to
select clock rate of 50 HHz, 5 MHz, 1 HHz, 500 KHz, 100
KHz, 50 KHz, or 25 KHz correspondingly.
3.2.3
Selection of External Clock Edge
Two different clock edges can be selected by the user
when the clock source is in external mode.
Use function
,key "F1" to select the rising edge which means that the
' .
11
system samples the data at the low to high transition of
the external clock.
Use function key "F2" to select the
falling edge which means that the system samples the data
at the high to low transition of the external clock.
The
frequency of the incoming signal should be less than 35 HHz
when the clock source is in external mode.
3. 2. 4"
Setting of Trigger Word
The logic analyzer can be triggered with an ANDed
condition on the inputs of highs, lows and "don't
cares,"but only when the data are sampled.
The trigger
word is twenty four bits with each bit can be set to high,
low, or "don't care."
Press "w" to enter the mode of
setting trigger word at any time.
Use the arrow key
to move the cursor of trigger bit to right.
"->"
Use the arrow
key "<-" to move the cursor of trigger bit to left.
Use
function key "Fl" to set "0" (low) for the corresponding
channel.
Use function key "F2" to set "1" (high) for the
corresponding channel.
Use function key "F3" to set "x"
(don't care) for the corresponding channel.
key "F4" to set "x" for all channels.
Use function
Use function key
"F5" to enter the trigger word.
3.2.5
Setting of Trigger Position
The memory depth is 1024 words.
24 bits per word.
The memory width is
The trigger position is adjustable which
means that the sampled data length is adjustable with
12
reference to the trigger position.
Users can observe the
sampled data both before and after the trigger position
with maxi-mum length of .1 K..
Press "p" to enter the mode of
setting trigger position at any time.
to move the trigger position right.
move the trigger position left.
"->"
Use arrow key "<-" to
Use arrow key
Use function key "Fl" to
enter the trigger position.
Completion of Setting All Parameters
3.2.6
After the completion of setting all parameters, the
logic analyzer is ready to capture the data.
A question
will be asked : "Are you ready ?" Use function key
"Fl"
(YES) to start capturing data or press "c" to start
capturing data at any time.
Use function key "F2" (NO) to
return to the setting of trigger position if some changes
are going to be made.
Use fu-nction key "F3" (SKIP) to
enter the mode of ways of displaying previously captured
data.
After "Fl" (YES) has been depressed, the system will
either enter the mode of ways of displaying captured data
or be trapped by the unmatched trigger word.
Depress "0"
to leave the trapped loop.
Data Displays
3.2.7
There are two methods to display the captured data.
First, the system can display the captured data in state
list form.
The state list can display the whole 1 K memory
13
in the forms of ASCII codes, hexadecimal, decimal, and
binary values.
And both the state before and after trigger
can be displayed.
The second way to display .the captured
data is timing diagram.
The timing diagram displays a
waveform diagram representing the contents of the timing
analyzer memories.
After the data is captured, a question will be asked:
"Select a function to display the captured data."
Use
function key "Fl" (STATE) to select the state list.
Use
function key "F2" (TIMING) to select the timing diagram.
Use function key "F3" (FILES) to process the files.
3.2.8
Input Channel Name
The logic analyzer allows users to input a five-
character mnemonic for each channel.
are "O - 9", "a - z", and "/".
a mnemonic.
3.2.9
The valid characters
Enter "return" to conclude
Press "n" to enter this mode at any time.
State List
The numbers in the state list represent the sampled
data.
Each line represents one sampled data.
The data can
be in terms of binary, decimal, hexadecimal, and ASCII
codes.
The whole state list can display up to 1024 sampled
data which can be the data before or after the trigger
point.
Use function key "Fl" (DOWN) to view next line of
14
sampled data.
Use function key "F3" (UP) to view previous
line of sampled data.
Use function key "FS" (PG DN) to
view next page of sampled data.
Use function key "F7" (PG
UP) to view previous page of sampled data.
Use function
key "F4" (EXIT) to exit the state list to -main manual.
3.2.10
Timing Diagram Display
A timing diagram is provided to display the sampled
data.
Use key "t" to enter the timing diagram mode at any
time.
There are two vertical cursor lines which allow user
to measure the time between them when in the internal clock
mode, and to measure the clock cycle between them when in
external clock mode.
The time or the clock cycle number
between the two cursor lines will be displayed on the top
of the second cursor line.
Use number key "1" to select cursor line 1 "on" or
"lock" alternatively.
The cursor line 1 can be moved
horizontally around the screen when it is in the "on" mode.
The cursor line 1 will be fixed in the screen position and
the screen can be moved across the 1K memory area when it
is in the "lock' mode.
Use key
"->" or "<-" to view
different position in the memory for cursor line 1.
Use number key "2" to select cursor line 2 "on" or
"off" alternatively.
The "on" or "off" function allows
user to select whether the second cursor line will shown on
the screen or not.
The moving- speed of the two cursor lines can also be
15
selected by using key
"+"
or "-"
A vertical line is also provided to indicate the
occurrence of a trigger condition.
The timing scale can also be enlarged by a factor of
1,2,4,8#16,32, or
6~.
Use key "I" to enlarge the timing
scale, and key "D" to shrink the timing scale.
The corresponding position of the timing diagram in
the 1k memory map is highlighted in bottom of the diagram.
Use "Esc" key to exit the timing diagram.
3.2.11
Repeat Mode of Timing Diagram
The timing diagram can be displayed in a continuous
way to represent the contiguously sampled data.
acquisition rate is one sample per second.
to enter the repeat mode.
The
Press key "E"
Press key "A" to enter the
repeat mode with trigger.
The display parameters of the repeat mode timing
diagram can only be changed by going through the timing
diagram mode.
3.2.12
Use key "Esc" to exit the repeat mode.
File Management
A file management function is also provided.
The
sampled data including state list and timing diagram can be
stored in a diskette.
Also a state list and timing diagram
file can be loaded from a diskette to display on the screen.
in either form.
Use function key "F1" (DIR) to list all the files in
16
current disk drive.
Use Function key "F2" (DELETE) to delete a file from
the current disk
~rive.
Use function key "F3" (RENAME) to rename a file from
the current disk drive.
Use function key "F4" (SAVE) to save all the settings
and sampled data including the state list and timing
diagram to the current disk drive by giving a file name.
Use function key "FS" (LOAD) to load a state list and
timing diagram file from the current disk drive.
Use function key "F6" (STATE) to display the previous
loaded file in the state list form.
Use function key "F7" (TIMING) to display the previous
loaded file in the timing diagram form.
Use function key "F8" (HELP) to display information
about the menu.
Use Function key "F9" (EXIT) to exit the file
management function to main menu.
CHAPTER 4
EXAMPLES OF OPERATION
4.1
An Example of Setting Trigger Condition
The trigger condition setting is critical for hardware
debugging.
This allows the user to see the timing
variation when the specified conditions occur.
The example presented here is to catch the interrupt
signal generated by a peripheral chip to 80186 CPU.
sec,
The system under test is a Z8530
Serial
Communication Controller, interfaced with 80186
microprocessor system.
An interrupt signal is expected
whenever the Z8530 transmitter buffer becomes empty.
The
interrupt signal will appear on 80186 INTl control line.
The procedures are as follows:
1.
Select the internal clock source.
2.
Select 50 HHz clock rate since the timing for
sec
is
several hundred nano-seconds.
3.
Hook the analyzer channel 0 clipper on INT line of
and ground clipper on
sec
sec
ground line, and hook the
other clippers on the signal lines that we want to
see, for example, channel 1 for
for
4.
sec
sec
CE line, channel 2
RD line.
Select the trigger word.
In this case, the trigger
word selected is all "don't care" except channel 0
with "0" since the INT generated by SCC is active low.
17
18
5.
Arbitrary select the trigger position at "255".
6.
Select "Capture" to start the acquisition.
7.
If there is any interrupt occurs, it will acquire
by the analyzer and store in the memory.
Otherwise,
the analyzer will walt for the trlqger.
8.
Select "Timing" to see the result in timing diagram
form.
9.
Save the result in a diskette if needed.
4.2
An example of using state list
In the previous example, after making sure there is
interrupt generated, we might want to see the interrupt
vector presented by the SCC.
This time the interrupt
acknowledge signal is using together with RD signal as
trigger condition.
1.
The procedure are as follows:
Hook the analyzer channel 3 clipper on INTACK line of
sec.
Hook channel 8 clipper on DO of
sec, channel
9
on Dl, channel 10 on D2, channel 11 on D3, channel 12
on D4, channel 13 on D5, channel 14 on D6, channel 15
on D7.
2.
Follow the setting of previous example.
3.
Change the trigger word as follows: "O" for channel 2
and channel 3, all other channels are "don't care".
The reason is that the interrupt vector from
be valid when both INTACK and RD are active.
4.
Select "capture" to start the acquisition.
5.
If the signals meet the trigger condition
sec will
19
requirements, they will be acquired by the analyzer
and stored in the memory.
Otherwise, the analyzer
will wait for the trlqger.
6.
Select "State list" (L) to see the interrupt vector at
the trigqer point in either binary or hexadec1Dal
form.
7.
Save the result in a diskette if needed.
4.3
An Example of Usinq Repeat Timinq Mode
The repeat timing mode is very useful when we want to
see the waveform continuously.
The example presented here is to see the refresh
timing of a dynamic RAM circuit.
4464s.
The dynamic RAMs used are
The refreshment of the dynamic RAM is done by RAS
without CAS siqnal and there should be 256 refresh cycles
within 4 mini-second.
These signals are generated by 80186
HCS lines and some interface circuits, the refresh signal
is controlled by the DMA controller inside 80186 chip.
By
accessing the dynamic RAM continuously, the changes of RAS,
CAS, WR, MUX, and other important siqnals can be displayed.
These are are done to see if the refresh signal generated
can fulfill the timinq requirements all the time.
The
procedure are as follows:
1.
Hook the analyzer channel 0 clipper on the RAS signal
line, and hook channel 1 clipper on the WR siqnal
line, and hook channel 2 clipper on the CAS signal
line, and hook channel 3 clipper on the HCS2 line
20
which is used to generate the refresh signal.
2.
Select the internal clock source.
3.
Select SO KHz clock rate.
4.
Select the trigger word as "0" for
HCS2 line, and
"don't care" for all other channels.
5.
Select the trigger position at 255.
6.
Select "capture" to start the acquisition.
7.
Select "Repeat" to see the changes continuously.
8.
With the waveform, we can see the RAS only signal and
determine if it can fulfill the timing requirement.
4.4
An Example of Using External Clock
Signals generated can be synchronized with a external
signal.
The external signal is used as external clock
source for the acquisition.
The example presented is to see the address generated
by 80186 CPU when a certain memory location is accessed.
The ALE signal generated by 80186 CPU will be used as
external clock.
1.
The procedure are as follows:
Hook the analyzer channel 0 through channel 15
clippers on the latched address lines AO through A15
correspondingly.
line.
Hook the clock clipper on the ALE
.Hook the three ground clippers on the ground
lines.
2.
Select the external clock source.
3.
Select ALE "1" as trigger word condition.
4.
Select the trigger position at.25S.
21
5.
Select "capture" to start the acqulsltlon.
6.
Select "State llst" to see the address generated by
80186 CPU.
CHAPTER S
CONCLUSION
This report described the design of a SO MHz logic
analyzer based on an IBM PC.
be up to SO MHz.
The sampling clock rate can
The system is good for testing circuits
with operating speed up to 10 HHz since the sampling clock
rate is 4 to 5 times greater than the incoming data rate.
The system has the capability of displaying data in both
timing diagram and state list forms.
Also, it can
synchronize with the external clock.
The system can accept
up to 24 channels and have the capability of storing data
up to 1024 words.
The analyzer is easy to use since it
incorporates the convenience of inputting operations with
keyboard and displaying results on monitor with an IBM PC.
Also, on-screen menu is used to guide user to operate the
analyzer.
22
REFERENCES
IBM PC Technical Manual
IBM Corp., 1983
Memory Data Book : NEC Electronics Inc., 1985
TTL Data Book : Texas Instruments Inc., 1984
HP Logic Analyzer Manual
HP Corp., 1986
23
APPENDIX A
SCHEMATIC DIAGRAM
24
r----------------------------50M
C26
2
4PF
U16
74F04
r
1 1'-x-2
1
U16
74F04
s ~6
1
1
12
lo
al
c
11
8
CL
~
~
3
+S
50 MHZ
lSP
C'l4
l20PF
C43
U25
PAL16R8
r-------2SK-500K
..-----1 f1-5M
16R8_C
~,
16R8-B
3
16R8_A
2
16R8_C
16R8_8
16R8_A
~
31
2
CK OE
OE
T1 1'11
1
T1
1
SHEET 1
Clock Generation Circuit
N
U'l
U9
2148
U"'
21"18
Wl
CSl
MA9 15
16
MAS 17
MA7
1
MA6
2
MAS 3
MA"'
MA3
7
MA2
6
MAl
MA0 s
"'
CH7
CH6
CHS
CH-4
CH3
CH2
CHl
CH0
CKl
OEl
Wl
CSl
JIN-HWA CHEN
SHEET 2
Input Buffering and Memory Circuit
N
en
Ul"'
21"18
C02
C02
C022
C023
Wl
CSl
+5
...__ _..._+5
CK2--~
CH23
CH22
CH21
CH20
CHl'
CH18
CH17
CH16
-
CK2
CKl
OEl
Wl
CSl
t
+5
U2
R30
M
I
+5 9
CK2
+5
22
F251Z
JIN-HWA CHEN
SHEET 3
Address Generation Circuit
N
~
U16
EXTERNAL CLOCK
+5--<~r---~
74F04 R4
y~
wj:>L
F25l_[
l
. 1117
2
. ]
·I
0
~4-~l~
+
CTRL1
12
Wl
R29
1
lK
S_l5
~--~s
L U12
ao
CK2
1
C14
+47P
Ul6
P-E4F04 DEl
13
.--~~s_7;..,4F
~a -47
.O.AA
,,
3
12
13
.
74F04 R3
C22
47PF
~4+~2~
CKl
U16
l4>
'+5
11
~
-=.
t---F251Z
-
~
161
11
QC 12
QB 13
Qf'l 1-4
CL 1
+5
E
p
12'~ 17
Ul9_S
..
JIN-HWA CHEN
I
SHEET 4
Control Signals Interface Circuit
N
CD
.
U27
82SS
507- +tr-07
28
S06 "'\ 29
06
sos ""\ 30 OS
so~
' \ 31 O~
S03 "\ 32 03
502 ""\- 33 02
SOL ""\ 3-4 01
500
00
PA7
PA6
PAS
PA4
PA3
PPI2
PAl
PA0
37 C023
38
39 C021
U22
C022
...
12
13
14
1S
16
17
6
S
4
3
2
v
VV'r
C:020 JvVv
~0
L
2
3
.
AAA
C019
.,
C017
vv
C:018 JvVv
C:016 -1\N· COlS
PC7 ~
I C013 · y v v
PC6 11
CD12
I
PCS 12
13
I
PCo4
co 1L J../11'
PCJ 17
CD10 vvv
PC2 16
C09
lS
PCl
CDS · y y y
PC0 14
CD7 J.AA
PB7 25
CD6
2-4
PB6
"
. cos ·yy
23
PBS
C04
PB-4 22
C03 ·vvv
PB3 2L
C02 · y y y
20
PB2
COL
-¥l'v
19
PB1
C00
PB0 L8
C0!-4
.,
·vv....-
1
.
.
lOR
lOW
SP11
5A0
R5T
C52
~
""'\ 36
5
""'\ 8 [:JJf
""'\ 9 Al
"'\ 35 1'10
RST
6 e-s-
27 OHM
*
U26.
82SS
07
21~7
:::u:z_
~06.
RtH 1
RA10
RA9
RPI8
RA7
RA6
RAS
RPI-4
RA3
RA2
RAl
~OS
::ill
04
~03
i::\1[ 02
~01
WE~
l
PC7 ~S-15
PC6 ~CTRL2
PCS ~
PC4 13
tJ
0 [ ll
.RA0
DO
21-47 U23
I
00
cs~
LOTI()
PC3 ....UcsL
PC2 ._!.2
1S
PCL ~F251_B
PC0 ~F25l_C
L.g RAll
L.g RPI10
14
1s
16
17
6
s
-4
3
2
1
RP19
RPI8
RA7
RP16
RPIS
RPI-4
RAJ
RP12
RAl
RA0
PA7 ~OCOUNT
38
PA6 ~EX-RF
PAS !--=-=PA4 ~
1
PA3 T16R8_A
PA2 T16R:8_8
PAL ~16R8-C
PA0 i-!-F251-I
1m"
~
tv #'11
cs ~
WE B
01 11
tDO ~DTL
mf
A0
~6 RST
,...:- ~
PB7 25
PB6 24
PBS 23
PB4 ~F-AL
PB3 ~F B
20 PB2 ~F-A
PBL ~F-0
PB0 ~F-C
2-4
CS3
Jll'l-HWA CHEN
SHEET S
Control Signals Generation Circuit
N
U)
APPENDIX B
PROGRAM LIST
30
Logic Analyzer Control Program
1 CLS
2 PRINT:PRINT:PRINT:PRINT:PRINT
~ PRINT "GRADUATE PROJECT:
50 MHZ LOGIC ANALYZER BOARD "
6 PRINT: PRINT: PRINT "
~JIN-HWA CHEN"
10 CLEAR ,53152!:ASMADS=53152!:ASMAD1=53155!:ASMAD2=53158!:TYT=592
15 CMCARD=PEEK(126~)
20 DEF SEG=&H2000
30 BLOAD "LOMS", &HO
t-t,O CALL TYT
50 IF PEEK(126~)=0 THEN DEF SEG:BLOAD "L.M",ASMADS ELSE DEF SEG:BLOAD "L1.M",AS
ADS:OUT &H3BF, 3
55 FOR I=1 TO ~OOO:NEXT I
60 DEF SEG=&H2000
70 OUT 995, 128:0UT 999, 128:0UT 1003, 128
80 CMCARD=PEEK(126~)
91 ASMAD1=53155!:ASMAD2=53158!:ASMADS=53152!
9~ ACHM=&H109
'HARDWARE MEMORY->SYSTEM MEMORY'
95 ACMD=&HO
'MOVE
MEMORY IN SCREEN TO BUFFER'
96 ACMU=&H3D
'MOVE BUFFER TO MEMORU IN SCREEN'
97 ACSU=&H7A
'STATE SCROLLING UP'
98 ACSD=&HB1
'STATE SCROLLING DOWN'
99 ABC=&H27A 'TRIGGER SET
110 ABZ=O:REPETER=1:FLOA=O
210 DIM G(50):DIM H(30) :DIM 0(30):DIM P$(30):DIM C0(30)
215 FOR C=O TO 2~:H(C)=O:G(C)=O:NEXT C
220 FOR I=1 TO 23:H(I)=O:G(I)=O:NEXT I
230 FOR 1=0 TO 23
2~0 P$(1)="
CH ":POKE 1287+1115, 3?:POKF. 1?88+1115, 32:POKE 1289+1115,67:POKE 1290+
II 5' 7 2 : POKE
1 2 9 1 + I II 5' 3?.
250 NEXT I
....
310
Q10
510
610
710
715
720
KEY ON
A:O:B:O:C:O:D:O:E:O:F:O:l.:O:M:Q:Mt~O:AD:O:AE:O
CLS
LOCATE 1,20
PRINT "GRADUATE PROJECT: 50HHZ LOGIC ANALYZER CARD "
PRINT "
JIN-HWA CHEN "
LOCATE 22, 1, :PRINT "(C) CAPTURE
(N) CHANNEL NAME
(L) STATE LIST
(T) TIMING
(F) FILES
(E) REPEAT
(A) REPEAT WHEN
RIGGER"
810 FOR 1=1 TO 10:KEY I, "":NEXT I
910
FOR 1=1 TO 14 :KEY (I) OFF :NEXT I
1010 KEY 1, "INTERNAL"
1110 KEY 2, "EXTERNAL"
1 2 1 0 LOCATE 3, 1
1310 PRINT "(S) CLOCK SOURCE:
":LOCATE 3,19
1410 KEY (1) ON:KEY (2) ON:KEY (14) ON
1510 ON KEY (1) GOSUB 1910
1610 ON KEY (2) GOSUB 2010
1710 ON KEY (14) GOSUB 2110
1810 GOSUB 65200:LOCATE 3, 19, t:GOTO 1410
1910 LOCATE 3, 18:PRINT "
INTERNAL
:A:1:RETURN 2210
2010 B=20:LOCATE 3, 18, 1:PRINT"
EXTERNAL":LOCATE 4, 1, 1:PRINT"
":A:2:RETURN 5110
2110 IF A=O THEN RETURN 1510 ELSE IF A=2 THEN RETURN 5110 ELSE RETURN 2210
2210 FOR 1=1 TO t4:KEY(I) OFF :NEXT I
2310 LOCATE 4, 1,0:PRINT "(R) CLOCK RATE:
"
2510 KEY 1, "":KEY 2, "50MHZ":KEY 3, "5MHZ":KEY 4, "1MHZ":KEY 5, "500KHZ":KEY 6, "100
HZ":KEY 7,"50KHZ":KEY 8, "25KHZ"
2610 LOCATE 4, 17
2 '11 0 F'Of< I:: 10 TO 14: KEY (I) OFF: NEXT I: KEY ( 11) ON: KEY ( 14) ON
w
....._,
2810
2910
3010
3110
3210
3310
3410
3510
3710
3810
3815
3910
Ll010
Ll015
C)
REM
ON KEY (2) GOSUB 4110
ON KEY (3) GOSUB ll210
ON KEY (q) GOSUB q310
ON KEY (5) GOSUB qq10
ON KEY (6) GOSUB 4510
ON KEY (7) GOSUB 4610
ON KEY (8) GOSUB 4710
ON KEY (11) GOSUB 4910
ON KEY (14) GOSUB 5010
FOR 1:2 TO 8:KEY (I) ON:NEXT I
GOSUB 65200:LOCATE 4, 17, 1:GOTO 2810
REM
B=1:TP=10:TU:78:LOCATE 4,17, t:PRINT"
100 MHZ"; :PRINT
II
( 10 NS
II
Ll017
:FOR
610
Ll100
4110
10
4210
610
Ll310
IF TW:1 AND B=1 AND L=1 THEN LOCATE 8, 21, 1:PRINT "XXXXXXXXXXXXXXXXXX111111
1:0 TO 17:H(I):O:G(I):O:NEXT I:FOR 1:18 TO 23:H(l):l:G(I):1:NEXT !:RETURN
RETURN 6610
TP:20:TU=78:B:2:PRINT
II
TP=200:TU=78:B:3:PRINT "
TP:1:TU:85:B:4:PRINT "
(20 NSEC)
50 MHZ ";:PRINT "
5 MHZ
1 MHZ
";:PRINT
(200 NSEC)":RETURN
II
" ; : PRINT "
":RETURN 6
(1
uSEC)
":RETURN 66
(2
uSEC)
":RETURN 66
0
500 KHZ"; :PRINT
ll410 TP=2:TU:85:B:5:PRINT "
II
0
4510 TP=10:TU=85:B=6:PRINT
10
4610 TP:20:TU=85:B=7:PRINT
10
Ll710 B=8:TP=40:TU:85:PRINT
II
100 KHZ"; :PRINT "
( 10 uSEC)
":RETURN 6
II
50
KHZ"; :PRINT
II
( 20 uSEC)
":RETURN 6
II
25 KHZ ";:PRINT
II
(40 uSEC)
":RETURN 6
to
w
,,.
ll910
5010
5110
5210
5310
5510
5610
5710
5810
5910
6010
6015
6110
6210
6310
6'11 0
EJ510
6610
., 110
7210
8610
8710
8810
8910
9010
9210
9310
9ll1 0
LOCATE 4, 17, 1:PRINT" ":RETURN 810
IF B:O THEN RETURN 2810 ELSE RETURN 5610
KEY (1) OFF: KEY (2) OFF:KEY (1q) OFF
KEY 1, "RISING":KEY 2, "FALLING"
LOCATE 3, 38, 1:PRINT "EXTERNAL CLOCK EDGE: "
LOCATE 3,58, 1:0N KEY (1) GOSUB 5210
ON KEY (2) GOSUB 5310
ON KEY (12) GOSUB 6ll10
ON KEY (11) GOSUB 6ll10
ON KEY (13) GOSUB 5510
ON KEY (ill) GOSUB 6510
KEY (1) ON:KEY (2) ON:KEY (11) ON :KEY (12) ON:Y.EY (13) ON:KEY (14) ON
GOSUB 65200:LOCATE 3, 58, 1:GOTO 5510
D:2:PRINT " RISING
":RETURN 6610
D:l:PRINT " FALLING ":RETURN 5610
nETURN 810
IF D=O THEN RETURN 6110 ELSE RETURN 5610
REM
REM
GOTO 8610
TW=1:FOR I:1 TO 14 :KEY ( I) OFF:NEXT I
FOR I=1 TO 10:KEY I, "":NEXT I
KEY 1, "0"
KEY 2, "1"
KEY 3, "X"
KEY 5, "ENTER"
KEY 4, "All x''
LOCATE 6, 1, 1:PRINT"(W) TRIGGER WORD:"; :PRINT"
22221111111111
It
9510 LOCATE 7,21, 1:PRINT"321098765ll32109876543210 <------means channel 0-23"
9515 IF L:O THEN LOCATE 8,21:PRINT"XXXXXXXXXXXXXXXXXXXXXXXX":L:1:FOR I:O TO 23
H(I)::O:G(I):O:NEXT I
9610 LOCATE 8,21
..
w
9710 C:O
9910 ON KEY (1) GOSUB 11~10
10010 ON KEY (2) GOSUB 11510
10110 ON Y.EY (3) GOSUU 11610
10210 ON KEY (~) GOSUB 11810
10~10 ON KEY(11) GOSUB 12010
10510 ON KEY(14) GOSUB 12110
10710 ON KEY (12) GOSUB 11710
10810 ON KEY (5) GOSUB 12110
10812 FOR 1:1 TO 5:KEY (I) ON :NEXT I
10818 FOR 1=6 TO 10 :KEY (I) OFF:NEXT I:FOR 1=11 TO 1~ :KEY(!) ON:NEXT I
10910 IF C:-1 THEN C=O
11000 IF C>24 THE~ C=2~
11010 LOCATE 8, 21+C, 1
11110 IF C=24 THEN GOSUB 65500:GOTO 12210
11210 ON KEY (13) GOSUB 11910
11310 GOSUB 65200:GOTO 9910
1 141 0 L: 1 : PRINT II 0 II i : G (c) =0: H (c) = 1 : co (c) = 1 : c =c + 1 : KEY ( 1 ) OFF: KEY ( 2) OFF: KEY ( 3
OFY :RETURN 10910
1 1 51 0 L: 1 : PRINT 11 1 " ; : G (C) = 1 : H (C) : 1 : CO (C) = 1 : C =C + 1 : KEY ( 1 ) OFF: KEY ( 2) OFF : KEY (
) OFF :RETURN 10910
11610 L:t:PRINT "X"; :H(C):O:G(C):O:CO(C):O:C=C+t:KEY (1) OFF:KEY (2) OFF:KEY (3
OFF:RETURN 10910
11710
C:C-1:
RETURN 10910
11810 LOCATE 8,21,1: PRINT "XXXXXXXXXXXXXXXXXXXXXXXX 11 :FOR 1:0 TO 23:H(I):O :G(I
=O:CO(!):O:NEXT I:L=1 :GOSUB 65500:RETURN 12210
1 1 9 10
C =C + 1 :
RETURN 1 091 0
12010 IF A=1 THEN GOTO 2210 ELSE 810
12110 IF L:O THEN RETURN 9910 ELSE L:1:GOSUB 65500:RETURN 12210
12210 FOR !:1 TO 14 :KEY (I) OFF:NEXT I
12310 LOCATE 9,1,1:PRINT "(P) TRIGGER POSITION:"
12~10 KEY 1,"ENTER 11 :FOR 1:2 TO 7:KEY I, "":NEXT I
12510 LOCATE 11,1 , t:PRINT
"
o
255
511
7n7
w
"'
1023"
12710 PRINT "
:--+--t--+--!--+--+--+--:--+--+--+--!--+--+--+--:"·
12715 IF Mt = 1 THEN GO~~UD 14610
12Ht0 PHINT "
"
"
12910 PRINT "
"
13010 PRINT "
!<---256--->!<---------------768--------------->:"
13015 TTP=256
13110 M1=1
13210 REM
13310 ON KEY (1) GOSUB 20910
13610 ON KEY (12) GOSUB 14510
13710 ON KEY (13) GOSUB 20610
13810 ON KEY (11) GOSUB 20810
13910 ON KEY (14) GOSUB 20910
13915 KEY (1) ON:KEY (11) ON:KEY (12) ON:KEY (13) ON:KEY (14) ON
1ll0 10 LOCATE 9 21 1
14110 GOSUB 65200:GOTO 13310
14210 PRINT "
"
14310 PRINT "
'"
'
14410 PRINT"
!<-192-->!<----------------832----------------->!":RETURN 14110
14510 LOCATE 13 1 1 1 1:M=M-1:IF M:O THEN M=1:RETURN 14110
14610 IF M:1 THEN TTP:64:GOTO 16110
14710 IF M=2 THEN TTP=128:GOTO 16410
14810 IF M:3 THEN TTP=192:GOTO 16710
1 4 9 1 0 I F M=4 'I' HEN TTP =2 56 : GOTO 1 7 0 10
15010 IF M:5 THEN TTP=320:GOTO 17310
15110 IF M:6 THEN TTP:38Ll:GOTO 17610
15210 IF M:7 THEN TTP=Ll48:GOTO 17910
15310 IF M:8 THEN TTP:512:GOTO 18210
15410 IF M:9 THEN TTP:576:GOTO 18510
15510 IF M=10 THEN TTP=640:GOTO 18810
15610 IF M=11 THEN TTP=704:GOTO 19110
15710 IF M:12 THEN TTP:768:GOTO 19410
I
I
w
0'1
15810
15910
15010
16110
16210
16310
161110
16510
16610
16710
16810
16910
17010
17110
17210
1 ., 3 1 0
174-10
17510
17610
1'(710
17810
17910
18010
18110
18210
18310
184-10
18510
18610
18710
18810
18910
19010
IF M=13 THEN TTP:832:GOTO 19710
IF M= tl~ THEN TTP:896:GOTO 20010
IF M=15 THEN TTP:960:GOTO 20310
PHINT
"
II
PRINT
PRINT II
!64!<-----------------960---------------------->! 11 :RETURN
II
PRINT II
"
II
PHINT II
PRINT II
!<128>!<----------------896-------------------->! 11 :RETURN
II
PRINT II
"
II
PRINT
PRINT II
!<--192->!<----------------832----------------->! 11 :RETURN
II
PRINT
"
II
PRINT
PRINT II
!<---255--->!<---------------768--------------->! 11 :RETURN
II
PRINT
"
II
PRINT
PRINT II
!<-----320---->!<-------------704--------------->! 11 :RETURN
PRINT II
"
PRINT II
PRINT II
!<-------384----->!<-----------640------------->! 11 :RETURN
PRINT "
"
PRINT "
PRINT II
!<--------4-48------->!<------------576--------->! 11 :RETURN
PRINT "
"
PRINT
PRINT
!<-----------512------->!<----------512-------->! 11 :RETURN
II
PRINT
"
PRINT
"
PRINT
!<------------576--------->!<---------448------>! 11 :RETURN
II
PRINT
"
II
PRINT
PRINT
!<-------------640----------->!<-------384------>! 11 :RETURN
II
II
II
14-110
14-110
II
14-110
II
II
14110
II
II
14-110
14110
14-110
14110
14110
14110
w
_,
19110
19210
19310
19410
19510
19610
19710
19810
19910
20010
20110
20210
20310
20410
20510
20610
2 0 7 10
20810
20910
21010
21110
21210
21310
21410
21510
21610
21710
21715
21810
21910
22010
PRINT "
A
"
PRINT "
:
II
PRINT II
:<---------------704------------>:<-----320---->:":RETURN
PRINT "
A
"
PRINT II
:
II
PRINT II
: <-----------------768------------->: <---256--->: ":RETURN
PRINT II
A
"
PRINT "
:
"
PRINT"
:<-------------------832-------------->:<--192->:":RETURN
PRINT "
A
II
PRINT "
:
II
PRINT"
:<---------------------896--------------->:<128>:":RETURN
PRINT "
A
II
PRINT "
:
II
PRINT"
:<----------------------960----------------->:64:":RETURN
LOCATE 13,1,1:M=Mt1 :IF M=16 THEN M=15:RETURN 14110
GO'l'O 1 4 6 1 0
RETURN 8610
FOR 1=1 TO 14:KEY (1) OFF:NEXT !:RETURN 21010
KEY 1, "YES":KEY 2, "NO":KEY 3, "SKIP"
LOCATE 16, 1, 1:PRINT "ARE YOU READY ?
":LOCATE 16,15,1
REM
ON KEY (1) GOSUB 21910
ON KEY (2) GOSUB 22010
ON KEY (3) GOSUB 22550
ON KEY (11)GOSUB 22010
ON KEY (14) GOSUB 22550
KEY (1) ON:KEY (2) ON :KEY (3) ON:KEY (11) ON :KEY (14) ON
GOSUB 65200:LOCATE 16, 15, 1:GOTO 21310
FOR I=1 TO 14 :KEY (I) OFF: NEXT !:LOCATE 16, 1,1 :PRINT "
":RE'I'URN 22115
LOCATE 16, 1, 1: PRINT "
14110
14110
14110
14110
14110
w
(D
":RETURN 12210
22115 PA38:0
22120 IF A=2 THEN PC38:35+128:IF D=1 THEN PA38=0+32 :GOTO 22220 ELSE PA38:64+32
GO'l'O 22220
22130 IF A><2 AND B=2 THEN PC38=32t128:PA38=32:GOTO 22220
22140 IF A<>2 AND B><1 AND B><2 AND B<5 THEN PC38=33+128 ELSE PC38:34+128
221ij2 IF B=5 TIIEN PA36:4 +32:GOTO 22220
221'lll IF B=6 THEN PA36: 12t32:GOTO 22220
22146 IF B=7 THEN PA38= 2+32:GOTO 22220
22148 IF B=B THEN PA38:10+32:GOTO 22220
22152 IF B>=3 THEN PA38:(B-3)M2+32
22220 PB38=M+16+32
22260 OUT 1000,PA38:FOR I=1 TO 200:NEXT I:OUT 1001,PB38:0UT 1002,PC38
22270 OUT 1001,PB38:PA38=PA38+1:0UT 1000,PA38:PA38=PA38-1+128:0UT 1000,PA38
22300 PC38:PC38+4:0UT 1002,PC38:PC38=PC38+64:0UT 1002,PC38
22317 PC38=PC38-64
22320 OUT 1002,PC38:PC38=PC38-128:0UT 1002,PC38:FOR J:l TO 200:NEXT J:POKE 2561
2
22325 IF REPETER=O AND RC1=1 THEN PC38:PC38+64:0UT 1002,PC38:FOR I=1 TO 55:NEXT
!:RETURN
22327 IF REPETER=O THEN PC38=PC38+128:FOR J:1 TO 100:NEXT J:OUT 1002,PC38:POKE
562,PA38:DEF SEG:&H2000:CALL ACHM(ABZ) :RETURN
22328 PC38=PC38+64:0UT 1002,PC38
22329 LOCATE 18, 1, 1: PRINT"
11
: LOCATE
16, 1: PRINT "WAIT A MINU'l'E UNTIL MATCH TRIGGER WORD 1 OR PRESS 'Q
KEY TO ESCAPE THE TRAPPED ROUTE. 11
22330 V1:INP (996) :V2$:INKEY$:IF V1<128 AND V2$>< 11 q 11 AND V2$<> 11 Q" THEN GOTO 223
0
22335 IF V2$="q" OR V2$="Q" THEN PC38:PC38+128:0UT 1002,PC38:POKE 2562,PA38:CAL
ACHH(ABZ):GOTO 22750
223ij0 IF V1>=128 THEN PC38:PC38+128:FOR J=1 TO 100:NEXT J:OUT 1002,PC38:POKE 2
62, PA38:CALL ACHH(ABZ) :PRINT "DATA IS CAPTURED"
22350 GOTO 22750
w
U)
22550 RETURN 22750
NAME ":KEY 2, "STATE":KEY 3, "TIM
22750 FOR 1=1 TO 1l!:KEY (l) OFF :NEXT I:KEY 1,
NG":KEY 4, "FILES":KEY 5, "REPEAT": KEY 5, "":KEY 7, "":KEY 8, "":KEY 9, ""
22950 LOCATE 19, 1, 1:PRINT
II
II
II
23150 LOCATE 16, 1, 1:PRINT "WHICH FUNCTION DO YOU WANT TO SELECT TO DISPLAY LATC
ED DATA?
:LOCATE 15,62, 1:FILET=O
23550 ON KEY (1) GOSUB 25350
23750 ON KEY (2) GOSUB 25000
23950 ON KEY (3) GOSUB 1!5350
24000 GOSUB 65200
21!150 ON KEY (1!) GOSUB 45550
24350 ON KEY (11!) GOSUB 55150
21!550 ON KEY (11) GOSUB 25150
24750 ON KEY (5) GOSUB 50950
24755 KEY (1) ON:KEY (2) ON:KEY (3) ON:KEY (4) ON:KEY (11) ON:KEY (5) ON
24950 GOSUB 65200:LOCATE 16,52, 1:GOTO 23550
25000 GOSUB 31!750:RETURN
25150 LOCATE 16, t:PRINT
":PRINT :PRINT "
":RETURN 12210
25350 CALL ACMD(AB~):FOR I= 1 TO 14:KEY (1) OFF:QKEY$=INKEY$:NEXT I:FOR I=1 TO
O:QKEY$=INKEY$:NEXT
25550 CLS:KEY 1,~":KEY 2, "":KEY 3, "":KEY 4, "":KEY 5, "":KEY 6, "":KEY 7, "":KEY 8,
"
25750 PRINT "CHANNEL
NEW NAME
CHANNEL
NEW NAME" :PRINT:
'RINT
25950 REM IF AD=O THEN GOTO 26350
26150 FOR I= 0 TO 11:PRINT "CH"; :PRINT USING ":tffi:";I; :PRINT "
=
"; :PRINT
$(!);:LOCATE 4+1,39,1:PRINT "CH";:PRINT USING "##";12+I;:PRINT"
"i :PRINT
=
P$(12+I):NEXT I
26152 GOTO 25750
26350 FOR I= 0 TO 11:PRINT "CH"; :PRINT USING"##";!; :PRINT "
= 11 j :PRINT II
"; "CH"; :PRrwr usiNG ":tHt-"; 12+I; :PrHNT "
";:PRINT :N
=
II
II
.
Q
XT I
26550 V$=INKEY$:V$=INKEY$:V$:INKEY$:V$:INKEY$
26750 LOCATE 22, 1, 1:PRINT "PUSH 'ESC' BUTTON TO ESCAPE NAME INPUT I"
26755 IF CMCARD=1 THEN DSE=&HBOOO ELSE DSE:&HB800
26758 HH:13:VV=4
26760 LOCATE VV,HH, 1
26770 K$=INKEY$:IF K$="" THEN GOTO 26770
26780 IF ASC(K$)=13 THEN KK$:"P":GOSUB 26977:LKJ:1:GOTO 26890
26785 IF LEN(K$)=2 THEN :KK$=RIGHT$(K$, 1) :GOTO 26860
26790 IF ASC(K$):27 THEN GOSUB 26977:GOTO 26950
26800 IF (ASC(K$)>46 AND ASC(K$)<58) THEN PRINT K$;
26805 IF ASC(K$).:32 THEN PRINT K$;
26810 IF (ASC(K$)>64 AND ASC(K$)<91) THEN PRINT K$;
26820 IF (ASC(K$)>96 AND ASC(K$)<123) THEN K$:CHR$(ASC(K$)-32) :PRINT K$;
26830 IF POS(O)<HH THEN LOCATE VV,HH, 1
26840 IF POS(O)>Hl-1+4 THEN LOCATE VV,HH+4, 1
26850 GOTO 26770
26860 IF ASC(KK$):72 AND VV:4 AND HH=50 THEN GOSUB 26977:VV=15:HH:13:GOTO 26830
26870 IF ASC(KK$)=72 AND VV=4 AND HH=13 THEN GOSUB 26977:GOTO 26830
26880 IF ASC(KK$):72 THEN GOSUB 26977:VV:VV-1:LOCATE VV,POS(O), 1:GOTO 26830
26890 IF ASC(KK$):80 AND VV:15 AND HH=13 THEN LOCATE ,HH, 1:GOSUB 26977:VV:4:HH:
O:GOTO 26830
26900 IF ASC(KK$):80 AND VV:15 AND HH=50 THEN LOCATE ,HH, 1:GOSUB 26977:GOTO 268
0
26905 IF ASC(KK$)=80
0 26830
26910 IF ASC(KK$):80
26920 IF ASC(KK$):75
26930 IF ASC(KK$):77
26940 GOTO 26830
26950 DEF SEG=&H2000
26960 CALL ACMU(AB%)
26970 AD=1
AND LKJ=1 THEN GOSUB 26977:VV=VV+1:LOCATE VV,HH, 1:LKJ:O:GO
THEN GOSUB 26977:VV:VV+1:LOCATE VV,POS(O), 1:GOTO 26830
THEN LOCATE VV,POS(0)-1, 1:GOTO 26830
THEN LOCATE VV,POS(0)+1, 1:GOTO 26830
.....
26975 RE'l'URN
26977 IF HH>llO THEN GOTO 33760
26979 P$(VV-Ll)="":AD1=160~t(VV-1)+2Ll:TEV:VV-ll
26980 FOR 1:0 TO ll
26983 ADO=AD1+IM2:DEF SEG:DSE
26985 VALU=PEEK(ADO):DEF SEG:&H2000
26990 POKE 1287+TEV~t5+I 1 VALU:P$(TEV):P$(TEV)+CHR$(VALU)
27000 NEXT I
27019 RETURN
33760 P$ (VV+8) = :AD1: 16011 (VV-1) +98: TEV:VV+8
33765 FOR I:O TOll
33780 ADO:AD1+IM2:DEF SEG:DSE
33790 VALU=PEEK(ADO) :DEF SEG:&H2000
33800 POKE 1287+TEV~t5+I 1 VALU:P$(TEV):P$(TEV)+CHR$(VALU)
33805 NEXT I
33810 RETURN
3q750 CALL ACMD(AB%)
31!950 FOR I= 1 TO 1ll :KEY (I) OFF :NEXT I: KEY 1 1 "DOWN": KEY 3 1 "UP": KEY 2 1 "":KEY
I=6 TO 9 :KEY I, "":NEXT I:KEY 5 , "Pg Dn":KEY 7 1 "Pg Up":CLS
1 "EXIT":FOR
35150 IF B=1 THEN MR=M•6ll~tll+&H2800-1 ELSE MR=M~t6ll+&H1000
35350 LOCATE 1 1 1 1 1:PRINT "POSITION
ASCII
HEXDECIMAL
DECIMAL
BINARY"
35550 IF B=1 THEN"GOTO 55350
35750 UP:O:FOR I:-11 TO -1:GOSUB 36250:NEXT I:I=O:GOSUB 36150:FOR I:1 TO 10:GOS
B 36250:NEXT I: GOTO 39550
36150 IF I=O THEN PRINT "TRIGGER"; :ME1:PEEK(MR+I):ME2=PEEK(MR+&H800+I):ME3:PEEK
HRt&H1000+I):GOTO 36550
36250 ME1:PEEK(MR+I):ME2=PEEK(MR+&H800ti):ME3=PEEK(MR+&H1000+I)
36350 PRINT USING "#tHfttft:''; I; :PRIN'l' " ";
36550 LOCATE
I 15
36750 IF ME3<=31 OR (ME3>:128 AND ME3<=159)TIIEN PRINT II I ";ELSE PRINT CHR$(ME3)
"I I
36950 IF ME2<:31 OR (ME2>=128 AND ME2<:159) THEN PRINT " , ";ELSE PRINT CHR$(ME2
1111
...
........,
• tt
I
...
I
I
37150 IF ME1<=31 OR (ME1>=128 AND ME1<:159) THEN PRINT" ";ELSE PRINT CHR$(ME1)
37350 LOCATE 1 26
37550 PRINT USING "\";HEX$(ME3); :PRIN'r"l "i
3'7750 PRIN'r USING "\";HEX$(HE2); :PRIN'l"', ";
37950 PRINT USING "\";HEX$(ME1);
38150 LOCATE I 39
38350 PRINT USING "##tf";ME3; :PRINT ", "i
38550 PRIN'r USING "###";ME2; :PRINT "1 ";
38750 PRINT USING "#tttf'';ME1;
38950 LOCATE I 54:BI:INT(ME3/16):GOSUB 41950:BI=ME3-BIM16:GOSUB 41950:PRINT ", ";
. 38960 Bl:INT(ME2/16):GOSUB 41950:BI=HE2-Blw16:GOSUB 41950 :PRINT",";
39150 BI:INT(ME1/16):GOSUB 41950:BI:HE1-BIM16:GOSUB 41950
39350 PRINT:RETURN
39550 ON KEY(14) GOSUB 41150
39750 ON KEY(4) GOSUB 40950
39950 ON KEY(11) GOSUB 41550
40150 ON KEY (1) GOSUB 41550
40350 ON KEY (3) GOSUB 41150
40360 ON KEY (5) GOSUB 41560
40370 ON KEY (7) GOSUB 41580
40550 KEY(11) ON:KEY(14) ON:KEY(i) ON:KEY(3) ON:KEY(4) ON: :KEY(5) ON:KEY(7) ON
40750 GOTO 39550.
40850 RETURN 40950
40950 RETURN 40952
40952 CALL ACMU(ABX):FOR I= 5 TO 14:KEY (I) OFF:NEXT !:RETURN
40966 IF PEEK(1264):0 THEN SCREEN 2,0,0
40968 DE~ SEG:CALL ASHADS(FFF,KKK)
41150 PGUP:O:FOR J:1 TO 14 :KEY(J) OFF:NEXT J:IF UP:1 THEN I=l+23:RETURN 41350
LSE RETURN 41350
41350 KEY (111) OFF: IF MR+I=&H13FF THEN GOTO 40750 ELSE UP:O:CALL ACSU(ABX) :LOC
TE 23 1 1, 1:GOSUB 36150: I=I+1:GOTO Ll0750
41550 FOR J=l TO 14 :KEY(J) OFF: NEXT J: IF UP=O TIIEN I=l-23:RETURN 41750 ELSE RE
..
w
URN 41750
41560 FOR J=1 TO 14: :KEY(J) OFF:NEXT J:IF MR+I<&H1000 OR MR+I-123<&Hi000 THEN R
TURN 40750
41565 LOCATE 2,1: IF UP=1 'l'HEN I=l-100 ELSE I=I-123
41570 KKU:I:FOR I=KKU TO KKU+21:GOSUB 36150:NEXT I:UP:O:RETURN 40750
41580 FOR J=1 TO 14 :KEY (J) OFF: NEXT J: IF HR+I>&H13FF OR HR+I+123>&H13FF THEN
ETURN 40750
41585 LOCA'l'E 2,1: IF UP=O THEN 1=1+'78 ELSE I=I+123
41590 KKU=I:FOR I:KKU TO KKUt21:GOSUB 36150:NEXT I:UP:O:RETURN 40750
41750 KEY (11) OFF:IF MR+I=&H1000 THEN GOTO 40750 ELSE UP=1:CALL ACSD(ABY.):LOCA
E 2, 1, 1:GOSUB 36150:I=I-1:GOTO 40750
41950 ON BI GOTO 42150,42350,42550,42'750,42950,43350,43550,43750,43950,44150,44
50,44550,44750,44950,45150
41955 PRINT 0000"; :RETURN
42150 PRINT 0001"; :RETURN
q2350 PRINT 0010"; :RETURN
42550 PRINT 0011"; :RETURN
42750 PRINT 0100"; :RETURN
42950 PRINT 0101"; :RETURN
43350 PRINT 0110"; :RETURN
43550 PRINT 0111"; :RETURN
43750 PRINT 1000'; :RETURN
43950 PRINT 1001 ;:RETURN
44150 PRINT '1010 ; :RETURN
44350 PRINT "1011 ; :RETURN
44550 PRINT "1100 i :RETURN
44750 PRINT "1101 ; :RETURN
44950 PRINT "1110 i :RETURN
45150 PRINT "1111 ; :RETURN
45350 REM timing
45355 FOR I=1 TO 14:KEY (I) OFF:NEXT I
45360 ON KEY (5) GOSUB 41560
45370 IF B=1 THEN POKE &H500, 1 ELSE POKE &11500,0
••
45380 POKE &H501,TP:POKE &H502,TU
45385 IF A=2 THEN POKE &H501,0
45400 POKE &II503,TTP-256MINT(TTP/256) :POKE &H504, INT(TTP/256)
1151110 POKE &H505, REPETEH
45420 IF D=2 THEN POKE &H506,0
45422 IF D=l THEN POKE &H506, 1
45424 IF A=l THEN POKE &H506,0
q5q72 IF (REPETEH:O OR FILET:55) AND PEEK(1264)=0 THEN GOTO 45480
45473 IF
FILET:55 AND PEEK(1264):1 THEN GOTO 45480
451174 IF PEEK ( 1264) = 1 THEN GOTO 45520
45475 DEF SEG=&H2000:CALL ACMD(ABZ)
45l!80 DEF SEG
l!5483 IF REPETER=O THEN KEY OFF:SCREEN 2,0,0:GOTO l!5490
l!5485 DEF SEG=&H2000:IF PEEK(1264):1 THEN DEF SEG:CALL ASMAD2(KKK,LLL) ELSE DEF
SEG:KEY OFF :CLS:SCREEN 2,0,0
45490 CALL ASMADS(FFF,KKK)
45495 IF REPETER =0 THEN RETURN
45498 SCREEN O,O,O:DEF SEG=&H2000:KEY ON
45500 CALL ACMU(ABZ)
l!5510 RETURN
45520 IF REPETER=O THEN DEF SEG:CALL ASMADS(FFF,KKK) :RETURN
45530 CALL ACMD(ABZ):DEF SEG:KEY OFF:CALL ASMAD2(FFF,KKK):CALL ASMADS(FFF,KKK):
ALL ASMAD1(FFF,KKK):GO'I'O 45l!98
45550 POKE(&H4FF),M:KEY (11) OFF:KEY (12) OFF:KEY (13) OFF:KEY (14) OFF
45750 CALL ACMD(ABZ)
45950 ON ERROR GOTO 49155:CLS:FILES:PRINT:PRINT
----1161 50 PRINT: PRINT"
SELECT FUNCTION KEY PLEASE
----116350 KEY OFF
46550 FOR I=1 TO 9:KEY(I) ON:NEXT I
1167 50 KEY 1, "DIR ":ON KEY(1) GOSUB 49150
1169 50 KEY 2, "DELETE":ON KEY(2) GOSUB 49750
47150 KEY 3, "RENAME":ON KEY(3) GOSUB 51950
117350 KEY l!, "SAVE":ON KEY(4) GO.SUB 48770
...
"'
47550 KEY 5, "LOAD":ON KEY(5) GOSUB 49020
47750 KEY 6, "STATE":ON KEY(6) GOSUB 49140
47950 KEY 7, "TIMING":ON KEY(7) GOSUB 49147
1!5150 KEY 8, "HELP":ON KEY(8) GOSUB 53750
48350 KEY 9, "EXIT":ON KEY(9) GOSUB 49550
l!-8750 KEY ON
48760 GOTO ll8760
1187'TO FOR 1=1 TO 14:KEY (I) OFF :QKEY$=INKEY$:NEXT I:LOCATE 23,10: INPUT "WHAT F
LE NAME DO YOU WANT TO SAVE ";DFNAME$
l!-8775 ON ERROR GOTO 49000:FSA1$=DFNAME$+"ABZ1":FSA2$=DFNAME$+"ABZ2":FSA3$=DFNAM
$+"ABZ3":FSAll$=DFNAME$+"ABZ4":FSA5$=DFNAME$+"ABZ5"
48795 BSAVE FSA1$, &H1000, &H400
48800 BSAVE FSA2$,&H1800, &H400
l!-8810 BSAVE FSA3$, &H2000, &H400
l!-8520 BSAVE FSA4$, &II2500, &H1000
48830 BSAVE FSA5$, &IlllFF', &H128
1!8990 LOCATE 23, 10:PRINT"disK flle ";DFNAME$;" is saved
":FOR 1=1 TO 3000:NEXT !:RETURN 45950
l!-9000 LOCATE 21, 10:PRINT"FILE NOT FIND OR
BAD FILE NAME .
":FOR I=1 TO 300
:NEXT !:RETURN 49005
l!-9005 RESUME 45950
l!-9010 RETURN 45950
l19020 FOR 1=1 TO 14:KEY (I) OFF:QKEY$=INKEY$:NEXT !:LOCATE 23,10:INPUT "What £i
e name do you want to load ";DFNAME$:FSA1$=DFNAME$+"ABZ1":FSA2$=DFNAME$+"ABZ2"
FSA3$=DFNAME$+"ABZ3":FSA4$=DFNAME$+"ABZ4":FSA5$=DFNAME$+"ABZ5"
49030 ON ERROR GOTO 49130
49050 BLOAD FSA1$,&H1000
49060 BLOAD FSA2$, &H1800
l!-9070 BLOAD FSA3$, &H2000
49080 BLOAD FSAl!$, &H2500
l!-9090 BLOAD FSA5$
119100 LOCATE 23, 10:PRINT"disK file ";DFNAME$;" is load
":FOR 1=1 TO 3000:NEXT I:FLOA=t :RETURN 45950 ·
....Cl"'
49130 RETURN 49135
1!9135 LOCATE 21, 10: PRINT" FILE NOT FIND or
bad fi 1 e NAME .
":FOR I= 1 TO 300
:NEXT !:RESUME 45950
49140 B99=B:M99=M:B=O
49145 M=PEEK(&H4FF) :GOSUB 34950:B=B99:M:M99:RETURN 45950
49147 IF FLOA=O THEN FILET:55:GOSUB 45350 ELSE GOSUB 45480
49150 FOR I:1 TO 14:KEY (I) OFF:QKEY$:INKEY$:NEXT !:RETURN 45950
119155 LOCATE 21,10:PRINT"Disk. not ready":FOR !=1 TO 3000:NEXT I :CLS:RESUME 46
50
lt9350 RETURN
49550 CALL ACMU(AB/.):FOR I= 5 TO 14:KEY (I) OFF:NEXT I:FLOA:O:RETURN 49560
49560 RETURN
49750:RETURN 49950
49950 LOCATE 23, 10
50150 FOR 1=1 TO 14:QKEY$:INKEY$:KEY(I) OFF:NEXT !:INPUT "What file name do you
want to delete ";DFNAME$
50350 ON ERROR GOTO 51350
50550 KILL DFNAME$
50750 ON ERROR GOTO 51350
50950 LOCATE 23, 10:PRINT"disk. file ";DFNAME$; '' is deleted
II
51150
51350
51550
51750
51950
52150
52350
52550
52750
52950
53150
53350
FOR LL=1 TO 2000:NEXT LL:GOTO 45950
LOCATE 21, 10:PRINT"F1le not found or
RESUME 51150
1
bad FILE NAME .
II
MMMMMMMMMMMMMMMMMMMMMMMMMMMHMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
RETURN 52150
LOCATE 22, 10:FOR !=1 TO 14:QKEY$=INKEY$:KEY(I) OFF:NEXT I
INPUT "what file NAME do you want to RENAME = ";RENAME$
LOCATE 23, 10:INPUT"
RENAME TO= ";NENAME$
ON ERROR GOTO 51350
NAME RENAME$ AS NENAME$
ON ERROR GOTO 513~0
LOCATE 21, 10:PRINT"RENAME d1sk file '';RENAME$;" TO ";NENAME$;" COMPLETE"
..._,
53550 GOTO 51150
53750 FOR !=1 TO 14 :KEY (!) OFF:QKEY$=INKEY$:NEXT I:CLS:PRINT" DIR
-- Cat
log disk files. ":PRINT
Delete disk file. ":PRINT
53950 PRINT" DELETE
54150 PRINT" RENAME
Rename dis!{ file.":PRINT
54160 PRINT" SAVE
--save be captured data to diskette. ":PRINT
54170 PRINT" LOAD
--Load be captured data from diskette. ":PRINT
5Llt 80 PRINT" STATE
--Display state that had loaded data":PRINT
51!190 PHINT" TIMING --Display timing that had loaded data":PRINT
~11350 PRIN'I'"
HELP
Display help manual. ":PRINT
54550 PRINT" EXIT
-- EXIT to main menu screen. ":PRINT
51!750 RETURN 46150
51!9 50 RETURN 52150
55150 END
55350 UP1=0:FOH I=-11 TO tO:GOSUB 55550:NEXT l:GOTO 57750
55550 ME 1 =PEEK ( MR + I )
!:)5'{50 IF I=O THEN PRINT "TRIGGER";"
"; :GOTO 56150
".
55950 PRINT USING "~";I; :PRINT"
56150 LOCATE
16
56350 IF ME1<=31 OR (ME1>=128 AND ME1<=159) THEN PRINT"
";ELSE PRINT USING"\
IIi CHR$ (MEt);
56550 LOCATE 1 27 1 1
56750 PRINT USING "\";HEX$ (ME1);
56950 LOCATE 1 42 1 1
57150 PRINT USING "#:tt#";ME1;
5'{350 LOCATE 1621 1:BI=INT(ME1/16) :GOSUB 41950:LOCATE 1621 !:PRINT II
";:LOCATE I
61 1
57355 BI=HE1-Biw16:B=O:GOSUB 41950:B=1
57550 PRINT:RETURN
57750 ON KEY(14) GOSUB 60150
57950 ON KEY-(4) GOSUB 40950
58150 ON KEY(11) GOSUB 60550
58350 ON KEY (1) GOSUB 60550
I
I
....co
58550 ON KEY (3) GOSUB 60150
58560 ON KEY (5) GOSUB 59000
58570 ON KEY ( '7) GOSUI3 59~00
~8'f50 KEY ( 11) ON: KEY
( 14) ON: KEY ( 1 ) ON:KEY (3) ON:KEY (4) ON:KEY (5) ON:KEY (7
Otl
58950 GOTO 57750
59000 FOR J=1 TO 14: :KEY(J) OFF:NEXT J:IF MR+l<&H2800 OR MR+I-323<&H2800 THEN R
TUHN 58950
59010 LOCATE 2,1: IF UP1=1 THEN I=I-300 ELSE I=I-323
59020 KKU=I:FOR I=KKU TO KKU+21:GOSUB 55550:NEXT I:UP1=0:RETURN 58950
~9500 FOR J=1 TO 14:KEY(J) OFF: NEXT J: IF MR+I>&H2800+&ll3FFM4 OR MR+I+323>&H2800
&H3F'F~tll THEN RETURN 58950
59510 LOCATE 2,1: IF UP1=0 THEN I=I+278 ELSE I=I+323
59520 KKU=I:FOR I=KKU TO KKU+21:GOSUB 55550:NEXT I:UP1:0:RETURN 58950
60150 IF UP1::1 'l'HEN I=I+23:RETURN 60350 ELSE RETURN 60350
60350 KEY (1ll) OFF':KEY(3) 01<,1-,: IF MR+I=&H2800+&H3Fl<'Ml! 'rHEN GOTO 58950 ELSE UP1=
:CALL ACSU (AB/.): LOCATE 23, 1. 1: GOSUB 55550: I= I+ 1: GOTO 58950
60550 IF UP1=0 THEN I=l-23:RETURN 60750 ELSE RETURN 60750
60750 KEY (11) OFF:KEY(1) OFF:IF HR+I=&H2800 THEN GOTO 58950 ELSE UP1=1:CALL AC
D(ABI.):LOCATE 2, 1, 1:GOSUB 55550:I=I-1:GOTO 58950
60950 RC1:0:FOR 1=1 TO 14:QKEY$=INKEY$:KEY (I) OFF:NEXT I
60955 CALL ACMD(AB~):IF PEEK(1264)=1 'l~EN DEF SEG:CALL ASMAD2(KKK,GGG)
60960 DEF SEG=&H2000:REPETER=O:GOSUB 22115:PC38=PC38:GOSUB 45350:GOTO 60970
60962 IF 8=1 THEN POKE 2562,PA38 :POKE 2561,1
60964 PC38=PC38-128:0UT 1002,PC38:PC38=PC38+128:FOR 1=1 TO 200:NEXT I:OUT 1002
PC38:CALL ACHM(ADI.)
60966 DEF SEG=&H2000:IF PEEK(1264)=0 THEN DEF SEG:SCREEN 2,0,0
60968 DEF SEG:CALL ASMADS(KKK,LLL)
60970 DEF SEG=&H2000:QKEY$=1NKEY$:IF QKEY$="" THEN GOTO 60962
60982 IF QKEY$<>'"' THEN IF ASC(QKEY$) =27 AND PEEK(126ll) =0 THEN SCREEN 0, 0, O:CAL
ACMU(AB/.):KEY ON:REPETER=1:RETURN
6098ll IF QKEY$<>"" THEN IF ASC(QKEY$)=27 AND PEEK(1264)=1 THEN DEF SEG:CALL ASH
D1(KKK,FFF):DEF SEG=&H2000:SCREEN O,O,O:CALL ACHU(ABZ):KEY ON:REPETER=1:RETURN
..
~
6UYB~ DEF SEG=&H2000:GOSUB 45350:DEF SEG:&H2000
60998 FOR I=1 TO 40:QKEY$=INKEY$:NEXT I:GOTO 60962
61950 REPETER=O:RC2=0:FOR 1=1 TO 14:QKEY$=INKEY$:KEY (I) OFF:NEXT I:GOTO 61955
6 1955 CALL ACMD ( ABZ) : II" PEEK ( 1264) : 1 TliSN DEF SEG: CALI. ASMAD2 (KKK, GGG)
61957 DEF SEG=&H2000
61958 GOSUB 45350
61960 DEF SEG=&H2000
61961 RC1:1:GOSUB 22115:POKE 2562,PA38:RC2:1
61962 QKEY$:INKEY$:IF QKEY$:"" THEN QKEY$="P"
51964 V1=INP(996):IF V1<128 AND ASC(Ol:EY$)><27 THEN GOTO 61962
61965 IF ASC(QKEY$):27 THEN GOTO 51982
61975 FOR r~o TO 100:NEXT I:PC38:PC38+128:0UT 1002,PC38:CALL ACHM(AB%):GOSUB 45
50:GOTO 61960
61982 IF ASC(QKEY$)=27 AND PEEK(1264):0 THEN SCREEN O,O,O:CALL ACMU(ABZ) :KEY ON
REPETER:1:RETURN
6198'l IF ASC (QKEY$) =2•r AND PEEK ( 125ll) : 1 THEN DEF SEG: CALL ASMAD1 (KKK, FFF) : DEF S
G:&II2000:SCREEN O,O,O:CALL ACMU(ABZ) :KEY ON:REPETER:1:RETURN
61985 DEF SEG: &H2000: GOStJB '15 3 50: DEF SEG: &H2000
61998 FOR I:1 TO 40:QKEY$=INKEY$:NEXT I:GOTO 61960
55200 V$=INKEY$
55210 IF V$="" THEN RETURN
65220 O$=INKEY$:IF V$><"" AND G$><"" THEN GOTO 65200
65230 IF V$:"S" OR V$="s" 'rHEN RETURN 810
6~2ll0 IF V$="R" OR V$="r" THEN RETURN 2210
65260 IF V$:"W" OR V$="w" THEN RETURN 8610
65270 IF V$="P" OR V$="p" THEN RETURN 12210
65280 IF V$="C" OR V$:"c" THEN FOR I = 1 TO 1ll:KEY ( I ) OFF:NEXT !:LOCATE 16, 1, 1:P
":RETURN 2
INT "
11 5
65290 IF V$="N" OR V$:"n" THEN GOSUB 25350
55300 IF V$="L" OR V$:"1" THEN GOSUB 25000
65310 IF V$="T" OR V$:"t" THEN GOSUB '~5350
65320 IF V$:"F" OR V$:"f" THEU GOSUB 45550
U'l
0
65330 IF V$="E" OR V$="e" THEN GOSUB 60950
65335 IF V$:"a" OR V$="A" THEN GOSUB 61950
65340 RETURN
6 5 3 'I 2 I F M:: 1 THEN TTP =61! : GOTO 6 5 3 7 2
6 5 3 4Ll I F M=2 THEN TTP=128:GOTO 65378
65346 IF M:3 THEN TTP=192:GOTO 65384
65348 IF M=4 THEN TTP=256:GOTO 65390
65350 IF M::5 THEN TTP::320:GOTO 65396
6 5 3 52 I F' M=6 THEN TTP=384:GOTO 65402
6535l! IF' M= 7 THEN TTP=448:GOTO 65408
65356 IF M=8 THEN TTP=512:GOTO 65414
65358 IF M=9 THEN TTP=576:GOTO 65420
65360 IF M=10 THEN TTP:640:GOTO 65426
65362 IF M=11 THEN TTP=704:GOTO 65432
65364 IF M=12 THEN TTP=768:GOTO 65438
65366 IF M=13 THEN TTP=832:GOTO 65444
65368 IF M=14 THEN TTP=896:GOTO 65450
65370 IF M=15 THEN TTP=960:GOTO 65456
65372 PRINT
6537Ll PRINT
"
65376 PRINT
256:<----------------3840---------------------->:":RETURN
65378 PRINT
65380 PRINT
65382 PRINT
:<512>:<---------------3584-------------------->:":RETURN
65384 PRINT '
"
65386 PRINT
"
65388 PRINT
:<--768->:<---------------3328----------------->:":RETURN
65390 PRINT
"
65392 PRINT
"
6539Ll PRINT
:<--1024--->:<--------------3072--------------->:":RETURN
65396 PRINT
"
65398 PRINT
"
65Li00 PRINT "
:<----1280---->:<------------2816-------------->:":RETURN
..
1\
..
..
1\
14110
14110
1\
14110
1\
..
14110
14110
Ut
~
65qo2
65404
55q05
65408
65410
65412
65414
55q15
~bq18
65420
65422
65424
65426
65428
65430
65432
65434
65436
65438
651!1!0
65442
65444
65446
65448
65450
65452
65454
65456
65458
65460
65500
PRINT II
II
II
PRINT II
11
PRINT
:<------1536----->:<----------2560------------->: :RETURN 14110
II
PRINT
II
PRINT
PRINT
:<-------1792------->: <-----------2304--------->: 11 :RETURN 14110
II
PRINT
II
PRINT
PRINT II
11
:c----------2048------->:<---------2048-------->: :RETURN 14110
A
II
PRINT
II
PRINT
PRINT
:<-----------2304--------->:<--------1792------>: 11 :RETURN 14110
II
PRINT
"
II
PRINT
PRINT II
:<------------2560----------->:<------1536----->: 11 :RETURN 14110
PRINT II
"
II
PRINT II
:
II
PRINT II
:<--------------2816------------>:<----1280---->: 11 :RETURN 14110
PRINT II
"
II
PRINT II
:
II
PRINT II
:<----------------3072------------->:<--1024--->: 11 :RETURN 14110
PRINT II
"
II
PRINT II
:
II
PRINT II
~<------------------3328-------------->:<--768->: 11 :RETURN 14110
PRINT II
"
II
PRINT II
:
II
PRINT II
:<--------------------3584--------------->:<512>: 11 :RETURN 14110
PRINT II
"
II
PRINT II
:
II
PRINT II
:<---------------------3840----------------->:256 11 :RETURN 14110
POKE &H4EO, G(16) M128+G(17) M64+G(HI) M32+G(19) M16+G(20) M8+G(21) M4+G(22) M2+G
1\
1\
A
2 3)
65502 POKE &H4E1,G(8)M128+G(9)M64+G(10)M32+G(11)M16+G(12)1f8+G(13)1f4+G(14)1f2+G(1
Ul
tv
)
6550~ POKE &H~E2,G(O)M128+G(1)M6~+G(2)M32+G(3)M16+G(~)M8+G(5)M~+G(6)M2+G(7)
65506 POKE &H~E3,C0(16)M128+C0(17)~6~+C0(18)M32+C0(19)M16+C0(20)M8+C0(21)M~+C0(
2)M2+C0(23)
65508 POKE &H4E~,C0(8)•128+C0(9)•64+C0(10)•32+C0(11)•16+C0(12)•8+C0(13)•4+C0(14
•2+C0(15)
65510 POKE &114E5,CO(O)M128+C0(1)M64+C0(2)M32+C0(3)M16+C0(4)M8+C0(5)M4+C0(6)M2+C
( rr )
65512
65514
65516
65518
65520
POKE &H4E6,0:POKE &H4E7,0:POKE
POKE &H4EC,PB38
POKE &H4ED,PC38
CALL ABC
RETURN
&H~E8,0
U'l
w