0% found this document useful (0 votes)
639 views120 pages

8080 User Manual

The document is a user manual for an 8080 microprocessor kit. It includes a functional block diagram showing the main components of the kit including the 8080 CPU, 8288 bus controller, 8284 clock generator, 32kB RAM, 32kB monitor ROM, and UART for downloading hex files. It also describes the hardware layout, keyboard functions, memory and I/O maps, and includes examples of entering and running simple programs on the kit to control the GPIO1 LED.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
639 views120 pages

8080 User Manual

The document is a user manual for an 8080 microprocessor kit. It includes a functional block diagram showing the main components of the kit including the 8080 CPU, 8288 bus controller, 8284 clock generator, 32kB RAM, 32kB monitor ROM, and UART for downloading hex files. It also describes the hardware layout, keyboard functions, memory and I/O maps, and includes examples of entering and running simple programs on the kit to control the GPIO1 LED.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 120

8080 Microprocessor Kit

User's Manual

Rev 1.0, December 2017


8080 MICROPROCESSOR KIT

CONTENTS
OVERVIEW...........................................................................................4

FUNCTIONAL BLOCK DIAGRAM........................................................4

HARDWARE LAYOUT...........................................................................5

KEYBOARD LAYOUT............................................................................7

HARDWARE FEATURES......................................................................9

MONITOR PROGRAM FEATURES.......................................................9

MEMORY AND I/O MAPS......................................................................10

GETTING STARTED..............................................................................11

HOW TO ENTER PROGRAM USING HEX CODE................................13

USER REGISTERS DISPLAY................................................................14

TEST CODE RUNNING…………………………..…................................15

GPIO1 LED............................................................................................16

RS232C PORT......................................................................................17

DATA FRAME for UART COMMUNICATION......................................17

CONNECTING KIT TO TERMINAL.......................................................18

EXPANSION BUS HEADER.................................................................22

10ms TICK GENERATOR....................................................................23

RST 7 STROBING by 8228 BUS CONTROLLER……………………...24

CONNECTING LCD MODULE.............................................................25

+12V, -5V POWER SUPPLY……………………………………………….26


LOGIC PROBE POWER SUPPLY........................................................27

HARDWARE SCHEMATIC, BOM

MONITOR PROGRAM LISTINGS


OVERVIEW

The 8080 Microprocessor kit is the educational kit designed for self learning the Intel
8080 microprocessor coding. The microcomputer is built with three chips system,
8080 CPU, 8288 bus controller and 8284 clock generator. The kit has 32kB user
RAM and 32kB monitor ROM. The kit provides hex display and hex keys. It can
display memory contents with 64kB logical locations. The hex key can use for
entering the 8080 instructions. The kit also has serial port for Intel hex file
downloading. The 10ms tick generator is for time triggering experiment.

FUNCTIONAL BLOCK DIAGRAM

Notes

1. UART is software control for low speed asynchronous communication.


2. The kit has 8-bit LCD module interfacing bus.
3. 100Hz Tick generator is for interrupt experiment.
4. Ports for display and keypad interfacing were built with discrete logic IC chips.
5. Memory and Port decoders are made with Programmable Logic Device, PLD.
6. The CPU, bus controller, clock generator are hot under operation. 4
HARDWARE LAYOUT

RS232C connector, DB9


male
DC jack, +9VDC

16-pin Text LCD header. Selector for 10ms tick or


INTR key
GPIO1 LED, 8-bit binary display
(address is 00H)

5
Important Notes

1. Plugging or removing the LCD module must be done when the kit is powered off!

2. AC adapter should provide approx. +9VDC, higher voltage will cause the voltage
regulator chip becomes hot.

3. The kit has diode protection for wrong polarity of adapter jack. If the center pin is
not the positive (+), the diode will be reverse bias, preventing wrong polarity feeding
to voltage regulator.

6
KEYBOARD LAYOUT

HEX keys Hexadecimal number 0 to F with associated user registers, AF, BC, DE,
HL, SP, PC, flag display and alternate functions (use with ALT key).

CPU control keys

RESET Reset the CPU, the 8080 will JUMP to location 0000.

INTR Make INTR pin to logic low, used for experimenting with interrupt
process

Monitor function keys

HOME Return current address to location 8100.

DATA Set entry mode of hex keys to Data field

ADDR Set entry mode of hex keys to Address field

GO Jump from monitor program to user code

- Decrement current display address by one

+ Increment current display address by one

MOD Modify user registers, after a given user register was selected.

7
ALT Alternate functions, used with HEX key.

0 display AF user register


1 display BC user register
2 display DE user register
3 display HL user register
4 display SP user register
5 display PC user register
6 display carry flag
7 display Zero flag
8 display Sign flag
9 display AC flag
A display Parity flag
B set Break location
C clear Break location
D Delete byte
E Insert byte
F Turn ON/OFF beep

USER CPU will jump to location 8050, pre-loaded with HALT


instruction, 76. User may add the code for USER key.

TEST Write the text to LCD if connected and test gpio1 LED

8
HARDWARE FEATURES

Hardware features:

 CPU: 8080 Microprocessor, 2.048MHz (18.432MHz/9)


 Oscillator: 8224
 Bus controller: 8228 with RST 7 strobing for interrupt vector
 Memory: 32kB RAM, 32kB EPROM
 Memory and I/O Decoder chip: Programmable Logic Device GAL16V8D
 Display: high brightness 6-digit 7-segment LED
 Keyboard: 28 keys
 RS232 port: software controlled UART 2400 bit/s 8n1
 Debugging LED: 8-bit GPIO1 LED at location 00H
 Tick: 10ms tick produced by 89C2051 for time trigger experiment
 Text LCD interface: direct CPU bus interface text LCD
 Brownout reset: KIA7042 reset chip for power brownout reset
 HALT and INTE bit indicator LEDs.
 +12V and -5V power supply: MC34063 DC-to-DC converter and Intersil
ICL7660.
 Power consumption: 500mA @7.5V AC adapter
 Expansion header: 40-pin header

MONITOR PROGRAM FEATURES

MONITOR program features:

 Enter 8080 instructions using hex code directly


 Test code running with break point
 User registers for status capturing, direct status flag display
 Insert/delete byte
 Beep ON/OFF
 Simple terminal connecting with 2400 bit/s RS232 port.

9
MEMORY AND I/O MAPS

The kit provides two spaces of memory, i.e. 1) RAM, 2) monitor ROM and space for
I/O ports.

Monitor ROM is placed from location 0000H to 7FFFH. RAM starts at 8000H to
FFFFH

I/O ports are located from 00H to FFH.

GPIO1 LED is located at 0. User can use instruction that write 8-bit data with 8-bit
address easily, e.g.
3E 01 MVI A,1
D3 00 OUT 0
DF RST 3

64kB Memory I/O ports

0 00H GPIO1 LED


32kB Monitor 20H PORT0
ROM 40H PORT1
60H PORT2
7FFFH
8000H

32kB User RAM


80H LCD command write
FFFFH 81H LCD data write
82H LCD command read
83H LCD data write
A0H

FFH

10
GETTING STARTED

The kit accepts DC power supply with minimum voltage of +7.5V. It draws DC
current approx. 250mA. However we can use +9VDC from any AC adapter. The
example of AC adapter is shown below.

The center pin is positive. The outer is GND.

11
If your adapter is adjustable output voltage, try with approx. +9V. Higher voltage will make
higher power loss at the voltage regulator, 7805. Dropping voltage across 7805 is approx.
+2V. To get +5VDC for the kit, we thus need DC input >+7.5V.

When power up, we will see the cold boot message 8080 running.

8080
Then the display will show HOME location at 8100. The data field will show its content.

8100 30. 12
HOW TO ENTER PROGRAM USING HEX CODE

Let us try enter HEX CODE of the example program to the memory and test it. We
write the program with 8080 instuction.

Address Hex code Label Instruction comment


8100 3E 01 MAIN MVI A,1 Load A with 1
8102 D3 00 OUT 0 Write A to GPIO1 @ 00
8104 DF RST 3 Return to monitor

Our test program has only three instructions.

The first instruction is


MVI A,1

Load A register with the 8-bit constant, 01.

This instruction has two bytes hex code i.e., 3E, and 01. 3E is instruction MVI A,n and 01 is
n.

The 2nd instruction is

OUT 0 Copy A register to output port, gpio1 LED at location 00.

The instruction's machine code is D3. The location of GPIO1 is 00.

The last instruction is RST 3, hex code DF jump back to monitor program at 0018H.

This test code has only 5 bytes, 3E, 01, D3, 00, DF.

The first byte will be entered to location 8100. And the following bytes will be entered at
8101, 8102, 8103, 8104.

Let us see how to enter these codes into the memory.

Step 1 Press RESET the display will show current memory address and its contents.

8100 00.
Shown the location 8100 has data 00. There are small dots at the data field indicating the
active field, ready for modifying the hex contents.

13
Step 2 Press key 3 and key E. The new hex code 3E will be entered to the location
8100.

8100 3E.
Step 3 Press key + to increment the location from 8100 to 8101. Then enter hex key
1.

8101 01.
Repeat Step 3 until completed for the last location. We can verify the hex code with
key + or key -.

To change the display location, press key ADDR. The dots will move to Address
field. Any hex key pressed will change the display address.

USER REGISTERS DISPLAY

Before we test the code running, let us see how to examine user registers. User
registers are the memory block in RAM that used to save the contents of CPU
registers after completed a given program running. We can examine the user registers
for checking our code running then.

Press key ALT, then press key 0, it will show 16-bit contents of register AF.

0397 AF
Press key Reg, 1, 2, 3, for BC, DE, HL register.

Fe00 BC
14
TEST CODE RUNNING

We can test above code running by pressing key GO. The last instruction RST 3 will
return the CPU to monitor program to save CPU registers to user registers that we can
examine the program operation.

Location hex code instruction

8100 3E 01 MVI A,1


8102 D3 00 OUT 0
8104 DF RST 3

Now let us enter code, when completed, press key HOME then GO.

What is happening?

The GPIO1 LED will be 0000 0001.

Can you change the display from 0000 0001 to another value? How?

Another example for fun, making 8-bit binary counting at GPIO1.

Location hex code instruction

0001 8100 .ORG 8100H


0002 8100
0003 8100 D3 00 LOOP OUT 0
0004 8102 3C INR A
0005 8103 CD 09 81 CALL DELAY
0006 8106 C3 00 81 JMP LOOP
0007 8109
0008 8109 11 FF FF DELAY LXI D,-1
0009 810C 21 00 30 LXI H,3000H
0010 810F 19 LOOP2 DAD D ; HL=HL+DE
0011 8110 DA 0F 81 JC LOOP2
0012 8113 C9 RET
0013 8114
0014 8114 .END
tasm: Number of errors = 0

Now let us enter code, when completed, press key HOME then GO.

What is happening? Can you change speed? How?

15
GPIO1 LED

The kit provides a useful 8-bit binary display. It can be used to debug the program or
code running demonstration. The I/O address is 00. The output port is 8-bit data flip-
flop. Logic 1 at the output will make LED lit.

This debug LED is memory location at 00. We can use instruction OUT 0 that writes
8-bit data to it. The LED will be turned on for bit ‘1’ and turned off for bit ‘0’.

The hex code for OUT 0 is D3, 00. Only two bytes and easy to remember!

Anytime we need to check the 8-bit contents, we can copy it to register A then use
this instruction to write it to the gpio1 LED easily.

16
RS232C PORT

The RS232C port is for serial communication. We can use a cross cable or null
MODEM cable to connect between the kit and terminal. The connector for both sides
are DB9 female. We may build it or buying from
computer stores.

For new PC or laptop computer without the RS232 port.


It has only USB port, we may have the RS232C port by
using the USB to RS232 converter.

DATA FRAME for UART COMMUNICATION

Serial data that communicated between kit and terminal


is asynchronous format. The 68008 kit has no UART chip, instead it uses software
controlled to produce bit rate of 2400 bit/s. The data frame is composed of start bit, 8-
data bit and stop bit. For our kit, period = 1/2400 = 417 microseconds.

Since bit period is provided by machine cycle delay. Thus to send/receive serial data
correctly, all interrupts must be disabled.
17
CONNECTING 8080 KIT TO TERMINAL

We can connect the 8080 kit to a terminal by RS232C cross cable. You may
download free terminal program, teraterm from this URL,
http://ttssh2.sourceforge.jp/index.html.en

RS232C cross cable

VT100 Terminal

8080 Kit
The example shows connecting laptop with COM1 port to the RS232C port of the
8080 kit. New laptop that has no COM port, we may use the USB-RS232 adapter for
converting the USB port to RS232 port.

To download Intel hex file that generated from the assembler or c compiler, set serial
port speed to 2400 bit/s, 8-data bit, no parity, no flow control, one stop bit.

Step 1 Run teraterm, then click at Serial connection.

18
Step 2 Click setup>Serial port.

Step 3 Set serial port speed to 2400 and format as shown below.

19
Step 4 Press ENTER key on terminal. The kit will connect terminal automatically.
Press key ? For help commands list.

Press key L for hex file downloading.

Step 5 On PC, Click file>Send File>TEST1.HEX.

20
The kit will read the hex file, write to memory, when completed if no checksum error, the
display will show no errors.

Press key J then ENTER, the CPU to jump to location 8100, running the code. More
terminal commands are compatible with 8085 kit.

21
EXPANSION BUS HEADER

JP1, 40-pin header provides CPU bus signals for expansion or I/O interfacing.
Students may learn how to make the simple I/O port, interfacing to Analog-to-Digital
Converter, interfacing to stepper motor or AC power circuits.

22
10ms TICK GENERATOR

SW1 is a selector for interrupt source between key INTR or 10ms tick produced by
89C2051 microcontroller. Tick generator is software controlled using timer0 interrupt
in the 89C2051 chip. The active low tick signal is sent to P3.7. For tick running
indicator, P1.7 drives D2 LED.

10ms tick

Tick is a 10ms periodic signal for triggering the 8080 INTR pin. When select SW1 to
Tick, the 8080 CPU can be triggered by the external interrupt. The 100Hz tick or
10ms tick can be used to produce tasks that executed with multiple of tick.

10ms 10ms 10ms

NOTE: Key TEST, will use 10ms tick for making binary counting at 100Hz rate.

23
RST 7 STROBING by 8228 BUS CONTROLLER

The 8228 bus controller provides RST 7 instruction code (FF) on the data bus when it
get interrupt recognition from CPU. Sample code for testing interrupt with RST 7
strobing by 8228 bus controller.
0002 8038 .ORG 8038H
0003 8038 C3 04 81 JMP SERVICE_RST7
0004 803B
0005 8100 .ORG 8100H
0006 8100
0007 8100 FB MAIN EI
0008 8101 C3 01 81 JMP $
0009 8104
0010 8104
0011 8104 SERVICE_RST7
0012 8104
0013 8104 3C INR A
0014 8105 D3 00 OUT 0
0015 8107 FB EI
0016 8108 C9 RET
0017 8109
0018 8109 .END
0019 8109
0020 8109
tasm: Number of errors = 0

The interrupt vector for RST 7 instruction is located at 0038H in ROM, the kit has
relocated it to 8038 in RAM. User can enter the service routine for RST 7 then.
To test this code, enter the instruction hex code to memory 8100 to 8108 and the code
for jump instruction at 8038.

Set SW1 to INTR. Press key HOME, then GO. The INTE led will be lit waiting for
INTR signal. Try pressing the INTR key. What is happening at the GPIO1 LED?

Now if we set SW1 to 10ms tick signal, try run it again. We will see the binary
counting with 100Hz rate.

24
CONNECTING LCD MODULE

JR1 is 16-pin header for connecting the LCD module. The example shows connecting
the 20x2 line text LCD module. R6 is a current limit resistor for back-light. R10 is
trimmer POT for contrast adjustment. The LCD module is interfaced to the 8080 bus
directly. The command and data registers are located in I/O space having address
from 80H to 83H.

Be advised that plugging or removing the LCD module must be done when the
kit is powered off.

Text LCD module accepts ASCII codes for displaying the message on screen.

Without settings the LCD by software, no characters will be displayed. The first line
will be black line by adjusting the R10 for contrast adjustment.

If the LCD module is connected, key TEST will write text to the LCD for testing.

Any text LCD with HD44780 compatible controller can be used.

25
+12V, -5V POWER SUPPLY

The 8080 CPU requires +12V, -5V, +5V power supply. +5V is produced by 7805
voltage regulator. +12V is produced by DC-to-DC converter circuit using the
MC34063 chip. R5 and R8 must be carefully selected for +12V output.

Negative -5V power supply is produced by ICL7660 circuit.

Importance note: use digital multimeter for checking +12V and -5V before insert the
CPU!

26
LOGIC PROBE POWER SUPPLY

The kit provides test points TP1(+5V) and TP2(GND) for using the logic probe.
Students may learn digital logic signals with logic probe easily. Tick signal is
indicated by D2 LED blinking. Red clip is for +5V and Black clip for GND.

+ 5V at TP1

GND at TP2

27
HARDWARE SCHEMATIC, PARTS LIST
5 4 3 2 1

+12V I/O expansion connector +5V


+5V VCC
IDDmax 70mA HEADER 20X2 JP1
D0
VCC D1 1 2
D2 3 4
D3 5 6

28
U1 7 8

2
HM62256B 27C256 D4 + C1
-5V D5 9 10
U2 U3

VDD

GND
A0 A0 10 D0 A0 D0 D6 11 12 22uF
11 25 11 10 11
+5V VBB A0 A1 A1 9 A0 D0 D1 A1 A0 O0 D1 D7 13 14
26 12 9 12
D C2 A1 A2 A2 8 A1 D1 D2 A2 A1 O1 D2 A0 15 16 D
27 13 8 13
100nF ICCmax 80mA20 A2 A3 A3 7 A2 D2 D3 A3 A2 O2 D3 A1 17 18
29 15 7 15
VCC A3 A4 A4 6 A3 D3 D4 A4 A3 O3 D4 A2 19 20
30 16 6 16
+ C3 A4 A5 A5 5 A4 D4 D5 A5 A4 O4 D5 A3 21 22
31 17 5 17
10uF A5 A6 A6 4 A5 D5 D6 A6 A5 O5 D6 A4 23 24 INTR
32 18 4 18
A6 A7 A7 3 A6 D6 D7 A7 A6 O6 D7 A5 25 26 RESET_HI
33 19 3 19
A7 A8 A7 D7 A8 A7 O7 A6 27 28 IOWR
24 34 25 25
WAIT A8 A9 A8 A9 A8 A7 29 30 IORD
35 24 24
A9 A10 A9 A10 A9 31 32 CLK
23 1 21 21
READY A10 A11 A10 A11 A10 33 34
40 23 23
A11 A12 A11 A12 A11 35 36
37 2 2
A12 A13 A12 A13 A12 U4 37 38
38 26 26
A13 A14 A13 A14 A13 39 40
12 39 1 27
RESET A14 A15 A14 A14 D0
36 2 19
A15 U5 RAMCE ROMCE D1 1D 1Q
20 20 3 18
ICCmax 190mA MRD CE MRD CE D2 2D 2Q
22 22 4 17
D0 MWR OE +5V OE D3 3D 3Q
13 10 15 13 27 1 5 16
HOLD D0 D0 DB0 D1 WE VPP D4 4D 4Q
9 17 16 6 15
SYNC D1 D1 DB1 D2 0x1000-0x8FFF 0x0000-0x0FFF D5 5D 5Q
19 8 12 11 7 14
SYNC D2 D3_HALT D2 DB2 D3 +12V D6 6D 6Q
7 10 9 User RAM monitor ROM 8 13
D3 D3 DB3 D4 D7 7D 7Q
3 6 5 9 12
INT D4 D4 DB4 D5 8D 8Q
14 4 19 18
INT D5 D5 DB5 D6 R17 RST7 opcode strobing GPIO1
5 21 20 11
INTE D6 D6 DB6 D7 1k U6 LE
C 16 6 8 7 1 C
INTE D7 D7 DB7 VCC OE
22 23 INTA A15 2 12 RAMCE 20
BUSEN INTA IORD INTR I I/O/Q ROMCE VCC D1 D2 D3 D4 D5 D6 D7 D8
17 4 25 3 13
DBIN DBIN I/OR IOWR A14 I I/O/Q INT
21 2 27 4 14
HDLA HLDA I/OW MWR A5 I I/O/Q GPIO1 74HC573
1 26 5 15
SSTB MEMW MRD A6 I I/O/Q +5V
18 3 24 6 16 LCD_E
WR +5V WR MEMR A7 I I/O/Q VLED
CLK1

CLK2

7 17 PORT0
IORD I I/O/Q ESP switch
28 8 18 PORT1
VCC IOWR I I/O/Q R2 10ms Tick D9
9 19 PORT2
+ C4 I I/O/Q 10kSW1 LED 3mm
8080 1N5236A
22

15

10uFAM8228 A13 1 1 TICK


A12 I/CLK INTR TICK
12MHz 11 2
+5V +5V I/OE
Y1 3
Xtal 18.432MHz +5V HALT LED (RED) SW2 D0
D1 D0
GAL16V8B
VLED D2 D1
D18
INTR test switch D3 D2
R1 U27A INT
C24 D3

4
4.7k U7 R3 D14 D4
10pF ICC115mA R4 D5 D4
S1 RESET 10K D3_HALT 2 5 0.5 +5V +12V

PR
1N4148 D Q D6 D5
15
XTAL1 ø1
11
RESET
16x2 text LCD interface D7 D6
14 10 3 D7
XTAL2 ø2 CLK C5
6
RDYIN ø2TTL 10uF 10V 220pF R5 JR1
3 6

CL
RESET RDYIN + C6 STSTB Q 20k +5V
B 2
RESIN OSC
12 R2 B

6
1 4 74HC74 U8 16 R6 10
RST RDY 16

1
5 3 5 15

VCC
3

SYNC KIA7042 R7 TCAP COMP 15 D7


7 7 14
STSTB +5V IPK R8 14 D6
13 2 8 13
+12V TANK Q1 220 IDC 2.2k 13 D5
RESET_HI CLK R1 12
12
D4
9 1 11

GND
IDD 12mA VDD +5V L1 ISWC 11 D3
1

2 10
+5V STSTB 100uH ISWE 10 D2
9
AM8224 +5V +12V D10 MC34063A 9 D1
8
8 D0

4
7
7
6
10

U27B 6 LCD_E
D19 U9 C7 + 1N4148 5 R/W A1
8

INTE VLED -5V 100nF 5 RS A0


12 9 4
PR

D Q C8 100uF35V 4
2 5 3
VCC

STSTB + C9 CAP+ VOUT VPP = +1.25(1+R2/R1) 3


11 INTE LED (Yellow) 4 2
CLK 10uF CAP- 2
10uF 1
+
C10 R9 1
8 6 D11
CL

Q LV
74HC74 7 CONN RECT 16 +5V
OSC
13

2
+5V POWER 4.7k
+5V 1 3
TP1 ICL7660 U10 J1
VCC LM2940/TO D12 DC input
A +5V 3 1 VH 2 1 1 R10 A
1 VOUT VIN 10K
C13 10uF 16V
GND

+ + 1N4007 D15

2
C14 C15 C16 C17
C11 C18 C19 C12
0.1uF 0.1uF 0.1uF 0.1uF TVS15V DO-214AC
TP2 0.1uF 0.1uF 1000uF 16V Title
8080 Microprocessor Kit
2

DC2
GND 1 Size Document Number Rev
0.1uF B <Doc> 2
Designed by Wichit Sirichote, (C) 2016
Date: Friday, May 06, 2016 Sheet 1 of 3
5 4 3 2 1
5 4 3 2 1

U13 U11 U12

D0 2 19 E A 14 A 14
D1 1D 1Q G B A B A
3 18 16 16
D2 2D 2Q F C B C B
4 17 13 13
D3 3D 3Q A D C D C
5 16 3 3
D4 4D 4Q B E D E D
6 15 5 5
D5 5D 5Q C F E F E
7 14 11 11
D6 6D 6Q DP G F G F
8 13 15 15
D D7 7D 7Q D DP G DP G D
9 12 7 7
8D 8Q DP DP
11

DIGIT1

DIGIT2

DIGIT3

DIGIT4

DIGIT1

DIGIT2

DIGIT3

DIGIT4
PORT2 LE
1 4 4
VCC OE L1L2L3 L1L2L3
20
VCC
LTC-4727JR LTC-4727JR
J2

8
D0 74HC573
D1 D0 1
D2 D1 7-segment test 2
D3 D2 3
D4 D3
U14 CON3
D5 D4
D6 D5 D0 PC0
D6 2 19
D7 D1 1D 1Q PC1
D7 3 18
D2 2D 2Q PC2
4 17
D3 3D 3Q PC3 10k RESISTOR SIP 9 R11 VCC
5 16
D4 4D 4Q PC4 PC0
6 15 2 1
D5 5D 5Q PC5 PC1
7 14 3
D6 6D 6Q PC2
8 13 TXD 4
D7 7D 7Q PC7 SPEAKER PC3
9 12 5
8D 8Q PC4
+5V VCC 6
11 PC5 7
C PORT1 LE C
RESET_HI 1 8
VCC OE 0x01
VCC 9
20 PC5 C
VCC PC4
74HC573 PC3
PC2
PC1
PC0

1
R12
S2 S3 S4 S5 S6 S24 SPEAKER 2 Q2
BC557
U15 4.7k
RESET

3
D0 18 2 PA0
D1 Y1 A1 PA1
17 3 S7 S8 S9 S10 S11 S25
D2 Y2 A2 PA2
16 4 LS1
D3 Y3 A3 PA3
15 5
D4 Y4 A4 PA4 INTR
14 6
D5 Y5 A5 PA5
13 7 RXD
D6 Y6 A6 PA6
B 12 8 S12 S13 S14 S15 S16 S26 SPEAKER B
D7 Y7 A7 PA7 +5V
11 9 S27
Y8 A8 R13
USER
1
G1 VCC 10
PORT0 19 S17 S18 S19 S20 S21 S22
G2 S23
20
VCC
74HC541 REP

10k RESISTOR SIP 9 R14 VCC


+5V PA0 2 1
PA1 3
Programmable system tick +5V PA2 4
10uF 10V 10uF C21 PA3 5
PA4
+
U16 TP3 C20 6

+
R15 PA5 7
2 12 TICK/2 680 U17 PA6 8
P3.0/RXD P1.0/AIN0 1 PA7
3 13 2 1 9
P3.1/TXD P1.1/AIN1 VB1 V+ C+ 10uF C
6 14 3
P3.2/INTO P1.2 TEST POINT D13 C1-
7 15 5 6 4
P3.3/INT1 P1.3 C22 V- C2+
8 16 LED 9 5
P3.4/T0 P1.4 + C2-

+
9 17 4 C23
A P3.5/T1 P1.5 10uF A
18 8
P1.6
19 3 14 11 TXD
P1.7 T1OUT T1IN
CLK 5 7 7 10
XTAL1 T2OUT T2IN
4 2 13 12 RXD
XTAL2 R1IN R1OUT
6 8 9
TICK R2IN R2OUT Title
RESET_HI 1 11 TICK 1
+5V RST/VPP P3.7 8080 Microprocessor Kit
20 SUB-D 9, Male (cross cable) MAX232A
VCC Size Document Number Rev
B <Doc> 1
AT89C2051
Date: Friday, May 06, 2016 Sheet 2 of 3
5 4 3 2 1
PARTS LIST R15 680
R17 1k
Semiconductors
Capacitors
U1 8080AP, 8-bit Microprocessor
U2 HM62256B, 32kB SRAM C1 22uF
U3 27C256, 32kB EPROM C7,C2 100nF
U5 AM8228, BUS controller C3,C4,C9,C10,C21,C22,C23 10uF
U4,U13,U14 74HC573, 8-bit data latch C5 220pF
U6 GAL16V8B, PLD C20,C6 10uF 10V
U7 AM8224, oscillator C8 100uF35V
U8 MC34063A, DC-to-DC converter for C11 10uF 16V
+12V generation C12 1000uF 16V
U9 ICL7660, voltage converter for -5V C13,C14,C15,C16,C17 0.1uF
generation C18,C19 0.1uF
U10 LM7805 C24 10pF
U12,U11 LTC-4727JF, 7-segment LED
U15 74HC541, 8-bit tri-state buffer Additional parts
U16 AT89C2051, microcontroller
U17 MAX232A, rs232 converter JP1 HEADER 20X2
U27 74HC74, dual data latch for HALT JR1 CONN RECT 16
and INTE indicators. J1 DC input
D1,D2,D4,D5,D6,D7,D8,D13 LED J2 CON3
D3 LED 3mm LS1 SPEAKER
D9 1N5236A L1 100uH
D10,D14 1N4148
D11 POWER SW1 ESP switch
D12 1N4007
D15 TVS15V DO-214AC SW2 INT
D18 HALT LED (RED) S1 RESET
D19 INTE LED (Yellow) S2,S3,S4,S5,S6,S7,S8,S9, SW PUSH
Q1 KIA7042, voltage detector BUTTON
Q2 BC557, PNP transistor S10,S11,S12,S13,S14,S15,
Resistors (all resistors are 1/8W +/-5%) S16,S17,S18,S19,S20,S21,
S22,S23,S24,S25,S26,S27
R1,R9,R12 4.7k TP1 +5V
R2,R3,R10 10K TP2 GND
R4 0.5 TP3 TEST POINT
R5 20k
R13,R6 10
R7 220 VB1 SUB-D 9, Male (cross cable)
R8 2.2k Y1 XTAL 18.432MHz
R14,R11 10k RESISTOR SIP 9
PCB double side plate through hole
LED cover Clear RED color acrylic
plastic
Keyboard sticker printable SVG file
MONITOR PROGRAM LISTINGS
B8080.LST 3/12/2560 20:42

1 ;------------------------------------------------------------
2 ; B8080.ASM
3 ; monitor program for 8080 MICROPROCESSOT TRAINING KIT
4 ; COPYTIGHT (C) 2016 BY WICHIT SIRICHOTE, wichit.sirichote
5 ;
6 ; source file was assembled with C32 Cross Assembler V3.
7 ;
8 ; 18 May 2007 add insert byte, ALT E
9 ; delete byte, ALT D
10 ; click sound when key pressed
11 ;
12 ; 8 March 2015 remove repeat key
13 ; modified address and data entry mode
14 ; 3 April 2016 replace buzzer with small speaker for tone
15 ; add beep/no beep with ALT F press
16 ; 16 April 2016 add delay after no beep
17
18 ; 24 April 2016 modify the source code for 8080 kit
19 ; 27 April 2016 test 1200 bit/s software UART
20 ; 30 April 2016 change Xtal to 18.432MHz
21 ; 2 May 2016 test serial commands via 2400 bit/s terminal
22 ; 8 May 2016 add test key for LCD, GPIO led, beep and 10
23 ; USER key press will jump to 8050h
24 ; put 76 code on cold boot
25 ; 15 Jan 2017 adjust brightness for Amber LED LTC4727JF
26 ;
27 ;------------------------------------------------------------
28
29 0000 CPU "8085.TBL" ;CPU TABLE
30 0000 HOF "INT8" ;HEX FORMAT
31
32
33 ; ---------- onboard GPIO -----------------------------------
34
35 0000 = gpio equ 0 ; D0-D3 is 4-bit output port, D4-D7 is 4-bit
36
37
38 ;---------- 8255 PPI system port I/O address ----------------
39
40 0020 = port0: equ 20h
41 0060 = port2: equ 60h
42 0040 = port1: equ 40h
43
44 0060 = segment: equ 60h
45 0040 = digit: equ 40h
46 0020 = port0: equ 20h
47
48
49
50 ;-------------------- 8254 counter/timer --------------------
51
52 0020 = counter0_8254 equ 20h
53 0021 = counter1_8254 equ 21h
54 0022 = counter2_8254 equ 22h
55 0023 = control_8254 equ 23h
56
57 0034 = control_word_8254 equ 00110100B ; mode 0, counter0
58
59 ;---------- 8255 PPI user port I/O address ------------------
60

Page 1 of 86
B8080.LST 3/12/2560 20:42

61 0030 = user_port_a: equ 30h


62 0031 = user_port_b: equ 31h
63 0032 = user_port_c: equ 32h
64 0033 = user_port_control: equ 33h
65
66
67 ;---------- 16C550 compatible UART I/O address --------------
68 ; e.g., UM8250B, 16C450, 16C550
69
70 0040 = uart_buffer: equ 40h
71 0045 = uart_line_status: equ 45h
72 0042 = uart_fifo: equ 42h
73 0043 = uart_lcr: equ 43h
74 0040 = uart_divisor_lsb: equ 40h
75 0041 = uart_divisor_msb: equ 41h
76 0047 = uart_scr: equ 47h
77
78
79 ;------------------- onboard LCD registers ------------------
80
81 0080 = command_write equ 80h
82 0082 = command_read equ 82h
83 0081 = data_write equ 81h
84 0083 = data_read equ 83h
85 0080 = busy equ 80h
86
87 0009 = TAB EQU 9 ; ASCII TAB
88 0000 = RS EQU 0 ; terminator
89
90 000D = cr: equ 0dh
91 000A = lf: equ 0ah
92 0020 = sp: equ 20h
93
94
95 F000 = system_ram equ 0f000h
96
97 ;system_stack equ 0ffffh
98
99 8100 = home_address equ 8100h
100
101 0000 = rom equ 0 ; 8000h ; change to 8000 for
102 ; change to 0000 for rom progra
103
104 8000 = my_rom equ 8000h
105
106 0000 ORG rom
107 0000 C30001 JMP START ; reset vector
108
109 0008 ORG rom+8 ; RST 1 opcode is CF
110 0008 C34402 jmp monitor_call
111
112 0010 ORG rom+10h ; RST 2 used for testing RST
113 ; jmp service_rst2
114
115 0010 C31080 jmp my_rom+10h
116
117 0018 ORG rom+18h ; DF RST 3 for testing monitor
118 ; jmp my_rom+18h
119 0018 C37602 jmp service_rst7 ; use RST 3, DF to return to
120

Page 2 of 86
B8080.LST 3/12/2560 20:42

121 ; jmp monitor_call


122
123 0020 ORG rom+20h ; RST 4
124 0020 C32080 jmp my_rom+20h
125
126 0024 ORG rom+24h
127 ; jmp my_rom+24h
128 0024 C3BD02 jmp service_trap ; sing step running service
129
130 0028 ORG rom+28h ; RST 5
131 0028 C32880 jmp my_rom+28h
132
133 002C ORG rom+2ch ; relocate RST5.5 to external
134 002C C32C80 jmp my_rom+2ch
135
136 0030 ORG rom+30h ; relocate RST 6
137 0030 C33080 jmp my_rom+30h
138
139 0034 ORG rom+34h ; relocate RST6.5 to external
140 0034 C33480 jmp my_rom+34h
141
142 ; test hardware interrupt with FF on the bus
143
144 0038 ORG ROM+38H
145 0038 C33880 jmp my_rom+38h ;service_rst7 ; RST 7 service
146
147 003C ORG rom+3ch ; relocate RST7.5 to external
148 003C C33C80 jmp my_rom+3ch
149
150
151 0100 ORG rom+100h
152
153
154 0100 F3 START di
155 0101 3179F0 lxi sp,system_stack+32 ; point to top of system
156 0104 2199F0 lxi h,user_stack+32 ; point to top of user stack
157 0107 2234F0 shld user_SP
158
159 010A 3E00 mvi a,0
160 010C D360 out segment ; turn off display
161
162
163
164
165 ; NVRAM booting
166 ; if location 8000H has C3 opcode then jump to 8000H
167 ; if user press USER1 with RESET put 00 to 8000H
168 ; ans skip booting
169
170 010E DB20 in port0
171 0110 E680 ani 80h
172 0112 CA2201 jz skip_boot
173
174 0115 3A0080 lda 8000H
175 0118 FEC3 cpi 0c3h
176 011A C22201 jnz skip_boot
177 011D 210080 lxi h,8000h
178 0120 E5 push h
179 0121 C9 ret ; jump to NVRAM
180

Page 3 of 86
B8080.LST 3/12/2560 20:42

181
182 0122 AF skip_boot: xra a ; write 00 to 8000H
183 0123 320080 sta 8000H
184 ; sta counter1 ; clear counter1
185
186 0126 3A29F0 lda warm_code
187 0129 FE24 cpi "$"
188 012B CA4701 jz skip_cold_boot
189
190 012E 3E24 mvi a,"$"
191 0130 3229F0 sta warm_code
192
193 0133 CD2306 call test_buzzer
194
195 0136 3EFF mvi a,0ffh
196 0138 D300 out gpio ; make GPIO LED on
197
198 013A CD6C0B call cold_boot
199
200 013D 3E00 mvi a, 0
201 013F 3224F0 sta beep_flag
202
203 0142 3E76 mvi a,76h
204 0144 325080 sta 8050h ; put HALT to location 8050h,
205
206
207
208 0147 skip_cold_boot:
209
210
211 0147 210081 lxi h,home_address
212 014A 222AF0 shld user_PC
213 014D 223CF0 shld pointer
214
215 0150 3A25F0 lda uart_found
216 0153 FE00 cpi 0
217 0155 CA5E01 jz skip_send_prompt
218
219 0158 CDFD12 call send_prompt3
220
221 015B CD920D call send_prompt
222
223
224 015E skip_send_prompt:
225
226 015E AF xra a
227 015F D300 out gpio ; turn LED off
228
229 0161 3E00 mvi a,0
230 0163 3226F0 sta entry_mode ; set data entry mode
231 0166 CDB40A call read_memory
232
233 0169 CD7C0C main: call scan_key
234 016C CD6105 call key_execute
235 016F F26901 jp main
236
237
238 ;---------------- initialize counter0 for RST7.5 interrupt
239
240 0172 3E34 init_8254: mvi a, control_word_8254

Page 4 of 86
B8080.LST 3/12/2560 20:42

241 0174 D323 out control_8254


242 0176 AF xra a
243 0177 D320 out counter0_8254
244 0179 D320 out counter0_8254
245 017B C9 ret
246
247 ; convert 8-bit unsigned in A to ASCII string in line_buffer
248 ; entry: A
249
250 017C bin2ascii:
251 017C 1E00 mvi e,0
252
253 017E FE64 bin1 cpi 100
254 0180 DA8901 jc bin2
255 0183 D664 sui 100
256 0185 1C inr e
257 0186 C37E01 jmp bin1
258
259 0189 57 bin2: mov d,a
260 018A 7B mov a,e
261 018B C630 adi "0"
262 018D 3247F0 sta line_buffer
263 0190 7A mov a,d
264 0191 1E00 mvi e,0
265
266 0193 FE0A bin3: cpi 10
267 0195 DA9E01 jc bin4
268 0198 D60A sui 10
269 019A 1C inr e
270 019B C39301 jmp bin3
271
272 019E 57 bin4: mov d,a
273 019F 7B mov a,e
274 01A0 C630 adi "0"
275 01A2 3248F0 sta line_buffer+1
276 01A5 7A mov a,d
277 01A6 C630 adi "0"
278 01A8 3249F0 sta line_buffer+2
279 01AB C9 ret
280
281
282 ; print 8-bit unsigned decimal to terminal
283 ; entry: A
284
285 01AC CD7C01 pint8u: call bin2ascii
286 01AF 3A47F0 lda line_buffer
287 01B2 FE30 cpi "0"
288 01B4 CAC701 jz pint1
289 01B7 CD8712 call cout
290 01BA 3A48F0 lda line_buffer+1
291 01BD CD8712 call cout
292 01C0 3A49F0 lda line_buffer+2
293 01C3 CD8712 call cout
294 01C6 C9 ret
295
296 01C7 3A48F0 pint1: lda line_buffer+1
297 01CA FE30 cpi "0"
298 01CC CAD201 jz pint2
299 01CF CD8712 call cout
300

Page 5 of 86
B8080.LST 3/12/2560 20:42

301 01D2 3A49F0 pint2: lda line_buffer+2


302 01D5 CD8712 call cout
303 01D8 C9 ret
304
305
306 ; convert 16-bit unsigned integer to ASCII code stored in
307 ; entry: HL
308
309
310
311
312
313
314
315
316
317
318 ;--------------------- LCD driver routines ------------------
319
320 01D9 F5 lcd_ready: push psw
321
322 01DA DB82 lcd_ready1: in command_read
323 01DC E680 ani 80h
324 01DE C2DA01 jnz lcd_ready1
325 01E1 ready2:
326 01E1 F1 pop psw
327
328 01E2 C9 ret
329
330 01E3 CDD901 clear_lcd: call lcd_ready
331 01E6 3E01 mvi a,1
332 01E8 D380 out command_write
333 01EA C9 exit_clear: ret
334
335 01EB CDD901 init_lcd: call lcd_ready
336 01EE 3E38 mvi a,38h
337 01F0 D380 out command_write
338 01F2 CDD901 call lcd_ready
339 01F5 3E0C mvi a, 0ch
340 01F7 D380 out command_write
341 01F9 CDE301 call clear_lcd
342
343 01FC C9 ret
344
345 ; print ASCII text on LCD
346 ; entry: HL pointer with 0 for end of string
347
348 01FD 7E put_str_lcd: mov a,m ; get A from [HL]
349 01FE FE00 cpi 0
350 0200 C20402 jnz put_str_lcd1
351 0203 C9 ret
352
353 0204 put_str_lcd1:
354
355 0204 CDD901 call lcd_ready
356 0207 D381 out data_write
357 0209 23 inx h
358 020A F2FD01 jp put_str_lcd
359
360 ; goto_xy set cursor location on lcd

Page 6 of 86
B8080.LST 3/12/2560 20:42

361 ; entry: HL: H = x, L = y


362
363 020D CDD901 goto_xy: call lcd_ready
364 0210 7D mov a,l
365 0211 FE00 cpi 0
366 0213 C21C02 jnz goto_xy1
367 0216 7C mov a,h
368 0217 C680 adi 80h
369 0219 D380 out command_write
370 021B C9 ret
371
372 021C FE01 goto_xy1: cpi 1
373 021E C22702 jnz goto_xy2
374 0221 7C mov a,h
375 0222 C6C0 adi 0c0h
376 0224 D380 out command_write
377 0226 C9 ret
378
379 0227 FE02 goto_xy2: cpi 2
380 0229 C23202 jnz goto_xy3
381 022C 7C mov a,h
382 022D C694 adi 094h
383 022F D380 out command_write
384 0231 C9 ret
385
386 0232 FE03 goto_xy3: cpi 3
387 0234 C23D02 jnz goto_xy4
388 0237 7C mov a,h
389 0238 C6D4 adi 0d4h
390 023A D380 out command_write
391 023C C9 ret
392
393 023D C9 goto_xy4: ret
394
395 ; put_ch_lcd put character to lcd
396 ; entry: A
397
398 023E CDD901 put_ch_lcd: call lcd_ready
399 0241 D381 out data_write
400 0243 C9 ret
401
402 ;------------------------------------------------------------
403
404 ; monitor call entry
405 ; entry: E = monitor call number 0-255
406 ; calling monitor function is made with RST 1 command after
407 ; regsiter E with call number
408 ; destroy: BC user must save it in stack memory
409
410 0244 E5 monitor_call: push h
411 0245 F5 push psw
412 0246 D5 push d
413
414 0247 7B mov a,e ; get call number
415 0248 07 rlc ; x2
416 0249 5F mov e,a ; put it back
417
418 024A 215802 lxi h,vector_table
419 024D 1600 mvi d,0
420 024F 19 dad d ; get location in jump table

Page 7 of 86
B8080.LST 3/12/2560 20:42

421 0250 4E mov c,m


422 0251 23 inx h
423 0252 46 mov b,m
424
425 0253 D1 pop d
426 0254 F1 pop psw
427 0255 E1 pop h
428
429 0256 C5 push b ; push address into top of stack
430
431 0257 C9 ret ; jump to monitor call function
432
433 0258 vector_table:
434 0258 960B dwl demo ; #0 running LED with HL pointer
435 025A F605 dwl delay ; #1 simple delay routine
436 025C 6C0B dwl cold_boot ; #2 show 8085 running
437 025E AC0C dwl scan ; #3 scan display one cycle
438 0260 8F12 dwl cin ; #4 get byte from console
439 0262 8712 dwl cout ; #5 print byte to console
440 0264 AD12 dwl put_str ; #6 print string with 0 terminato
441 0266 EB01 dwl init_lcd ; #7 initialize lcd
442 0268 D901 dwl lcd_ready ; #8 wait until lcd is ready
443 026A E301 dwl clear_lcd ; #9 clear lcd display
444 026C 0D02 dwl goto_xy ; #10 set lcd cursor position
445 026E FD01 dwl put_str_lcd ; #11 print ASCII string
446 0270 3E02 dwl put_ch_lcd ; #12 print ASCII letter
447 0272 E805 dwl test_led ; #13 run LED onboard
448 0274 AC01 dwl pint8u ; #14 print 8-bit unsigned
449
450
451
452 ; save CPU registers to stack and write them to user register
453 ;
454
455 0276 service_rst7:
456 0276 F5 push psw
457 0277 C5 push b
458 0278 D5 push d
459
460 0279 E1 pop h
461 027A 2230F0 shld user_DE
462 027D E1 pop h
463 027E 222EF0 shld user_BC
464 0281 E1 pop h
465 0282 222CF0 shld user_AF
466 0285 E1 pop h
467
468 0286 222AF0 shld user_PC ; store next PC
469
470 0289 210000 lxi h,0000h
471 028C 39 dad sp ; get SP
472 028D 2234F0 shld user_SP ; save user SP
473
474 0290 CDB40A call read_memory
475 ; call register_display1
476
477 0293 2A57F0 lhld save_stack
478
479 0296 F9 sphl ; restore system stack
480

Page 8 of 86
B8080.LST 3/12/2560 20:42

481
482 0297 C9 ret
483
484
485 ; test diplay register after break
486 ; RST 2 opcode is D7
487 ; later will be changed to RST 7
488
489 0298 service_rst2:
490 0298 F5 push psw
491 0299 C5 push b
492 029A D5 push d
493
494 029B E1 pop h
495 029C 2230F0 shld user_DE
496 029F E1 pop h
497 02A0 222EF0 shld user_BC
498 02A3 E1 pop h
499 02A4 222CF0 shld user_AF
500 02A7 E1 pop h
501
502 02A8 222AF0 shld user_PC ; store next PC
503
504 02AB 210000 lxi h,0000h
505 02AE 39 dad sp ; get content of SP
506
507 02AF 2234F0 shld user_SP ; save user SP
508
509 02B2 CDB40A call read_memory
510 02B5 CDAC0F call register_display1
511
512 02B8 2A57F0 lhld save_stack
513
514 02BB F9 sphl ; restore system stack
515
516
517 02BC C9 ret
518
519
520 ; service trap for single step running
521 ; disable trap input by setting system port c.6
522 ; save CPU registers to user registers
523
524 02BD service_trap:
525 02BD F5 push psw ; save A and Flag
526
527 02BE 3EFF mvi a,0ffh
528 02C0 D340 out port1 ; turn trap off by clearing shift
529
530 02C2 C5 push b
531 02C3 D5 push d
532 02C4 E5 push h
533
534 02C5 E1 pop h
535 02C6 2232F0 shld user_HL ; save HL
536 02C9 E1 pop h
537 02CA 2230F0 shld user_DE
538 02CD E1 pop h
539 02CE 222EF0 shld user_BC
540 02D1 E1 pop h

Page 9 of 86
B8080.LST 3/12/2560 20:42

541 02D2 222CF0 shld user_AF


542
543 02D5 E1 pop h ; store next PC
544 02D6 222AF0 shld user_PC
545
546 02D9 210000 lxi h,0
547 02DC 39 dad sp
548 02DD 2234F0 shld user_SP ; save user SP
549
550 02E0 CDB40A call read_memory
551
552 02E3 3A25F0 lda uart_found
553 02E6 FE00 cpi 0
554 02E8 CAEE02 jz skip1
555 02EB CDAC0F call register_display1
556
557 02EE skip1:
558 02EE 2A57F0 lhld save_stack
559
560 02F1 F9 sphl ; restore system stack
561
562 02F2 C9 ret ; jump back to main body
563
564
565 ; disassemble machine code into mnemonic
566
567 02F3 disassemble1:
568 02F3 3A22F0 lda command
569 02F6 FE64 cpi "d"
570 02F8 C21903 jnz exit_disassemble
571
572 02FB 21B01F lxi h,disassemble_text
573 02FE CDAD12 call put_str
574
575 0301 CD2413 call new_line
576 0304 0E10 mvi c,16 ; 16 lines
577
578
579 0306 C5 dis2: push b
580
581 0307 CD2413 call new_line
582
583 030A CD9003 call d_disassemble
584
585 030D C1 pop b
586 030E 0D dcr c
587 030F C20603 jnz dis2
588
589 0312 CD2413 call new_Line
590 0315 CD920D call send_prompt
591 0318 C9 ret
592
593
594 0319 C9 exit_disassemble: ret
595
596
597 ; disassemble opcode to mnemonic
598 ; entry: user_PC
599 ; exit: user_PC = next address
600

Page 10 of 86
B8080.LST 3/12/2560 20:42

601 031A 2A2AF0 disassemble: lhld user_PC


602
603 031D E5 push h
604
605 031E 7C mov a,h
606 031F CD1513 call out2x
607 0322 7D mov a,l
608 0323 CD1513 call out2x
609 0326 CD2F13 call space
610
611 0329 7E mov a,m ; get opcode
612 032A CD0604 call get_number_of_byte
613 032D 4F mov c,a
614
615 032E 7E disassem3: mov a,m
616 032F CD1513 call out2x
617 0332 23 inx h
618 0333 0D dcr c
619 0334 C22E03 jnz disassem3
620
621 0337 E1 pop h
622
623 0338 7E mov a,m
624 0339 CD0604 call get_number_of_byte
625 033C FE01 cpi 1
626 033E C24603 jnz one_tab
627
628 0341 3E09 mvi a,tab ; print two tabs for one
629 0343 CD8712 call cout
630
631 0346 3E09 one_tab: mvi a,tab ; else only one tab
632 0348 CD8712 call cout
633
634 034B E5 push h
635
636 034C 7E mov a,m ; get opcode
637
638 034D F5 push psw
639
640 034E 210000 lxi h,0000h ; clear HL
641 0351 6F mov l,a
642
643 0352 29 dad h ; HL = HLx2
644
645 0353 5D mov e,l
646 0354 54 mov d,h
647
648 0355 212B16 lxi h,ins_table
649 0358 19 dad d ; ADD HL,DE
650 0359 5E mov e,m
651 035A 23 inx h
652 035B 56 mov d,m
653
654 035C 6B mov l,e
655 035D 62 mov h,d
656
657 035E CDAD12 call put_str
658
659 0361 F1 pop psw
660 0362 E1 pop h

Page 11 of 86
B8080.LST 3/12/2560 20:42

661
662 0363 CD0604 call get_number_of_byte
663 0366 FE01 cpi 1
664 0368 C27003 jnz disassem1
665 036B 23 inx h
666 036C 222AF0 shld user_PC
667 036F C9 ret
668
669 0370 FE02 disassem1: cpi 2
670 0372 C27F03 jnz disassem2
671 0375 23 inx h
672 0376 7E mov a,m
673 0377 CD1513 call out2x
674 037A 23 inx h
675 037B 222AF0 shld user_PC
676 037E C9 ret
677
678 037F 23 disassem2: inx h
679 0380 23 inx h
680 0381 7E mov a,m
681 0382 CD1513 call out2x
682 0385 2B dcx h
683 0386 7E mov a,m
684 0387 CD1513 call out2x
685 038A 23 inx h
686 038B 23 inx h
687 038C 222AF0 shld user_PC
688 038F C9 ret
689
690 ; disassemble opcode to mnemonic with command 'd'
691 ; entry: pointer
692 ; exit: pointer = next address
693
694 0390 2A3CF0 d_disassemble: lhld pointer
695
696 0393 E5 push h
697
698 0394 7C mov a,h
699 0395 CD1513 call out2x
700 0398 7D mov a,l
701 0399 CD1513 call out2x
702 039C CD2F13 call space
703
704 039F 7E mov a,m ; get opcode
705 03A0 CD0604 call get_number_of_byte
706 03A3 4F mov c,a
707
708 03A4 7E d_disassem3: mov a,m
709 03A5 CD1513 call out2x
710 03A8 23 inx h
711 03A9 0D dcr c
712 03AA C2A403 jnz d_disassem3
713
714 03AD E1 pop h
715
716 03AE 7E mov a,m
717 03AF CD0604 call get_number_of_byte
718 03B2 FE01 cpi 1
719 03B4 C2BC03 jnz d_one_tab
720

Page 12 of 86
B8080.LST 3/12/2560 20:42

721 03B7 3E09 mvi a,tab ; print two tabs for one
722 03B9 CD8712 call cout
723
724 03BC 3E09 d_one_tab: mvi a,tab ; else only one tab
725 03BE CD8712 call cout
726
727 03C1 E5 push h
728
729 03C2 7E mov a,m ; get opcode
730
731 03C3 F5 push psw
732
733 03C4 210000 lxi h,0000h ; clear HL
734 03C7 6F mov l,a
735
736 03C8 29 dad h ; HL = HLx2
737
738 03C9 5D mov e,l
739 03CA 54 mov d,h
740
741 03CB 212B16 lxi h,ins_table
742 03CE 19 dad d ; ADD HL,DE
743 03CF 5E mov e,m
744 03D0 23 inx h
745 03D1 56 mov d,m
746
747 03D2 6B mov l,e
748 03D3 62 mov h,d
749
750 03D4 CDAD12 call put_str
751
752 03D7 F1 pop psw
753 03D8 E1 pop h
754
755 03D9 CD0604 call get_number_of_byte
756 03DC FE01 cpi 1
757 03DE C2E603 jnz d_disassem1
758 03E1 23 inx h
759 03E2 223CF0 shld pointer
760 03E5 C9 ret
761
762 03E6 FE02 d_disassem1: cpi 2
763 03E8 C2F503 jnz d_disassem2
764 03EB 23 inx h
765 03EC 7E mov a,m
766 03ED CD1513 call out2x
767 03F0 23 inx h
768 03F1 223CF0 shld pointer
769 03F4 C9 ret
770
771 03F5 23 d_disassem2: inx h
772 03F6 23 inx h
773 03F7 7E mov a,m
774 03F8 CD1513 call out2x
775 03FB 2B dcx h
776 03FC 7E mov a,m
777 03FD CD1513 call out2x
778 0400 23 inx h
779 0401 23 inx h
780 0402 223CF0 shld pointer

Page 13 of 86
B8080.LST 3/12/2560 20:42

781 0405 C9 ret


782
783
784 ; get number of byte
785 ; entry: A = OPCODE
786 ; exit: A = number of byte, 1,2,3
787 ; 0 = undefined opcode
788
789 0406 get_number_of_byte:
790
791 0406 FE01 cpi 01
792 0408 C20E04 jnz number1
793 040B 3E03 mvi a,3
794 040D C9 ret
795
796 040E FE06 number1: cpi 6
797 0410 C21604 jnz number2
798 0413 3E02 mvi a,2
799 0415 C9 ret
800
801 0416 FE0E number2: cpi 0eh
802 0418 C21E04 jnz number3
803 041B 3E02 mvi a,2
804 041D C9 ret
805
806 041E FE11 number3: cpi 11h
807 0420 C22604 jnz number4
808 0423 3E03 mvi a,3
809 0425 C9 ret
810
811 0426 FE16 number4: cpi 16h
812 0428 C22E04 jnz number5
813 042B 3E02 mvi a,2
814 042D C9 ret
815
816 042E FE1E number5: cpi 1eh
817 0430 C23604 jnz number6
818 0433 3E02 mvi a,2
819 0435 C9 ret
820
821 0436 FE21 number6: cpi 21h
822 0438 C23E04 jnz number7
823 043B 3E03 mvi a,3
824 043D C9 ret
825
826 043E FE22 number7: cpi 22h
827 0440 C24604 jnz number8
828 0443 3E03 mvi a,3
829 0445 C9 ret
830
831 0446 FE26 number8: cpi 26h
832 0448 C24E04 jnz number9
833 044B 3E02 mvi a,2
834 044D C9 ret
835
836 044E FE2A number9: cpi 2ah
837 0450 C25604 jnz number10
838 0453 3E03 mvi a,3
839 0455 C9 ret
840

Page 14 of 86
B8080.LST 3/12/2560 20:42

841 0456 FE2E number10: cpi 2eh


842 0458 C25E04 jnz number11
843 045B 3E02 mvi a,2
844 045D C9 ret
845
846 045E FE31 number11: cpi 31h
847 0460 C26604 jnz number12
848 0463 3E03 mvi a,3
849 0465 C9 ret
850
851 0466 FE32 number12: cpi 32h
852 0468 C26E04 jnz number13
853 046B 3E03 mvi a,3
854 046D C9 ret
855
856 046E FE36 number13: cpi 36h
857 0470 C27604 jnz number14
858 0473 3E03 mvi a,3
859 0475 C9 ret
860
861 0476 FE3A number14: cpi 3ah
862 0478 C27E04 jnz number15
863 047B 3E03 mvi a,3
864 047D C9 ret
865
866 047E FE3E number15: cpi 3eh
867 0480 C28604 jnz number16
868 0483 3E02 mvi a,2
869 0485 C9 ret
870
871 0486 FEC2 number16: cpi 0c2h
872 0488 C28E04 jnz number17
873 048B 3E03 mvi a,3
874 048D C9 ret
875
876 048E FEC3 number17: cpi 0c3h
877 0490 C29604 jnz number18
878 0493 3E03 mvi a,3
879 0495 C9 ret
880
881 0496 FEC4 number18: cpi 0c4h
882 0498 C29E04 jnz number19
883 049B 3E03 mvi a,3
884 049D C9 ret
885
886 049E FEC6 number19: cpi 0c6h
887 04A0 C2A604 jnz number20
888 04A3 3E02 mvi a,2
889 04A5 C9 ret
890
891 04A6 FECA number20: cpi 0cah
892 04A8 C2AE04 jnz number21
893 04AB 3E03 mvi a,3
894 04AD C9 ret
895
896 04AE FECC number21: cpi 0cch
897 04B0 C2B604 jnz number22
898 04B3 3E03 mvi a,3
899 04B5 C9 ret
900

Page 15 of 86
B8080.LST 3/12/2560 20:42

901 04B6 FECD number22: cpi 0cdh


902 04B8 C2BE04 jnz number23
903 04BB 3E03 mvi a,3
904 04BD C9 ret
905
906 04BE FECE number23: cpi 0ceh
907 04C0 C2C604 jnz number24
908 04C3 3E02 mvi a,2
909 04C5 C9 ret
910
911 04C6 FED2 number24: cpi 0d2h
912 04C8 C2CE04 jnz number25
913 04CB 3E03 mvi a,3
914 04CD C9 ret
915
916 04CE FED3 number25: cpi 0d3h
917 04D0 C2D604 jnz number26
918 04D3 3E02 mvi a,2
919 04D5 C9 ret
920
921 04D6 FED4 number26: cpi 0d4h
922 04D8 C2DE04 jnz number27
923 04DB 3E03 mvi a,3
924 04DD C9 ret
925
926 04DE FED6 number27: cpi 0d6h
927 04E0 C2E604 jnz number28
928 04E3 3E02 mvi a,2
929 04E5 C9 ret
930
931 04E6 FEDA number28: cpi 0dah
932 04E8 C2EE04 jnz number29
933 04EB 3E03 mvi a,3
934 04ED C9 ret
935
936 04EE FEDB number29: cpi 0dbh
937 04F0 C2F604 jnz number30
938 04F3 3E02 mvi a,2
939 04F5 C9 ret
940
941 04F6 FEDC number30: cpi 0dch
942 04F8 C2FE04 jnz number31
943 04FB 3E03 mvi a,3
944 04FD C9 ret
945
946 04FE FEE2 number31: cpi 0e2h
947 0500 C20605 jnz number32
948 0503 3E03 mvi a,3
949 0505 C9 ret
950
951 0506 FEE4 number32: cpi 0e4h
952 0508 C20E05 jnz number33
953 050B 3E03 mvi a,3
954 050D C9 ret
955
956 050E FEE6 number33: cpi 0e6h
957 0510 C21605 jnz number34
958 0513 3E02 mvi a,2
959 0515 C9 ret
960

Page 16 of 86
B8080.LST 3/12/2560 20:42

961 0516 FEEA number34: cpi 0eah


962 0518 C21E05 jnz number35
963 051B 3E03 mvi a,3
964 051D C9 ret
965
966 051E FEEC number35: cpi 0ech
967 0520 C22605 jnz number36
968 0523 3E03 mvi a,3
969 0525 C9 ret
970
971 0526 FEEE number36: cpi 0eeh
972 0528 C22E05 jnz number37
973 052B 3E02 mvi a,2
974 052D C9 ret
975
976 052E FEF2 number37: cpi 0f2h
977 0530 C23605 jnz number38
978 0533 3E03 mvi a,3
979 0535 C9 ret
980
981 0536 FEF4 number38: cpi 0f4h
982 0538 C23E05 jnz number39
983 053B 3E03 mvi a,3
984 053D C9 ret
985
986 053E FEF6 number39: cpi 0f6h
987 0540 C24605 jnz number40
988 0543 3E02 mvi a,2
989 0545 C9 ret
990
991 0546 FEFA number40: cpi 0fah
992 0548 C24E05 jnz number41
993 054B 3E03 mvi a,3
994 054D C9 ret
995
996 054E FEFC number41: cpi 0fch
997 0550 C25605 jnz number42
998 0553 3E03 mvi a,3
999 0555 C9 ret
1000
1001 0556 FEFE number42: cpi 0feh
1002 0558 C25E05 jnz number43
1003 055B 3E02 mvi a,2
1004 055D C9 ret
1005
1006 055E 3E01 number43: mvi a,1
1007 0560 C9 ret
1008
1009
1010
1011
1012
1013
1014
1015
1016 ; execute key 0-F or 10H-19H
1017
1018 0561 FE10 key_execute: cpi 10h
1019 0563 D26D05 jnc function_key ; 0-9 jump to data key
1020 0566 57 mov d,a

Page 17 of 86
B8080.LST 3/12/2560 20:42

1021 0567 CD2706 call buzzer


1022 056A F2FF05 jp data_key
1023
1024 056D FE12 function_key: cpi 12h
1025 056F C27805 jnz function1
1026 0572 CD2706 call buzzer
1027 0575 F25B0A jp increment
1028
1029 0578 FE15 function1: cpi 15h
1030 057A C28305 jnz function2
1031 057D CD2706 call buzzer
1032 0580 F26E0A jp decrement
1033
1034 0583 FE10 function2: cpi 10h
1035 0585 C28E05 jnz function3
1036 0588 CD2706 call buzzer
1037 058B F2F709 jp address_mode
1038
1039 058E FE11 function3: cpi 11h
1040 0590 C29905 jnz function4
1041 0593 CD2706 call buzzer
1042 0596 F2040A jp data_mode
1043
1044 0599 FE13 function4: cpi 13h
1045 059B C2A505 jnz function5
1046 059E CD2706 call buzzer
1047 05A1 F29109 jp go
1048 05A4 C9 ret
1049
1050 05A5 FE14 function5: cpi 14h
1051 05A7 C2B005 jnz function6
1052 05AA CD2706 call buzzer
1053 05AD F20F0A jp function_2nd
1054
1055
1056 05B0 FE16 function6: cpi 16h
1057 05B2 C2BB05 jnz function7
1058 05B5 CD2706 call buzzer
1059 05B8 F2BB15 jp test_kit ; test key
1060
1061 05BB FE17 function7: cpi 17h
1062 05BD C2C605 jnz function8
1063 05C0 CD2706 call buzzer
1064 05C3 F27709 jp home
1065
1066 05C6 FE18 function8: cpi 18h
1067 05C8 C2D105 jnz function9
1068 05CB CD2706 call buzzer
1069 05CE F2330A jp modify_register
1070
1071 05D1 FE20 function9: cpi 20h
1072 05D3 C2DC05 jnz function10
1073 05D6 CD2706 call buzzer
1074 05D9 F24D0D jp connect_terminal
1075
1076 05DC FE19 function10 cpi 19h
1077 05DE C2E705 jnz function11
1078 05E1 CD2706 call buzzer ; with key USER pressed
1079 05E4 F25080 jp 8050h ; user can put service routin
1080

Page 18 of 86
B8080.LST 3/12/2560 20:42

1081 05E7 function11


1082 05E7 C9 ret
1083
1084 ; test running onboard led
1085
1086 05E8 3E01 test_led: mvi a,1
1087
1088 05EA D300 test_led1: out gpio
1089 05EC 115010 lxi d,1050h
1090 05EF CDF605 call delay
1091 05F2 07 rlc
1092 05F3 C3EA05 jmp test_led1
1093
1094
1095 ; delay subroutine
1096 ; entry: D= outer loop E=inner loop (should be 0 for long
1097 ; exit: none
1098
1099 05F6 1D delay: dcr e
1100 05F7 C2F605 jnz delay
1101 05FA 15 dcr d
1102 05FB C2F605 jnz delay
1103 05FE C9 ret
1104
1105
1106 05FF 3A26F0 data_key: lda entry_mode
1107 0602 FE00 cpi 0
1108 0604 C20A06 jnz data_key1
1109 0607 F2C506 jp enter_data
1110
1111 060A FE01 data_key1: cpi 1
1112 060C C21206 jnz data_key2
1113 060F F2FF06 jp enter_address
1114
1115 0612 FE02 data_key2: cpi 2
1116 0614 C21A06 jnz data_key3
1117 0617 F23907 jp select_register
1118
1119 061A FE03 data_key3: cpi 3
1120 061C C22206 jnz data_key4
1121 061F F26506 jp enter_register
1122
1123 0622 data_key4:
1124
1125 0622 C9 ret
1126
1127
1128 0623 CD3606 test_buzzer: call beep_on
1129 0626 C9 ret
1130
1131 ;mvi a,7fh
1132 ;out port1
1133 ;lxi d,1000h
1134 ;call delay
1135 ;mvi a,0ffh
1136 ;out port1
1137 ;ret
1138
1139
1140 ; produce beep output at system port c.7

Page 19 of 86
B8080.LST 3/12/2560 20:42

1141 ; click when key pressed


1142
1143 0627 3A24F0 buzzer: lda beep_flag
1144 062A E601 ani 1
1145 062C CA3606 jz beep_on
1146
1147 062F 0600 mvi b,0
1148 0631 05 delay_nobeep: dcr b
1149 0632 C23106 jnz delay_nobeep
1150 0635 C9 ret
1151 0636 beep_on:
1152 0636 0E30 mvi c,30h
1153
1154 0638 3E7F buzzer1: mvi a,7fh
1155 063A D340 out port1 ;nop ;out port1
1156 063C CD4F06 call delay_us
1157 063F 3EFF mvi a,0ffh
1158 0641 D340 out port1 ;nop ;out port1
1159 0643 CD4F06 call delay_us
1160
1161 0646 0D dcr c
1162 0647 C23806 jnz buzzer1
1163
1164 064A 3EFF mvi a,0ffh
1165 064C D340 out port1
1166
1167 064E C9 ret
1168
1169 064F 0635 delay_us: mvi b,35h ; 25h
1170 0651 05 delay_us1: dcr b
1171 0652 C25106 jnz delay_us1
1172 0655 C9 ret
1173
1174
1175 ;----- turn display off while key has been pressing --------
1176 ; useful for no function accepted
1177
1178 0656 21B51E display_off: lxi h,off_display
1179 0659 CDAC0C off_display1: call scan
1180 065C 3A21F0 lda key
1181 065F FEFF cpi 0ffh
1182 0661 C25906 jnz off_display1 ; loop if key still pressed
1183 0664 C9 ret
1184
1185 ;************* modify current displayed register ************
1186 ; entry: current user register displayed
1187 ;
1188
1189
1190 0665 enter_register:
1191
1192 0665 2A38F0 lhld current_register
1193
1194 0668 4E mov c,m
1195 0669 23 inx h
1196 066A 46 mov b,m
1197 066B 210000 lxi h,0
1198
1199 066E 09 dad b ; MOV HL,BC
1200

Page 20 of 86
B8080.LST 3/12/2560 20:42

1201 066F 5A mov e,d ; save key code to E


1202
1203 0670 shift_register:
1204 0670 7D mov a,l
1205 0671 07 rlc
1206 0672 6F mov l,a
1207 0673 7C mov a,h
1208 0674 17 ral
1209 0675 67 mov h,a
1210
1211 0676 7D mov a,l
1212 0677 07 rlc
1213 0678 6F mov l,a
1214 0679 7C mov a,h
1215 067A 17 ral
1216 067B 67 mov h,a
1217
1218 067C 7D mov a,l
1219 067D 07 rlc
1220 067E 6F mov l,a
1221 067F 7C mov a,h
1222 0680 17 ral
1223 0681 67 mov h,a
1224
1225 0682 7D mov a,l
1226 0683 07 rlc
1227 0684 6F mov l,a
1228 0685 7C mov a,h
1229 0686 17 ral
1230 0687 67 mov h,a
1231
1232 0688 7D mov a,l
1233
1234 0689 E6F0 ani 0f0h
1235 068B 82 add d
1236 068C 6F mov l,a
1237
1238 068D 44 mov b,h
1239 068E 4D mov c,l
1240
1241 068F 2A38F0 lhld current_register
1242 0692 71 mov m,c
1243 0693 23 inx h
1244 0694 70 mov m,b
1245
1246 0695 2A38F0 lhld current_register
1247
1248 0698 4E mov c,m
1249 0699 23 inx h
1250 069A 46 mov b,m
1251 069B 210000 lxi h,0
1252
1253 069E 09 dad b ; MOV HL,BC
1254
1255 069F CD890A call read_register
1256
1257 06A2 F5 push psw
1258
1259 06A3 3A13F0 lda buffer+3
1260 06A6 F640 ori 40h

Page 21 of 86
B8080.LST 3/12/2560 20:42

1261 06A8 3213F0 sta buffer+3


1262
1263 06AB 3A12F0 lda buffer+2
1264 06AE F640 ori 40h
1265 06B0 3212F0 sta buffer+2
1266
1267 06B3 3A11F0 lda buffer+1
1268 06B6 F640 ori 40h
1269 06B8 3211F0 sta buffer+1
1270
1271 06BB 3A10F0 lda buffer
1272 06BE F640 ori 40h
1273 06C0 3210F0 sta buffer
1274
1275
1276
1277
1278
1279 06C3 F1 pop psw
1280
1281 06C4 C9 ret
1282
1283 ; enter nibble into current location
1284
1285 06C5 2A2AF0 enter_data: lhld user_PC
1286
1287 06C8 5A mov e,d ; save key code to E
1288
1289 06C9 3A27F0 lda counter1
1290 06CC FE00 cpi 0
1291 06CE C2D806 jnz shift_data
1292 06D1 3C inr a
1293 06D2 3227F0 sta counter1
1294 06D5 3E00 mvi a,0
1295 06D7 77 mov m,a
1296
1297 06D8 7E shift_data: mov a,m
1298
1299 06D9 07 rlc
1300 06DA 07 rlc
1301 06DB 07 rlc
1302 06DC 07 rlc
1303 06DD E6F0 ani 0f0h ; make low nibble to 0 before
1304 06DF 83 add e ; insert low nibble to A
1305 06E0 77 mov m,a
1306 06E1 57 mov d,a
1307 06E2 7E mov a,m ; check if the space is ram
1308 06E3 BA cmp d
1309 06E4 CAFB06 jz it_is_ram
1310
1311 ; if it was rom them turn of led while key has been pressed
1312
1313 06E7 21B51E lxi h,off_display
1314 06EA CDAC0C enter_data1: call scan
1315 06ED 3A21F0 lda key
1316 06F0 FEFF cpi 0ffh
1317 06F2 C2EA06 jnz enter_data1 ; loop if key still pressed
1318
1319 06F5 CDA50C call debounce ; debounce after key was
1320

Page 22 of 86
B8080.LST 3/12/2560 20:42

1321 06F8 2110F0 lxi h,buffer ; back to show display again


1322
1323 06FB it_is_ram:
1324 06FB CDB40A call read_memory
1325 06FE C9 ret
1326
1327 ; enter nibble into current pointer
1328
1329 06FF 2A2AF0 enter_address: lhld user_PC
1330 0702 5A mov e,d ; save key code to E
1331
1332 0703 3A28F0 lda counter2
1333 0706 FE00 cpi 0
1334 0708 C21507 jnz shift_address
1335 070B 3C inr a
1336 070C 3228F0 sta counter2
1337 070F 210000 lxi h,0
1338 0712 222AF0 shld user_PC
1339
1340 0715 shift_address:
1341 0715 7D mov a,l
1342 0716 07 rlc
1343 0717 6F mov l,a
1344 0718 7C mov a,h
1345 0719 17 ral
1346 071A 67 mov h,a
1347
1348 071B 7D mov a,l
1349 071C 07 rlc
1350 071D 6F mov l,a
1351 071E 7C mov a,h
1352 071F 17 ral
1353 0720 67 mov h,a
1354
1355 0721 7D mov a,l
1356 0722 07 rlc
1357 0723 6F mov l,a
1358 0724 7C mov a,h
1359 0725 17 ral
1360 0726 67 mov h,a
1361
1362 0727 7D mov a,l
1363 0728 07 rlc
1364 0729 6F mov l,a
1365 072A 7C mov a,h
1366 072B 17 ral
1367 072C 67 mov h,a
1368
1369 072D 7D mov a,l
1370
1371 072E E6F0 ani 0f0h
1372 0730 82 add d
1373 0731 6F mov l,a
1374
1375 0732 222AF0 shld user_PC ; store new pointer
1376
1377 0735 CDB40A call read_memory
1378
1379 0738 C9 ret
1380

Page 23 of 86
B8080.LST 3/12/2560 20:42

1381
1382 ;****************** ALT register display ********************
1383
1384 0739 5A select_register: mov e,d ; save key for selecting user
1385
1386 073A 7A mov a,d
1387 073B FE00 cpi 0
1388 073D C25707 jnz register1
1389
1390 0740 3E3F mvi a,3fh ; AF register pair
1391 0742 3214F0 sta buffer+4
1392 0745 3E0F mvi a,0fh
1393 0747 3215F0 sta buffer+5
1394
1395 074A 212CF0 lxi h,user_AF
1396 074D 2238F0 shld current_register
1397
1398
1399 0750 2A2CF0 lhld user_AF
1400 0753 CD890A call read_register
1401 0756 C9 ret
1402
1403 0757 register1:
1404 0757 FE01 cpi 1
1405 0759 C27307 jnz register2
1406
1407 075C 3EA7 mvi a,0a7h ; BC register pair
1408 075E 3214F0 sta buffer+4
1409 0761 3E8D mvi a,8dh
1410 0763 3215F0 sta buffer+5
1411
1412 0766 212EF0 lxi h,user_BC
1413 0769 2238F0 shld current_register
1414
1415 076C 2A2EF0 lhld user_BC
1416 076F CD890A call read_register
1417
1418 0772 C9 ret
1419
1420 0773 register2:
1421 0773 FE02 cpi 2
1422 0775 C28F07 jnz register3
1423
1424 0778 3EB3 mvi a,0b3h ; DE register pair
1425 077A 3214F0 sta buffer+4
1426 077D 3E8F mvi a,8fh
1427 077F 3215F0 sta buffer+5
1428
1429 0782 2130F0 lxi h,user_DE
1430 0785 2238F0 shld current_register
1431
1432 0788 2A30F0 lhld user_DE
1433 078B CD890A call read_register
1434
1435 078E C9 ret
1436
1437 078F register3:
1438 078F FE03 cpi 3
1439 0791 C2AB07 jnz register4
1440

Page 24 of 86
B8080.LST 3/12/2560 20:42

1441 0794 3E37 mvi a,37h ; HL register pair


1442 0796 3214F0 sta buffer+4
1443 0799 3E85 mvi a,85h
1444 079B 3215F0 sta buffer+5
1445
1446 079E 2132F0 lxi h,user_HL
1447 07A1 2238F0 shld current_register
1448
1449 07A4 2A32F0 lhld user_HL
1450 07A7 CD890A call read_register
1451
1452 07AA C9 ret
1453 07AB register4:
1454 07AB FE04 cpi 4
1455 07AD C2C707 jnz register5
1456
1457 07B0 3EAE mvi a,0aeh ; user SP
1458 07B2 3214F0 sta buffer+4
1459 07B5 3E1F mvi a,1fh
1460 07B7 3215F0 sta buffer+5
1461
1462 07BA 2134F0 lxi h,user_SP
1463 07BD 2238F0 shld current_register
1464
1465 07C0 2A34F0 lhld user_SP
1466 07C3 CD890A call read_register
1467
1468 07C6 C9 ret
1469
1470 07C7 register5:
1471 07C7 FE05 cpi 5
1472 07C9 C2EE07 jnz register6
1473
1474 07CC 3E1F mvi a,1fh ; user PC
1475 07CE 3214F0 sta buffer+4
1476 07D1 3E8D mvi a,8dh
1477 07D3 3215F0 sta buffer+5
1478
1479 07D6 212AF0 lxi h,user_PC
1480 07D9 2238F0 shld current_register
1481
1482 07DC 2A2AF0 lhld user_PC
1483 07DF CD890A call read_register
1484
1485 07E2 C9 ret
1486
1487 ;---- display carry flag ------------------------------------
1488
1489 07E3 C2EB07 put_flag: jnz put_high1
1490 07E6 3EBD mvi a,0bdh
1491 07E8 C3ED07 jmp skip_put_high1
1492
1493 07EB 3E30 put_high1: mvi a,30h
1494
1495 07ED skip_put_high1:
1496 07ED C9 ret
1497
1498 07EE register6:
1499 07EE FE06 cpi 6
1500 07F0 C21608 jnz register7

Page 25 of 86
B8080.LST 3/12/2560 20:42

1501
1502 07F3 3E8D mvi a,8dh ; carry flag
1503 07F5 3210F0 sta buffer
1504 07F8 3EB6 mvi a,0b6h
1505 07FA 3211F0 sta buffer+1
1506 07FD 3E00 mvi a,00h
1507 07FF 3212F0 sta buffer+2
1508
1509 0802 2A2CF0 lhld user_AF
1510 0805 7D mov a,l
1511
1512 0806 E601 ani 1
1513 0808 CDE307 call put_flag
1514 080B 3213F0 sta buffer+3
1515
1516 080E AF xra a
1517 080F 3214F0 sta buffer+4
1518 0812 3215F0 sta buffer+5
1519
1520 0815 C9 ret
1521
1522 0816 register7:
1523 0816 FE07 cpi 7
1524 0818 C24108 jnz register8
1525
1526 081B 3E8A mvi a,8ah ; zero flag
1527 081D 3210F0 sta buffer
1528 0820 3E8F mvi a,8fh
1529 0822 3211F0 sta buffer+1
1530 0825 3E03 mvi a,03h
1531 0827 3212F0 sta buffer+2
1532 082A 3EA3 mvi a,0a3h
1533 082C 3213F0 sta buffer+3
1534 082F 3E00 mvi a,00h
1535 0831 3214F0 sta buffer+4
1536
1537
1538 0834 2A2CF0 lhld user_AF
1539 0837 7D mov a,l
1540
1541 0838 E640 ani 40h
1542 083A CDE307 call put_flag
1543 083D 3215F0 sta buffer+5
1544
1545 0840 C9 ret
1546
1547
1548 0841 register8:
1549 0841 FE08 cpi 8
1550 0843 C27208 jnz register9
1551
1552 0846 3EAE mvi a,0aeh ; sign flag
1553 0848 3210F0 sta buffer
1554 084B 3E89 mvi a,89h
1555 084D 3211F0 sta buffer+1
1556 0850 3EAD mvi a,0adh
1557 0852 3212F0 sta buffer+2
1558 0855 3E23 mvi a,23h
1559 0857 3213F0 sta buffer+3
1560 085A 3E00 mvi a,00h

Page 26 of 86
B8080.LST 3/12/2560 20:42

1561 085C 3214F0 sta buffer+4


1562
1563
1564 085F 2A2CF0 lhld user_AF
1565 0862 7D mov a,l
1566
1567 0863 17 ral
1568 0864 DA6C08 jc put_high2
1569 0867 3EBD mvi a,0bdh
1570 0869 C36E08 jmp skip_put_high2
1571
1572 086C 3E30 put_high2: mvi a,30h
1573 086E skip_put_high2:
1574 086E 3215F0 sta buffer+5
1575
1576 0871 C9 ret
1577
1578
1579 0872 register9:
1580 0872 FE09 cpi 9
1581 0874 C29A08 jnz register10
1582
1583 0877 3E3F mvi a,3fh ; AC flag
1584 0879 3210F0 sta buffer
1585 087C 3E8D mvi a,8dh
1586 087E 3211F0 sta buffer+1
1587 0881 3E00 mvi a,00h
1588 0883 3212F0 sta buffer+2
1589
1590 0886 2A2CF0 lhld user_AF
1591 0889 7D mov a,l
1592
1593 088A E610 ani 10h
1594 088C CDE307 call put_flag
1595 088F 3213F0 sta buffer+3
1596 0892 AF xra a
1597 0893 3214F0 sta buffer+4
1598 0896 3215F0 sta buffer+5
1599
1600 0899 C9 ret
1601
1602 089A register10:
1603 089A FE0A cpi 10
1604 089C C2C008 jnz break
1605
1606 089F 3E1F mvi a,1fh ; Parity flag
1607 08A1 3210F0 sta buffer
1608 08A4 3E00 mvi a,00h
1609 08A6 3211F0 sta buffer+1
1610
1611 08A9 2A2CF0 lhld user_AF
1612 08AC 7D mov a,l
1613
1614 08AD E604 ani 4
1615 08AF CDE307 call put_flag
1616 08B2 3212F0 sta buffer+2
1617 08B5 AF xra a
1618 08B6 3213F0 sta buffer+3
1619 08B9 3214F0 sta buffer+4
1620 08BC 3215F0 sta buffer+5

Page 27 of 86
B8080.LST 3/12/2560 20:42

1621 08BF C9 ret


1622
1623
1624 ; ------------------ ALT B SET BREAK POINT ------------------
1625 08C0 FE0B break: cpi 11
1626 08C2 C2FA08 jnz clear_break
1627
1628 08C5 2A2AF0 lhld user_PC ; save user PC
1629 08C8 223EF0 shld break_address
1630
1631 08CB 7E mov a,m ; get user code
1632 08CC 3240F0 sta break_opcode ; save it
1633
1634 08CF E5 push h
1635 08D0 CDB40A call read_memory
1636 08D3 E1 pop h
1637 08D4 3EDF mvi a,0DFh ; RST 3 opcode
1638 08D6 77 mov m,a ; replace user code with RST
1639
1640 08D7 F5 push psw
1641
1642 08D8 3A10F0 lda buffer
1643 08DB F640 ori 40h
1644 08DD 3210F0 sta buffer
1645
1646 08E0 3A11F0 lda buffer+1
1647 08E3 F640 ori 40h
1648 08E5 3211F0 sta buffer+1
1649
1650 08E8 3A12F0 lda buffer+2
1651 08EB F640 ori 40h
1652 08ED 3212F0 sta buffer+2
1653
1654 08F0 3A13F0 lda buffer+3
1655 08F3 F640 ori 40h
1656 08F5 3213F0 sta buffer+3
1657 08F8 F1 pop psw
1658
1659 08F9 C9 ret
1660
1661 ;----------------- ALT C CLEAR BREAK POINT ------------------
1662
1663 08FA FE0C clear_break: cpi 12
1664 08FC C21509 jnz insert_byte
1665
1666 08FF 2140F0 lxi h,break_opcode ; restore user code
1667 0902 7E mov a,m
1668
1669 0903 2A3EF0 lhld break_address
1670 0906 77 mov m,a
1671 0907 222AF0 shld user_PC
1672 090A CDB40A call read_memory
1673 090D AF xra a
1674 090E 3226F0 sta entry_mode
1675 0911 CDF80A call mode_indicator
1676
1677 0914 C9 ret
1678
1679 ;--------------- ALT E insert byte --------------------------
1680 ; insert byte within 512 bytes from current location

Page 28 of 86
B8080.LST 3/12/2560 20:42

1681
1682 0915 FE0E insert_byte: cpi 14 ; test with key E
1683 0917 C24009 jnz delete_byte
1684
1685 091A 2A2AF0 lhld user_PC
1686 091D E5 push h ; save PC to stack
1687
1688 091E 110002 lxi d,512
1689 0921 19 dad d
1690 0922 E5 push h
1691 0923 C1 pop b ; copy HL to BC
1692 0924 0B dcx b
1693
1694 0925 110002 lxi d,512 ; load counter with 512 bytes
1695
1696 0928 insert_byte1:
1697 0928 0A ldax b
1698 0929 77 mov m,a
1699 092A 2B dcx h
1700 092B 0B dcx b
1701 092C 1B dcx d
1702 092D 7B mov a,e
1703 092E B2 ora d ; check DE ==0
1704 092F C22809 jnz insert_byte1
1705
1706 0932 E1 pop h ; restore user PC
1707 0933 AF xra a
1708 0934 77 mov m,a ; store 00 at insert byte
1709 0935 CDB40A call read_memory
1710 0938 AF xra a
1711 0939 3226F0 sta entry_mode
1712 093C CDF80A call mode_indicator
1713
1714 093F C9 ret
1715
1716
1717 ;--------------- ALT D delete byte --------------------------
1718 ; delete byte within 512 bytes
1719
1720 0940 FE0D delete_byte: cpi 13
1721 0942 C26509 jnz beep_chk
1722
1723 0945 2A2AF0 lhld user_PC
1724 0948 E5 push h
1725 0949 E5 push h
1726 094A C1 pop b
1727
1728 094B 03 inx b
1729 094C 110002 lxi d,512
1730
1731 094F delete_byte1:
1732 094F 0A ldax b
1733 0950 77 mov m,a
1734 0951 23 inx h
1735 0952 03 inx b
1736 0953 1B dcx d
1737 0954 7B mov a,e
1738 0955 B2 ora d ; check if DE ==0
1739 0956 C24F09 jnz delete_byte1
1740

Page 29 of 86
B8080.LST 3/12/2560 20:42

1741 0959 E1 pop h


1742 095A CDB40A call read_memory
1743 095D AF xra a
1744 095E 3226F0 sta entry_mode
1745 0961 CDF80A call mode_indicator
1746
1747 0964 C9 ret
1748
1749 ;--------------- ALT F BEEP/NO BEEP ------------------------
1750 0965 FE0F beep_chk: cpi 15
1751 0967 C27309 jnz option1
1752
1753 096A 3A24F0 lda beep_flag
1754 096D EE01 xri 1
1755 096F 3224F0 sta beep_flag
1756 0972 C9 ret
1757
1758
1759 0973 option1:
1760 0973 CD5606 call display_off ; no service key
1761 0976 C9 ret
1762
1763
1764
1765 0977 210081 home: lxi h,home_address
1766 097A 222AF0 shld user_PC
1767 097D 2110F0 lxi h,buffer
1768 0980 CDB40A call read_memory
1769 0983 AF xra a
1770 0984 3226F0 sta entry_mode
1771 0987 CDF80A call mode_indicator
1772 098A C9 ret
1773
1774
1775 098B 3E2A debug: mvi a,"*"
1776 098D CD8712 call cout
1777 0990 C9 ret
1778
1779 ; go function, jump from monitor program to user program
1780 ; save system stack and load user stack
1781 ; load CPU registers with user registers before jump
1782
1783 0991 go:
1784 0991 210000 lxi h,0
1785
1786 0994 39 dad sp ; save system stack
1787 0995 2257F0 shld save_stack
1788
1789 0998 2A34F0 lhld user_SP ; get user stack
1790 099B F9 sphl ; load user stack
1791
1792 099C 2A2AF0 lhld user_PC
1793 099F E5 push h
1794 09A0 2A2CF0 lhld user_AF
1795 09A3 E5 push h
1796 09A4 2A2EF0 lhld user_BC
1797 09A7 E5 push h
1798 09A8 2A30F0 lhld user_DE
1799 09AB E5 push h
1800 09AC 2A32F0 lhld user_HL

Page 30 of 86
B8080.LST 3/12/2560 20:42

1801 09AF E5 push h


1802
1803 09B0 E1 pop h
1804 09B1 D1 pop d
1805 09B2 C1 pop b
1806 09B3 F1 pop psw
1807
1808 09B4 C9 ret ; jump to user program
1809
1810
1811 ; single step
1812 ; load CPU registers with user registers, enable trap signal
1813 ; program
1814 ; disassemble line to be executed
1815
1816 09B5 single_step:
1817 09B5 210000 lxi h,0
1818
1819 09B8 39 dad sp ; save system stack
1820 09B9 2257F0 shld save_stack
1821
1822 09BC 2A34F0 lhld user_SP
1823 09BF F9 sphl ; load user stack
1824
1825
1826 09C0 2A2AF0 lhld user_PC ; get address to be executed
1827 09C3 E5 push h ; save to stack
1828
1829 09C4 3A25F0 lda uart_found
1830 09C7 FE00 cpi 0
1831 09C9 CAD509 jz skip2 ; if no uart, skip disassemble
1832
1833 09CC CD2413 call new_line
1834 09CF CD3513 call send_tab
1835 09D2 CD1A03 call disassemble
1836
1837 09D5 skip2:
1838
1839 09D5 E1 pop h
1840 09D6 222AF0 shld user_PC
1841
1842 09D9 2A2AF0 lhld user_PC
1843 09DC E5 push h
1844 09DD 2A2CF0 lhld user_AF
1845 09E0 E5 push h
1846 09E1 2A2EF0 lhld user_BC
1847 09E4 E5 push h
1848 09E5 2A30F0 lhld user_DE
1849 09E8 E5 push h
1850 09E9 2A32F0 lhld user_HL
1851 09EC E5 push h
1852
1853 09ED E1 pop h
1854 09EE D1 pop d
1855 09EF C1 pop b
1856
1857 09F0 3EBF mvi a,0bfh ; make port_c.6 low to enable
1858 09F2 D340 out port1 ;
1859
1860 ; now the shift register 74LS164 is running

Page 31 of 86
B8080.LST 3/12/2560 20:42

1861 ; within 8 ALE, trap will be high, trap will be recorgnized


1862 ; followed RET was executed
1863
1864 09F4 00 nop ; 1 cycles
1865 09F5 F1 pop psw ; 5 cycles
1866 09F6 C9 ret ; 3 cycles
1867
1868
1869 ; set mode to 1
1870
1871 09F7 3E01 address_mode: mvi a,1
1872 09F9 3226F0 sta entry_mode
1873 09FC CDB40A call read_memory
1874 09FF AF xra a
1875 0A00 3228F0 sta counter2
1876 0A03 C9 ret
1877
1878 0A04 AF data_mode: xra a
1879 0A05 3226F0 sta entry_mode
1880 0A08 3227F0 sta counter1
1881 0A0B CDB40A call read_memory
1882 0A0E C9 ret
1883
1884 0A0F 3E02 function_2nd: mvi a,2
1885 0A11 3226F0 sta entry_mode
1886 0A14 3E3F mvi a,3fh
1887 0A16 3210F0 sta buffer
1888 0A19 3E85 mvi a,85h
1889 0A1B 3211F0 sta buffer+1
1890 0A1E 3E87 mvi a,87h
1891 0A20 3212F0 sta buffer+2
1892 0A23 3E00 mvi a,0
1893 0A25 3213F0 sta buffer+3
1894 0A28 3E00 mvi a,0
1895 0A2A 3214F0 sta buffer+4
1896 0A2D 3E00 mvi a,0
1897 0A2F 3215F0 sta buffer+5
1898 0A32 C9 ret
1899
1900
1901 ; set entry mode to 3
1902 ; hex data will be used for register modifying
1903
1904 0A33 modify_register:
1905
1906 0A33 F5 push psw
1907
1908 0A34 3E03 mvi a,3
1909 0A36 3226F0 sta entry_mode
1910
1911 0A39 3A13F0 lda buffer+3
1912 0A3C F640 ori 40h
1913 0A3E 3213F0 sta buffer+3
1914
1915 0A41 3A12F0 lda buffer+2
1916 0A44 F640 ori 40h
1917 0A46 3212F0 sta buffer+2
1918
1919 0A49 3A11F0 lda buffer+1
1920 0A4C F640 ori 40h

Page 32 of 86
B8080.LST 3/12/2560 20:42

1921 0A4E 3211F0 sta buffer+1


1922
1923 0A51 3A10F0 lda buffer
1924 0A54 F640 ori 40h
1925 0A56 3210F0 sta buffer
1926
1927 0A59 F1 pop psw
1928
1929 0A5A C9 ret
1930
1931
1932
1933
1934
1935
1936
1937
1938 ; increment key works with mode0 or mode1 display
1939
1940 0A5B 3E00 increment: mvi a,0
1941 0A5D 3226F0 sta entry_mode ; switch to data mode
1942 0A60 3227F0 sta counter1 ; clear event counter1
1943
1944 0A63 2A2AF0 lhld user_PC
1945 0A66 23 inx h
1946 0A67 222AF0 shld user_PC
1947 0A6A CDB40A call read_memory
1948 0A6D C9 ret
1949
1950 ; decrement key works with mode0 or mode1 display
1951
1952 0A6E 3E00 decrement: mvi a,0
1953 0A70 3226F0 sta entry_mode ; switch to data mode
1954 0A73 2A2AF0 lhld user_PC
1955 0A76 2B dcx h
1956 0A77 222AF0 shld user_PC
1957 0A7A CDB40A call read_memory
1958 0A7D C9 ret
1959
1960
1961 ; convert nibble 0-F to 8-bit seven segment code
1962 ; entry: A
1963 ; exit: A
1964
1965 0A7E to_seven_segment:
1966
1967 0A7E E60F ani 0fh ; get only low nibble as the index
1968 0A80 21A51E lxi h,convert
1969 0A83 5F mov e,a
1970 0A84 1600 mvi d,0
1971 0A86 19 dad d
1972 0A87 7E mov a,m ; get code
1973 0A88 C9 ret
1974
1975 ; convert [HL] to display buffer 0-3
1976 ; for register display
1977 ; entry: HL
1978
1979 0A89 read_register:
1980 0A89 E5 push h

Page 33 of 86
B8080.LST 3/12/2560 20:42

1981 0A8A 7C mov a,h


1982 0A8B F5 push psw
1983 0A8C 0F rrc
1984 0A8D 0F rrc
1985 0A8E 0F rrc
1986 0A8F 0F rrc
1987 0A90 CD7E0A call to_seven_segment
1988 0A93 3210F0 sta buffer
1989
1990 0A96 F1 pop psw
1991 0A97 CD7E0A call to_seven_segment
1992 0A9A 3211F0 sta buffer+1
1993
1994 0A9D E1 pop h
1995
1996 0A9E E5 push h
1997
1998 0A9F 7D mov a,l
1999 0AA0 F5 push psw
2000 0AA1 0F rrc
2001 0AA2 0F rrc
2002 0AA3 0F rrc
2003 0AA4 0F rrc
2004 0AA5 CD7E0A call to_seven_segment
2005 0AA8 3212F0 sta buffer+2
2006 0AAB F1 pop psw
2007 0AAC CD7E0A call to_seven_segment
2008 0AAF 3213F0 sta buffer+3
2009
2010 0AB2 E1 pop h
2011 0AB3 C9 ret
2012
2013
2014
2015 ; convert current address and data to display buffer
2016 ;
2017
2018 0AB4 2A2AF0 read_memory: lhld user_PC
2019 0AB7 E5 push h
2020 0AB8 7C mov a,h
2021 0AB9 F5 push psw
2022 0ABA 0F rrc
2023 0ABB 0F rrc
2024 0ABC 0F rrc
2025 0ABD 0F rrc
2026 0ABE CD7E0A call to_seven_segment
2027 0AC1 3210F0 sta buffer
2028
2029 0AC4 F1 pop psw
2030 0AC5 CD7E0A call to_seven_segment
2031 0AC8 3211F0 sta buffer+1
2032
2033 0ACB E1 pop h
2034
2035 0ACC E5 push h
2036
2037 0ACD 7D mov a,l
2038 0ACE F5 push psw
2039 0ACF 0F rrc
2040 0AD0 0F rrc

Page 34 of 86
B8080.LST 3/12/2560 20:42

2041 0AD1 0F rrc


2042 0AD2 0F rrc
2043 0AD3 CD7E0A call to_seven_segment
2044 0AD6 3212F0 sta buffer+2
2045 0AD9 F1 pop psw
2046 0ADA CD7E0A call to_seven_segment
2047 0ADD 3213F0 sta buffer+3
2048
2049 0AE0 E1 pop h
2050 0AE1 7E mov a,m ; read from memory
2051
2052 0AE2 F5 push psw
2053 0AE3 0F rrc
2054 0AE4 0F rrc
2055 0AE5 0F rrc
2056 0AE6 0F rrc
2057 0AE7 CD7E0A call to_seven_segment
2058 0AEA 3214F0 sta buffer+4
2059 0AED F1 pop psw
2060
2061
2062 0AEE CD7E0A call to_seven_segment
2063 0AF1 3215F0 sta buffer+5
2064
2065 0AF4 CDF80A call mode_indicator
2066
2067 0AF7 C9 ret
2068
2069 0AF8 mode_indicator:
2070
2071 0AF8 F5 push psw
2072
2073 0AF9 3A26F0 lda entry_mode
2074 0AFC FE00 cpi 0
2075 0AFE C2330B jnz mode1
2076
2077 0B01 3A15F0 lda buffer+5 ; mode 0 indicator
2078 0B04 F640 ori 40h
2079 0B06 3215F0 sta buffer+5
2080
2081 0B09 3A14F0 lda buffer+4
2082 0B0C F640 ori 40h
2083 0B0E 3214F0 sta buffer+4
2084
2085
2086 0B11 3A13F0 lda buffer+3
2087 0B14 E6BF ani 0bfh
2088 0B16 3213F0 sta buffer+3
2089
2090 0B19 3A12F0 lda buffer+2
2091 0B1C E6BF ani 0bfh
2092 0B1E 3212F0 sta buffer+2
2093
2094 0B21 3A11F0 lda buffer+1
2095 0B24 E6BF ani 0bfh
2096 0B26 3211F0 sta buffer+1
2097
2098 0B29 3A10F0 lda buffer
2099 0B2C E6BF ani 0bfh
2100 0B2E 3210F0 sta buffer

Page 35 of 86
B8080.LST 3/12/2560 20:42

2101
2102
2103
2104
2105
2106 0B31 F1 pop psw
2107 0B32 C9 ret
2108
2109 0B33 FE01 mode1: cpi 1
2110 0B35 C26A0B jnz mode2
2111
2112 0B38 3A15F0 lda buffer+5 ; mode 1 indicator
2113 0B3B E6BF ani 0bfh
2114 0B3D 3215F0 sta buffer+5
2115
2116 0B40 3A14F0 lda buffer+4
2117 0B43 E6BF ani 0bfh
2118 0B45 3214F0 sta buffer+4
2119
2120 0B48 3A13F0 lda buffer+3
2121 0B4B F640 ori 40h
2122 0B4D 3213F0 sta buffer+3
2123
2124 0B50 3A12F0 lda buffer+2
2125 0B53 F640 ori 40h
2126 0B55 3212F0 sta buffer+2
2127
2128 0B58 3A11F0 lda buffer+1
2129 0B5B F640 ori 40h
2130 0B5D 3211F0 sta buffer+1
2131
2132 0B60 3A10F0 lda buffer
2133 0B63 F640 ori 40h
2134 0B65 3210F0 sta buffer
2135
2136
2137
2138
2139 0B68 F1 pop psw
2140 0B69 C9 ret
2141
2142 0B6A F1 mode2: pop psw
2143 0B6B C9 ret
2144
2145 0B6C 0E07 cold_boot: mvi c,7
2146 0B6E 218A0B lxi h,title
2147
2148
2149 0B71 1650 cold2: mvi d,50h
2150
2151 0B73 CDAC0C cold1: call scan
2152 0B76 15 dcr d
2153 0B77 C2730B jnz cold1
2154
2155 0B7A 23 inx h
2156 0B7B 0D dcr c
2157 0B7C C2710B jnz cold2
2158
2159 0B7F 2B dcx h
2160

Page 36 of 86
B8080.LST 3/12/2560 20:42

2161 0B80 0E00 mvi c,0


2162 0B82 CDAC0C cold3: call scan
2163 0B85 0D dcr c
2164 0B86 C2820B jnz cold3
2165
2166 0B89 C9 ret
2167
2168 0B8A 0000000000title: dfb 0,0,0,0,0,0,0bfh,0bdh,0bfh,0bdh,0,0
2169
2170
2171 ; display data read from memory pointed to by HL on LED
2172 ; entry: HL
2173 ;
2174
2175 0B96 1605 demo: mvi d,5
2176
2177 0B98 CDAC0C demo1_2: call scan
2178 0B9B 15 dcr d
2179 0B9C C2980B jnz demo1_2
2180 0B9F 23 inx h
2181 0BA0 C9 ret
2182
2183
2184 ; convert position key to internal key code 0-F for data
2185 ; function keys
2186 ; entry: A = scan code
2187 ; exit: A = internal code
2188
2189 0BA1 get_key_code: ; out gpio ; check key position
2190
2191
2192 0BA1 FE02 cpi 2
2193 0BA3 C2A90B jnz code1
2194 0BA6 3E04 mvi a,4
2195 0BA8 C9 ret
2196
2197 0BA9 FE0A code1: cpi 0ah
2198 0BAB C2B10B jnz code2
2199 0BAE 3E06 mvi a,6
2200 0BB0 C9 ret
2201
2202 0BB1 FE07 code2: cpi 7
2203 0BB3 C2B90B jnz code3
2204 0BB6 3E01 mvi a,1
2205 0BB8 C9 ret
2206
2207 0BB9 FE06 code3: cpi 6
2208 0BBB C2C10B jnz code4
2209 0BBE 3E05 mvi a,5
2210 0BC0 C9 ret
2211
2212 0BC1 FE03 code4: cpi 3
2213 0BC3 C2C90B jnz code5
2214 0BC6 3E00 mvi a,0
2215 0BC8 C9 ret
2216
2217 0BC9 FE0B code5: cpi 0bh
2218 0BCB C2D10B jnz code6
2219 0BCE 3E02 mvi a,2
2220 0BD0 C9 ret

Page 37 of 86
B8080.LST 3/12/2560 20:42

2221
2222 0BD1 FE13 code6: cpi 13h
2223 0BD3 C2D90B jnz code7
2224 0BD6 3E10 mvi a,10h ; addr
2225 0BD8 C9 ret
2226
2227 0BD9 FE0E code7: cpi 0eh
2228 0BDB C2E10B jnz code8
2229 0BDE 3E07 mvi a,7
2230 0BE0 C9 ret
2231
2232 0BE1 FE04 code8: cpi 4
2233 0BE3 C2E90B jnz code9
2234 0BE6 3E0D mvi a,0dh
2235 0BE8 C9 ret
2236
2237 0BE9 FE0C code9: cpi 0ch
2238 0BEB C2F10B jnz code10
2239 0BEE 3E0F mvi a,0fh
2240 0BF0 C9 ret
2241
2242 0BF1 FE14 code10: cpi 14h
2243 0BF3 C2F90B jnz code11
2244 0BF6 3E19 mvi a,19h ; user
2245 0BF8 C9 ret
2246
2247 0BF9 FE0F code11: cpi 0fh
2248 0BFB C2010C jnz code12
2249 0BFE 3E03 mvi a,3
2250 0C00 C9 ret
2251
2252 0C01 FE05 code12: cpi 5
2253 0C03 C2090C jnz code13
2254 0C06 3E09 mvi a,9
2255 0C08 C9 ret
2256
2257 0C09 FE0D code13: cpi 0dh
2258 0C0B C2110C jnz code14
2259 0C0E 3E0B mvi a,0bh
2260 0C10 C9 ret
2261
2262 0C11 FE15 code14: cpi 15h
2263 0C13 C2190C jnz code15
2264 0C16 3E17 mvi a,17h ; home
2265 0C18 C9 ret
2266
2267 0C19 FE17 code15: cpi 17h
2268 0C1B C2210C jnz code16
2269 0C1E 3E11 mvi a,11h ; data
2270 0C20 C9 ret
2271
2272 0C21 FE10 code16: cpi 10h
2273 0C23 C2290C jnz code17
2274 0C26 3E18 mvi a,18h ; modify
2275 0C28 C9 ret
2276
2277 0C29 FE18 code17: cpi 18h
2278 0C2B C2310C jnz code18
2279 0C2E 3E15 mvi a,15h ; dec
2280 0C30 C9 ret

Page 38 of 86
B8080.LST 3/12/2560 20:42

2281
2282 0C31 FE01 code18: cpi 1
2283 0C33 C2390C jnz code19
2284 0C36 3E08 mvi a,8
2285 0C38 C9 ret
2286
2287 0C39 FE00 code19: cpi 0
2288 0C3B C2410C jnz code20
2289 0C3E 3E0C mvi a,0ch
2290 0C40 C9 ret
2291
2292 0C41 FE08 code20: cpi 8
2293 0C43 C2490C jnz code21
2294 0C46 3E0E mvi a,0eh
2295 0C48 C9 ret
2296
2297 0C49 FE09 code21: cpi 9
2298 0C4B C2510C jnz code22
2299 0C4E 3E0A mvi a,0ah
2300 0C50 C9 ret
2301
2302 0C51 FE11 code22: cpi 11h
2303 0C53 C2590C jnz code23
2304 0C56 3E16 mvi a,16h ; step
2305 0C58 C9 ret
2306
2307 0C59 FE19 code23: cpi 19h
2308 0C5B C2610C jnz code24
2309 0C5E 3E12 mvi a,12h ; inc
2310 0C60 C9 ret
2311
2312 0C61 FE16 code24: cpi 16h
2313 0C63 C2690C jnz code25
2314 0C66 3E14 mvi a,14h ;ALT
2315 0C68 C9 ret
2316
2317 0C69 FE12 code25: cpi 12h
2318 0C6B C2710C jnz code26
2319 0C6E 3E13 mvi a,13h ; GO
2320 0C70 C9 ret
2321
2322 0C71 FE20 code26: cpi 20h
2323 0C73 C2790C jnz code27
2324 0C76 3E20 mvi a,20h ; RXD
2325 0C78 C9 ret
2326
2327 0C79 code27
2328
2329
2330 0C79 3EFF mvi a,0ffh
2331 0C7B C9 ret
2332
2333 ; scan display and keyboard unitl key was pressed
2334
2335 0C7C scan_key: ; mvi d,50 ; number of loop for timeout
2336
2337 0C7C scan_key4: ;push d ; save d
2338
2339 0C7C 2110F0 lxi h,buffer
2340 0C7F CDAC0C call scan

Page 39 of 86
B8080.LST 3/12/2560 20:42

2341 0C82 3A21F0 lda key


2342 0C85 FEFF cpi 0ffh
2343 0C87 C27C0C jnz scan_key4 ; loop if key still pressed
2344 ;pop d
2345
2346 0C8A F28D0C jp scan_key3
2347
2348 0C8D scan_key2: ;pop d
2349
2350 ; dcr d
2351
2352 ; jp scan_key4 ; no repeat function
2353
2354 ; repeat if still pressed when
2355
2356
2357 0C8D CDA50C scan_key3: call debounce ; debounce after released
2358
2359 0C90 2110F0 lxi h,buffer
2360 0C93 CDAC0C scan_key1: call scan
2361 0C96 3A21F0 lda key
2362 0C99 FEFF cpi 0ffh
2363 0C9B CA930C jz scan_key1 ; loop until key will be pressed
2364
2365 0C9E CDA50C call debounce
2366
2367
2368 0CA1 CDA10B call get_key_code
2369
2370 ; call out2x
2371 0CA4 C9 ret
2372
2373
2374 0CA5 0600 debounce: mvi b,0
2375 0CA7 05 debounce1: dcr b
2376 0CA8 C2A70C jnz debounce1
2377 0CAB C9 ret
2378
2379
2380 ; subroutine scan keyboard and display
2381 ; input: hl pointer to buffer
2382 ; exit: key = scan code
2383 ; -1 no key pressed
2384 ;
2385
2386 0CAC E5 scan: push h
2387 0CAD C5 push b
2388 0CAE D5 push d
2389
2390 0CAF 0E06 mvi c,6 ; for 6-digit LED
2391 0CB1 1E20 mvi e,20h ; digit scan code appears at 4-to-
2392 0CB3 1600 mvi d,0 ; key position
2393 0CB5 3EFF mvi a,0ffh ; put -1 to key
2394 0CB7 3221F0 sta key ; key = -1
2395
2396
2397 0CBA 7B scan1: mov a,e
2398 0CBB 2F cma ; complement it
2399 0CBC F6C0 ori 0c0h ; high nibble must be 1100 0000
2400 0CBE D340 out port1 ; active digit first

Page 40 of 86
B8080.LST 3/12/2560 20:42

2401
2402 0CC0 7E mov a,m ; load a with [hl]
2403 0CC1 D360 out port2 ; then turn segment on
2404
2405 0CC3 FE30 cpi 30h ; check for 1
2406 0CC5 C2CD0C jnz checkmore
2407 0CC8 00 nop
2408 0CC9 00 nop
2409 0CCA C3DE0C jmp skip23
2410 0CCD checkmore ; check for 1.
2411 0CCD FE70 cpi 70h
2412 0CCF C2D80C jnz long_delay
2413 0CD2 00 nop
2414 0CD3 00 nop
2415 0CD4 00 nop
2416 0CD5 C3DE0C jmp skip23
2417
2418 0CD8 long_delay
2419
2420 0CD8 0603 mvi b,3 ; time ON
2421 0CDA 05 wait1: dcr b
2422 0CDB C2DA0C jnz wait1
2423
2424 0CDE AF skip23 xra a
2425 0CDF D360 out port2 ; turn off segment
2426
2427 0CE1 0605 mvi b,5 ; time OFF
2428 0CE3 05 wait2: dcr b
2429 0CE4 C2E30C jnz wait2
2430
2431
2432
2433 0CE7 DB20 in port0 ; read input port
2434
2435 0CE9 0604 mvi b,4 ; check all 8-row
2436 0CEB 1F shift_key: rar ; rotate right through carry
2437 0CEC DAF50C jc next_key ; if carry = 1 then no key presse
2438
2439 0CEF F5 push psw
2440 0CF0 7A mov a,d
2441 0CF1 3221F0 sta key ; save key position
2442 0CF4 F1 pop psw
2443
2444 0CF5 next_key:
2445 0CF5 14 inr d ; next key position
2446
2447 0CF6 05 dcr b ; until 8-bit was shifted
2448 0CF7 C2EB0C jnz shift_key
2449
2450
2451 0CFA 7B mov a,e ; next digit
2452 0CFB 0F rrc
2453 0CFC 5F mov e,a
2454
2455 0CFD 23 inx h ; next location
2456
2457 0CFE 0D dcr c ; next column
2458 0CFF C2BA0C jnz scan1
2459
2460 ; call serial_command

Page 41 of 86
B8080.LST 3/12/2560 20:42

2461
2462 ; check the rest keys at PA6 and PA7
2463
2464 0D02 DB20 in port0
2465 0D04 E680 ani 80h ; check S17
2466 0D06 C2110D jnz check_S27
2467
2468
2469 0D09 3E18 mvi a,18h ; if pressed next key code will be
2470 0D0B 3221F0 sta key
2471 0D0E C3290D jmp skip_check_S27
2472
2473 0D11 check_S27:
2474
2475 0D11 DB20 in port0
2476 0D13 E640 ani 40h
2477 0D15 C21D0D jnz check_RXD
2478
2479 0D18 3E19 mvi a,19h
2480 0D1A 3221F0 sta key
2481
2482 0D1D DB20 check_RXD in port0
2483 0D1F E620 ani 20h ; test RXD pin
2484 0D21 C2290D jnz skip_check_s27
2485
2486 0D24 3E20 mvi a,20h
2487 0D26 3221F0 sta key
2488
2489 0D29 skip_check_S27:
2490
2491 ; check range of scan code, must be 00-20h
2492
2493 0D29 3A21F0 lda key
2494 0D2C FEFF cpi 0ffh
2495 0D2E CA490D jz no_key_pressed
2496
2497 ; check accept only 00 to 20H
2498
2499 0D31 FE21 cpi 21h
2500 0D33 FA3E0D jm check_lowest
2501
2502 0D36 3EFF mvi a,0ffh
2503 0D38 3221F0 sta key
2504 0D3B C3490D jmp no_key_pressed
2505
2506 0D3E check_lowest
2507 0D3E FE00 cpi 0
2508 0D40 F2480D jp valid_key
2509
2510 0D43 3EFF mvi a,0ffh
2511 0D45 3221F0 sta key
2512
2513 0D48 00 valid_key: nop
2514
2515 0D49 no_key_pressed:
2516
2517 0D49 D1 pop d
2518 0D4A C1 pop b
2519 0D4B E1 pop h
2520 0D4C C9 ret

Page 42 of 86
B8080.LST 3/12/2560 20:42

2521
2522
2523
2524 ;----------- serial commands with 9600 8n1 terminal ---------
2525 ; check if serial buffer has command
2526 ;
2527 0D4D connect_terminal:
2528
2529 0D4D F1 pop psw ; dummy pop remove return address
2530
2531 0D4E serial_command:
2532 ;lda uart_found
2533 ;cpi 0
2534 ;jz skip_serial
2535
2536 0D4E CD9312 call get_command
2537 0D51 CDA80D call download
2538 0D54 CD8A0D call prompting
2539 0D57 CD3B13 call hex_dump
2540 0D5A CD4612 call help
2541 0D5D CD1F12 call quick_home
2542 0D60 CD3412 call io_address
2543 0D63 CD0212 call new_location
2544 0D66 CD7F11 call edit_location
2545 0D69 CD3511 call jump_to_user_pgm
2546 0D6C CD1C11 call monitor_function
2547 0D6F CDCA0D call ascii_print
2548 0D72 CDD810 call fill_memory
2549 0D75 CDA40F call register_display
2550 0D78 CD640F call stack_display
2551 0D7B CDF302 call disassemble1
2552
2553 ; call single_step_ ; 8080 kit has no single step
2554 ; 8085 kit use trap pin for
2555
2556 0D7E CD490F call print_watch
2557 0D81 CD2E0F call clear_watch
2558 0D84 CDFC0D call set_user_register
2559
2560
2561
2562 0D87 skip_serial:
2563
2564
2565
2566 0D87 C34E0D jmp serial_command ; now repeat until RESET
2567
2568 0D8A 3A22F0 prompting: lda command
2569 0D8D FE0D cpi cr
2570 0D8F C2A70D jnz exit_prompting
2571
2572 0D92 send_prompt:
2573
2574 0D92 CD2413 call new_line
2575 0D95 2A3CF0 lhld pointer ; user_PC
2576 0D98 7C mov a,h
2577 0D99 CD1513 call out2x
2578 0D9C 7D mov a,l
2579 0D9D CD1513 call out2x
2580 0DA0 21F31E lxi h,prompt_text

Page 43 of 86
B8080.LST 3/12/2560 20:42

2581 0DA3 CDAD12 call put_str


2582 0DA6 C9 ret
2583
2584 0DA7 C9 exit_prompting: ret
2585
2586
2587
2588 ; command execute
2589 ; get command from serial port
2590
2591 0DA8 3A22F0 download: lda command
2592 0DAB FE6C cpi "l"
2593 0DAD C2C90D jnz exit_download
2594
2595 0DB0 CD8515 call clear_bcd1 ; reset bcd counter1
2596 0DB3 3E01 mvi a,1
2597 0DB5 323AF0 sta temp
2598
2599 0DB8 AF xra a
2600 0DB9 3220F0 sta bcs ; clear byte chekc sum error
2601
2602 0DBC 21DC1E lxi h,download_text
2603 0DBF CDAD12 call put_str
2604 0DC2 CD4D14 call get_record
2605 0DC5 CD920D call send_prompt
2606 0DC8 C9 ret
2607
2608 0DC9 C9 exit_download ret
2609
2610 ; display printable ASCII code, 20H-7FH
2611
2612 0DCA 3A22F0 ascii_print: lda command
2613 0DCD FE61 cpi "a"
2614 0DCF C2FB0D jnz exit_ascii_print
2615
2616
2617 0DD2 216D1F lxi h, ascii_text
2618 0DD5 CDAD12 call put_str
2619
2620 0DD8 CD2413 call new_line
2621 0DDB CD2413 call new_line
2622
2623 0DDE 2E20 mvi l,20h
2624 0DE0 0E60 mvi c,96
2625
2626 0DE2 ascii_print1:
2627
2628 0DE2 7D mov a,l
2629 0DE3 CD8712 call cout
2630
2631 0DE6 3E3D mvi a,"="
2632 0DE8 CD8712 call cout
2633 0DEB 7D mov a,l
2634 0DEC CD1513 call out2x
2635 0DEF CD2F13 call space
2636 0DF2 2C inr l
2637 0DF3 0D dcr c
2638 0DF4 C2E20D jnz ascii_print1
2639
2640 0DF7 CD920D call send_prompt

Page 44 of 86
B8080.LST 3/12/2560 20:42

2641 0DFA C9 ret


2642
2643 0DFB exit_ascii_print:
2644
2645 0DFB C9 ret
2646
2647 ;------------------- set value to user registers ------------
2648 ; set value to user register AF, BC, DE, HL, SP, PC
2649
2650 0DFC set_user_register:
2651
2652 0DFC 3A22F0 lda command
2653 0DFF FE73 cpi "s"
2654 0E01 C2100F jnz exit_set_user
2655
2656 0E04 211B20 lxi h, set_register_text
2657 0E07 CDAD12 call put_str
2658
2659 0E0A CD8F12 call cin
2660 0E0D FE61 cpi "a"
2661 0E0F C2380E jnz set_user1
2662
2663 0E12 CD2413 call new_line
2664 0E15 21BF1F lxi h,af_text
2665 0E18 CDAD12 call put_str
2666 0E1B 2A2CF0 lhld user_AF
2667 0E1E 7C mov a,h
2668 0E1F CD1513 call out2x
2669 0E22 7D mov a,l
2670 0E23 CD1513 call out2x
2671 0E26 CD3513 call send_tab
2672 0E29 CDE813 call get_hex2
2673 0E2C 67 mov h,a
2674 0E2D CDE813 call get_hex2
2675 0E30 6F mov l,a
2676 0E31 222CF0 shld user_AF
2677
2678 0E34 CD920D call send_prompt
2679 0E37 C9 ret
2680
2681 0E38 set_user1:
2682 0E38 FE62 cpi "b"
2683 0E3A C2630E jnz set_user2
2684
2685 0E3D CD2413 call new_line
2686 0E40 21C31F lxi h,bc_text
2687 0E43 CDAD12 call put_str
2688 0E46 2A2EF0 lhld user_BC
2689 0E49 7C mov a,h
2690 0E4A CD1513 call out2x
2691 0E4D 7D mov a,l
2692 0E4E CD1513 call out2x
2693 0E51 CD3513 call send_tab
2694 0E54 CDE813 call get_hex2
2695 0E57 67 mov h,a
2696 0E58 CDE813 call get_hex2
2697 0E5B 6F mov l,a
2698 0E5C 222EF0 shld user_BC
2699
2700 0E5F CD920D call send_prompt

Page 45 of 86
B8080.LST 3/12/2560 20:42

2701 0E62 C9 ret


2702
2703 0E63 set_user2:
2704 0E63 FE64 cpi "d"
2705 0E65 C28E0E jnz set_user3
2706
2707 0E68 CD2413 call new_line
2708 0E6B 21C71F lxi h,de_text
2709 0E6E CDAD12 call put_str
2710 0E71 2A30F0 lhld user_DE
2711 0E74 7C mov a,h
2712 0E75 CD1513 call out2x
2713 0E78 7D mov a,l
2714 0E79 CD1513 call out2x
2715 0E7C CD3513 call send_tab
2716 0E7F CDE813 call get_hex2
2717 0E82 67 mov h,a
2718 0E83 CDE813 call get_hex2
2719 0E86 6F mov l,a
2720 0E87 2230F0 shld user_DE
2721
2722 0E8A CD920D call send_prompt
2723 0E8D C9 ret
2724
2725 0E8E set_user3:
2726 0E8E FE68 cpi "h"
2727 0E90 C2B90E jnz set_user4
2728
2729 0E93 CD2413 call new_line
2730 0E96 21CB1F lxi h,hl_text
2731 0E99 CDAD12 call put_str
2732 0E9C 2A32F0 lhld user_HL
2733 0E9F 7C mov a,h
2734 0EA0 CD1513 call out2x
2735 0EA3 7D mov a,l
2736 0EA4 CD1513 call out2x
2737 0EA7 CD3513 call send_tab
2738 0EAA CDE813 call get_hex2
2739 0EAD 67 mov h,a
2740 0EAE CDE813 call get_hex2
2741 0EB1 6F mov l,a
2742 0EB2 2232F0 shld user_HL
2743
2744 0EB5 CD920D call send_prompt
2745 0EB8 C9 ret
2746
2747 0EB9 set_user4:
2748 0EB9 FE73 cpi "s"
2749 0EBB C2E40E jnz set_user5
2750
2751 0EBE CD2413 call new_line
2752 0EC1 21CF1F lxi h,sp_text
2753 0EC4 CDAD12 call put_str
2754 0EC7 2A34F0 lhld user_SP
2755 0ECA 7C mov a,h
2756 0ECB CD1513 call out2x
2757 0ECE 7D mov a,l
2758 0ECF CD1513 call out2x
2759 0ED2 CD3513 call send_tab
2760 0ED5 CDE813 call get_hex2

Page 46 of 86
B8080.LST 3/12/2560 20:42

2761 0ED8 67 mov h,a


2762 0ED9 CDE813 call get_hex2
2763 0EDC 6F mov l,a
2764 0EDD 2234F0 shld user_SP
2765
2766 0EE0 CD920D call send_prompt
2767 0EE3 C9 ret
2768
2769 0EE4 set_user5:
2770 0EE4 FE70 cpi "p"
2771 0EE6 C20F0F jnz set_user6
2772
2773 0EE9 CD2413 call new_line
2774 0EEC 21D81F lxi h,pc_text
2775 0EEF CDAD12 call put_str
2776 0EF2 2A2AF0 lhld user_PC
2777 0EF5 7C mov a,h
2778 0EF6 CD1513 call out2x
2779 0EF9 7D mov a,l
2780 0EFA CD1513 call out2x
2781 0EFD CD3513 call send_tab
2782 0F00 CDE813 call get_hex2
2783 0F03 67 mov h,a
2784 0F04 CDE813 call get_hex2
2785 0F07 6F mov l,a
2786 0F08 222AF0 shld user_PC
2787
2788 0F0B CD920D call send_prompt
2789 0F0E C9 ret
2790
2791 0F0F C9 set_user6: ret
2792
2793 0F10 exit_set_user:
2794
2795 0F10 C9 ret
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806 0F11 print_watch_ram:
2807
2808 0F11 CD2413 call new_line
2809 0F14 2100F0 lxi h, watch_ram
2810 0F17 0E10 mvi c,16
2811 0F19 7C mov a,h
2812 0F1A CD1513 call out2x
2813 0F1D 7D mov a,l
2814 0F1E CD1513 call out2x
2815 0F21 watch1:
2816 0F21 CD2F13 call space
2817 0F24 7E mov a,m
2818 0F25 CD1513 call out2x
2819 0F28 23 inx h
2820 0F29 0D dcr c

Page 47 of 86
B8080.LST 3/12/2560 20:42

2821 0F2A C2210F jnz watch1


2822 0F2D C9 ret
2823
2824
2825
2826 ;----------- clear watch variables---------------------------
2827
2828 0F2E 3A22F0 clear_watch: lda command
2829 0F31 FE63 cpi "c"
2830 0F33 C2480F jnz exit_clear_watch
2831 0F36 2100F0 lxi h, watch_ram
2832 0F39 0E10 mvi c,16
2833
2834 0F3B AF clear1: xra a
2835 0F3C 77 mov m,a
2836 0F3D 23 inx h
2837 0F3E 0D dcr c
2838 0F3F C23B0F jnz clear1
2839
2840 0F42 CD110F call print_watch_ram
2841 0F45 CD920D call send_prompt
2842
2843 0F48 C9 exit_clear_watch: ret
2844
2845
2846
2847
2848
2849
2850 ;----------- print watch variables --------------------------
2851
2852 0F49 print_watch:
2853
2854 0F49 3A22F0 lda command
2855 0F4C FE77 cpi "w"
2856 0F4E C2570F jnz exit_watch
2857
2858 0F51 CD110F call print_watch_ram
2859 0F54 CD920D call send_prompt
2860
2861 0F57 C9 exit_watch: ret
2862
2863
2864 ;---------- single step running with key space --------------
2865 0F58 single_step_:
2866
2867 0F58 3A22F0 lda command
2868 0F5B FE20 cpi " "
2869 0F5D C2630F jnz exit_step
2870 0F60 CDB509 call single_step
2871
2872 0F63 exit_step:
2873 0F63 C9 ret
2874
2875 ;------- display stack area from top of stack to initial
2876
2877 0F64 stack_display:
2878 0F64 3A22F0 lda command
2879 0F67 FE6B cpi "k"
2880 0F69 C2A30F jnz exit_stack

Page 48 of 86
B8080.LST 3/12/2560 20:42

2881
2882 ; lxi h,stack_text
2883 ; call put_str
2884
2885 0F6C 21481F lxi h,edit_text2
2886 0F6F CDAD12 call put_str
2887 0F72 CD2413 call new_line
2888
2889 0F75 2A34F0 lhld user_SP
2890
2891 0F78 stack_display1:
2892
2893 0F78 7C mov a,h
2894 0F79 CD1513 call out2x
2895 0F7C 7D mov a,l
2896 0F7D CD1513 call out2x
2897
2898 0F80 CD2F13 call space
2899 0F83 CD2F13 call space
2900 0F86 3E5B mvi a,"["
2901 0F88 CD8712 call cout
2902
2903 0F8B 7E mov a,m
2904 0F8C CD1513 call out2x
2905
2906 0F8F 3E5D mvi a,"]"
2907 0F91 CD8712 call cout
2908
2909 0F94 CD2413 call new_line
2910
2911 0F97 23 inx h
2912
2913 0F98 119AF0 lxi d, user_stack+32+1 ; load base of user stack
2914
2915 0F9B 7D mov a,l
2916 0F9C AB xra e
2917 0F9D C2780F jnz stack_display1
2918
2919 0FA0 CD920D call send_prompt
2920
2921 0FA3 exit_stack:
2922 0FA3 C9 ret
2923
2924
2925
2926 ;---------------- registers display -------------------------
2927
2928 0FA4 register_display:
2929
2930 0FA4 3A22F0 lda command
2931 0FA7 FE72 cpi "r"
2932 0FA9 C2C910 jnz exit_register
2933
2934 0FAC register_display1:
2935
2936 ; lda uart_found
2937 ; cpi 0
2938 ; jz exit_register ; exit of no uart
2939
2940

Page 49 of 86
B8080.LST 3/12/2560 20:42

2941 0FAC CD2413 call new_line


2942
2943 0FAF register_display2:
2944 0FAF CD2413 call new_line
2945
2946 0FB2 21BF1F lxi h,af_text
2947 0FB5 CDAD12 call put_str
2948 0FB8 2A2CF0 lhld user_AF
2949 0FBB 7C mov a,h
2950 0FBC CD1513 call out2x
2951 0FBF 7D mov a,l
2952 0FC0 CD1513 call out2x
2953 0FC3 CD2F13 call space
2954
2955 0FC6 21C31F lxi h,bc_text
2956 0FC9 CDAD12 call put_str
2957 0FCC 2A2EF0 lhld user_BC
2958 0FCF 7C mov a,h
2959 0FD0 CD1513 call out2x
2960 0FD3 7D mov a,l
2961 0FD4 CD1513 call out2x
2962
2963 0FD7 CD2F13 call space
2964
2965 0FDA 21C71F lxi h,de_text
2966 0FDD CDAD12 call put_str
2967 0FE0 2A30F0 lhld user_DE
2968 0FE3 7C mov a,h
2969 0FE4 CD1513 call out2x
2970 0FE7 7D mov a,l
2971 0FE8 CD1513 call out2x
2972 0FEB CD2F13 call space
2973
2974 0FEE 21CB1F lxi h,hl_text
2975 0FF1 CDAD12 call put_str
2976 0FF4 2A32F0 lhld user_HL
2977 0FF7 7C mov a,h
2978 0FF8 CD1513 call out2x
2979 0FFB 7D mov a,l
2980 0FFC CD1513 call out2x
2981
2982 0FFF CD2F13 call space
2983
2984 1002 21CF1F lxi h,sp_text
2985 1005 CDAD12 call put_str
2986 1008 2A34F0 lhld user_SP
2987 100B 7C mov a,h
2988 100C CD1513 call out2x
2989 100F 7D mov a,l
2990 1010 CD1513 call out2x
2991
2992 1013 CD2F13 call space
2993
2994 ; lxi h,tos_text
2995 ; call put_str
2996 ; lhld tos
2997 ; mov a,h
2998 ; call out2x
2999 ; mov a,l
3000 ; call out2x

Page 50 of 86
B8080.LST 3/12/2560 20:42

3001 ; call space


3002
3003 1016 21D81F lxi h,pc_text
3004 1019 CDAD12 call put_str
3005 101C 2A2AF0 lhld user_PC
3006 101F 7C mov a,h
3007 1020 CD1513 call out2x
3008 1023 7D mov a,l
3009 1024 CD1513 call out2x
3010
3011 1027 CD2F13 call space
3012
3013 102A 21F21F lxi h,sign_text
3014 102D CDAD12 call put_str
3015 1030 2A2CF0 lhld user_AF
3016 1033 7D mov a,l
3017 1034 E680 ani 80h
3018 1036 C24110 jnz register_flag1
3019 1039 3E30 mvi a,"0"
3020 103B CD8712 call cout
3021 103E C34610 jmp register_flag2
3022
3023 1041 register_flag1:
3024 1041 3E31 mvi a,"1"
3025 1043 CD8712 call cout
3026
3027 1046 register_flag2:
3028 1046 CD2F13 call space
3029
3030 1049 21CA10 lxi h,zero_text
3031 104C CDAD12 call put_str
3032 104F 2A2CF0 lhld user_AF
3033 1052 7D mov a,l
3034 1053 E640 ani 40h
3035 1055 C26010 jnz register_flag3
3036 1058 3E30 mvi a,"0"
3037 105A CD8712 call cout
3038 105D C36510 jmp register_flag4
3039
3040 1060 register_flag3:
3041 1060 3E31 mvi a,"1"
3042 1062 CD8712 call cout
3043
3044 1065 register_flag4:
3045 1065 CD2F13 call space
3046
3047 1068 21CD10 lxi h,AC_text
3048 106B CDAD12 call put_str
3049 106E 2A2CF0 lhld user_AF
3050 1071 7D mov a,l
3051 1072 E610 ani 10h
3052 1074 C27F10 jnz register_flag5
3053 1077 3E30 mvi a,"0"
3054 1079 CD8712 call cout
3055 107C C38410 jmp register_flag6
3056
3057 107F register_flag5:
3058 107F 3E31 mvi a,"1"
3059 1081 CD8712 call cout
3060

Page 51 of 86
B8080.LST 3/12/2560 20:42

3061 1084 register_flag6:


3062 1084 CD2F13 call space
3063
3064 1087 21D110 lxi h,P_text
3065 108A CDAD12 call put_str
3066 108D 2A2CF0 lhld user_AF
3067 1090 7D mov a,l
3068 1091 E604 ani 4
3069 1093 C29E10 jnz register_flag7
3070 1096 3E30 mvi a,"0"
3071 1098 CD8712 call cout
3072 109B C3A310 jmp register_flag8
3073
3074 109E register_flag7:
3075 109E 3E31 mvi a,"1"
3076 10A0 CD8712 call cout
3077
3078 10A3 register_flag8:
3079 10A3 CD2F13 call space
3080
3081 10A6 21D410 lxi h,CY_text
3082 10A9 CDAD12 call put_str
3083 10AC 2A2CF0 lhld user_AF
3084 10AF 7D mov a,l
3085 10B0 E601 ani 1
3086 10B2 C2BD10 jnz register_flag9
3087 10B5 3E30 mvi a,"0"
3088 10B7 CD8712 call cout
3089 10BA C3C210 jmp register_flag10
3090
3091 10BD register_flag9:
3092 10BD 3E31 mvi a,"1"
3093 10BF CD8712 call cout
3094
3095 10C2 register_flag10:
3096 10C2 CD2F13 call space
3097
3098 10C5 CD920D call send_prompt
3099 10C8 C9 ret
3100
3101 10C9 exit_register:
3102 10C9 C9 ret
3103
3104 10CA 5A3D00 zero_text dfb "Z=",0
3105 10CD 41433D00 AC_text dfb "AC=",0
3106 10D1 503D00 P_text dfb "P=",0
3107 10D4 43593D00 CY_text dfb "CY=",0
3108
3109
3110 ;----------------- fill constant to memory ------------------
3111
3112 10D8 fill_memory:
3113
3114 10D8 3A22F0 lda command
3115 10DB FE66 cpi "f"
3116 10DD C21B11 jnz exit_fill
3117 10E0 217E1F lxi h,fill_text1
3118 10E3 CDAD12 call put_str
3119
3120 10E6 CDCF13 call get_hex1

Page 52 of 86
B8080.LST 3/12/2560 20:42

3121 10E9 67 mov h,a


3122 10EA CDCF13 call get_hex1
3123 10ED 6F mov l,a
3124 10EE E5 push h ; save begin address to stack
3125
3126 10EF 218F1F lxi h,fill_text2
3127 10F2 CDAD12 call put_str
3128
3129 10F5 CDCF13 call get_hex1
3130 10F8 67 mov h,a
3131 10F9 CDCF13 call get_hex1
3132 10FC 6F mov l,a
3133 10FD E5 push h ; save end address to stack
3134
3135 10FE 219F1F lxi h,fill_text3
3136 1101 CDAD12 call put_str
3137 1104 CDCF13 call get_hex1
3138
3139 1107 47 mov b,a ; byte save to B
3140
3141 1108 D1 pop d ; end address in DE
3142
3143 1109 E1 pop h ; begin address in HL
3144
3145 110A fill_memory1:
3146
3147 110A 78 mov a,b
3148 110B 77 mov m,a
3149 110C 23 inx h
3150
3151 110D 7D mov a,l
3152 110E BB cmp e
3153 110F C20A11 jnz fill_memory1
3154
3155 1112 7C mov a,h
3156 1113 BA cmp d
3157 1114 C20A11 jnz fill_memory1
3158
3159
3160 1117 CD920D call send_prompt
3161 111A C9 ret
3162
3163 111B exit_fill:
3164
3165 111B C9 ret
3166
3167
3168
3169
3170 ;---------------- monitor function list ---------------------
3171
3172 111C monitor_function:
3173
3174 111C 3A22F0 lda command
3175 111F FE6D cpi "m"
3176 1121 C23411 jnz exit_monitor
3177
3178 1124 CD2413 call new_line
3179 1127 212A23 lxi h,monitor_text
3180 112A CDAD12 call put_str

Page 53 of 86
B8080.LST 3/12/2560 20:42

3181 112D CD2413 call new_line


3182 1130 CD920D call send_prompt
3183 1133 C9 ret
3184
3185 1134 exit_monitor:
3186 1134 C9 ret
3187
3188 ;----------------------- jump to user program ---------------
3189
3190 1135 3A22F0 jump_to_user_pgm: lda command
3191 1138 FE6A cpi "j"
3192 113A C27E11 jnz exit_jump
3193
3194 113D 21561F lxi h, jump_text1
3195 1140 CDAD12 call put_str
3196
3197 1143 2A2AF0 lhld user_PC
3198 1146 7C mov a,h
3199 1147 CD1513 call out2x
3200 114A 7D mov a,l
3201 114B CD1513 call out2x
3202
3203 114E 21681F lxi h,jump_text2
3204 1151 CDAD12 call put_str
3205
3206 1154 CDE813 call get_hex2
3207
3208 1157 F5 push psw
3209
3210 1158 3A23F0 lda flag1
3211 115B E601 ani 1
3212 115D C26F11 jnz skip_load_PC
3213
3214 1160 F1 pop psw
3215
3216 1161 67 mov h,a
3217 1162 CDE813 call get_hex2
3218 1165 6F mov l,a
3219 1166 222AF0 shld user_PC
3220 1169 CD2413 call new_line
3221 116C C39109 jmp go
3222
3223 116F skip_load_PC:
3224 116F F1 pop psw
3225 1170 3A23F0 lda flag1
3226 1173 E6FE ani 0feh
3227 1175 3223F0 sta flag1
3228 1178 CD2413 call new_line
3229 117B C39109 jmp go
3230
3231 117E C9 exit_jump: ret
3232
3233 ;------------ edit memory -----------------------------------
3234
3235
3236 117F 3A22F0 edit_location: lda command
3237 1182 FE65 cpi "e"
3238 1184 C20112 jnz exit_edit
3239
3240 1187 21051F lxi h, edit_text

Page 54 of 86
B8080.LST 3/12/2560 20:42

3241 118A CDAD12 call put_str


3242 118D CDCF13 call get_hex1
3243 1190 67 mov h,a
3244 1191 CDCF13 call get_hex1
3245 1194 6F mov l,a
3246 1195 223CF0 shld pointer ;user_PC
3247
3248 1198 211D1F lxi h, edit_text1
3249 119B CDAD12 call put_str
3250
3251 119E 21481F lxi h, edit_text2
3252 11A1 CDAD12 call put_str
3253
3254 11A4 CD2413 edit1: call new_line
3255
3256 11A7 2A3CF0 lhld pointer ;user_PC
3257 11AA 7C mov a,h
3258 11AB CD1513 call out2x
3259 11AE 7D mov a,l
3260 11AF CD1513 call out2x
3261 11B2 CD2F13 call space
3262 11B5 CD2F13 call space
3263 11B8 3E5B mvi a,"["
3264 11BA CD8712 call cout
3265 11BD 7E mov a,m
3266 11BE CD1513 call out2x
3267 11C1 3E5D mvi a,"]"
3268 11C3 CD8712 call cout
3269
3270 11C6 CD2F13 call space
3271
3272 11C9 CDE813 call get_hex2
3273
3274 11CC F5 push psw
3275
3276 11CD 3A23F0 lda flag1
3277 11D0 E601 ani 1
3278 11D2 C2F211 jnz exit_edit1 ; Enter key?
3279
3280 11D5 3A23F0 lda flag1
3281 11D8 E602 ani 2
3282 11DA C2E211 jnz skip_edit1 ; SPACE key?
3283
3284 11DD F1 pop psw
3285
3286 11DE 77 mov m,a
3287 11DF C3EB11 jmp skip_edit2
3288
3289 11E2 F1 skip_edit1: pop psw
3290
3291 11E3 3A23F0 lda flag1
3292 11E6 E6FD ani 0fdh
3293 11E8 3223F0 sta flag1
3294
3295 11EB skip_edit2:
3296 11EB 23 inx h
3297 11EC 223CF0 shld pointer ;user_PC
3298 11EF C3A411 jmp edit1
3299
3300 11F2 F1 exit_edit1: pop psw

Page 55 of 86
B8080.LST 3/12/2560 20:42

3301
3302 11F3 3A23F0 lda flag1
3303 11F6 E6FE ani 0feh
3304 11F8 3223F0 sta flag1
3305
3306 11FB CD2413 call new_line
3307 11FE CD920D call send_prompt
3308
3309 1201 C9 exit_edit: ret
3310
3311
3312 1202 3A22F0 new_location: lda command
3313 1205 FE6E cpi "n"
3314 1207 C21E12 jnz exit_new_location
3315 120A 21F51E lxi h,new_text
3316 120D CDAD12 call put_str
3317 1210 CDCF13 call get_hex1
3318 1213 67 mov h,a
3319 1214 CDCF13 call get_hex1
3320 1217 6F mov l,a
3321 1218 223CF0 shld pointer ; user_PC
3322 121B CD920D call send_prompt
3323
3324 121E exit_new_location:
3325
3326 121E C9 ret
3327
3328
3329
3330
3331 121F quick_home:
3332 121F 3A22F0 lda command
3333 1222 FE71 cpi "q"
3334 1224 C23312 jnz exit_quick_home
3335
3336 1227 210081 lxi h,home_address
3337 122A 222AF0 shld user_PC
3338 122D 223CF0 shld pointer
3339 1230 CD920D call send_prompt
3340
3341 1233 exit_quick_home:
3342 1233 C9 ret
3343
3344 ; i/o address map
3345
3346 1234 3A22F0 io_address: lda command
3347 1237 FE69 cpi "i"
3348 1239 C24512 jnz exit_io
3349
3350 123C 21F921 lxi h,io_text
3351 123F CDAD12 call put_str
3352 1242 CD920D call send_prompt
3353
3354 1245 C9 exit_io: ret
3355
3356
3357 ; help listing
3358
3359 1246 3A22F0 help: lda command
3360 1249 FE3F cpi "?"

Page 56 of 86
B8080.LST 3/12/2560 20:42

3361 124B C25D12 jnz exit_help


3362
3363 124E 21C212 lxi h,prompt3
3364 1251 CDBB12 call alt_put_str
3365 1254 216D20 lxi h,help_text1
3366 1257 CDAD12 call put_str
3367 125A CD920D call send_prompt
3368
3369 125D C9 exit_help: ret
3370
3371
3372 ; initialize 16C550 uart to 9600 8n1 with 2MHz clock
3373 ; 2MHz/13 = 153846Hz
3374
3375 125E init_uart:
3376
3377 125E 3E83 mvi a,83h
3378 1260 D343 out uart_lcr ; set DLAB bit to access divider
3379
3380 1262 3E0D mvi a,13
3381 1264 D340 out uart_divisor_lsb
3382 1266 3E00 mvi a,0
3383 1268 D341 out uart_divisor_msb ; 2MHz/13 = 153846 Hz
3384 ; 153846Hz/16 = 9615Hz
3385 126A 3E07 mvi a,7
3386 126C D342 out uart_fifo ; init fifo and clear all buffer
3387 126E 3E03 mvi a,03h
3388 1270 D343 out uart_lcr ; clar DLAB
3389
3390 ; check uart line status, if the byte is FF then no uart
3391 ;
3392 ;
3393 1272 AF xra a
3394 1273 D347 out uart_scr ; check if there is uart
3395 1275 DB47 in uart_scr
3396 1277 FE00 cpi 0
3397 1279 CA8112 jz found
3398 127C AF xra a
3399 127D 3225F0 sta uart_found
3400 1280 C9 ret
3401
3402 1281 3E01 found mvi a,1
3403 1283 3225F0 sta uart_found
3404 1286 C9 ret
3405
3406 ;cout: mov b,a ; save a
3407
3408 ;cout1: in uart_line_status
3409 ; ani 20h ; transmitter ready?
3410 ; jz cout1
3411
3412 ; mov a,b ; restore a
3413 ; out uart_buffer
3414 ; ret
3415
3416 1287 F5 cout: push psw ; save Accumulator
3417 1288 D5 push d
3418 1289 CDC714 call send_byte ; use software UART 2400 bit
3419 128C D1 pop d
3420 128D F1 pop psw ; restore Accumulator

Page 57 of 86
B8080.LST 3/12/2560 20:42

3421 128E C9 ret


3422
3423
3424 128F CD0515 cin: CALL GET_BYTE ; USE SOFTWARE UART 2400 BIT
3425 1292 C9 ret
3426
3427
3428 1293 CD8F12 get_command: call cin
3429 1296 3222F0 sta command
3430 1299 C9 ret
3431
3432 129A DB45 in uart_line_status
3433 129C E601 ani 1
3434 129E CAA712 jz no_data
3435 12A1 DB40 in uart_buffer
3436 12A3 3222F0 sta command ; command = ASCII code
3437 12A6 C9 ret
3438
3439 12A7 3EFF no_data: mvi a,0ffh ; command == -1
3440 12A9 3222F0 sta command
3441 12AC C9 ret
3442
3443
3444 ; print string terminated by 0
3445 ; input: HL
3446
3447 12AD 7E put_str: mov a,m ; get A from [HL]
3448 12AE FE00 cpi 0
3449 12B0 C2B412 jnz put_str1
3450 12B3 C9 ret
3451
3452 12B4 CD8712 put_str1: call cout
3453 12B7 23 inx h
3454 12B8 F2AD12 jp put_str
3455
3456 12BB 7E alt_put_str: mov a,m ; get A from [HL]
3457 ; xri 0aah
3458
3459 12BC FE00 cpi 0
3460 12BE C2EF12 jnz put_str2
3461 12C1 C9 ret
3462
3463 12C2 0D0A0A3830prompt3: dfb cr,lf,lf,"8080 MICROPROCESSOR KIT [2016]
3464
3465 12EF CD8712 put_str2: call cout
3466 12F2 23 inx h
3467 12F3 F2BB12 jp alt_put_str
3468
3469
3470
3471 12F6 21781E send_prompt1: lxi h,prompt1
3472 12F9 CDAD12 call put_str
3473 12FC C9 ret
3474
3475 12FD 21C212 send_prompt3: lxi h,prompt3
3476 1300 CDBB12 call alt_put_str
3477 1303 C9 ret
3478
3479
3480

Page 58 of 86
B8080.LST 3/12/2560 20:42

3481 1304 F5 out1x: push psw


3482 1305 E60F ani 0fh
3483 1307 C630 adi "0"
3484 1309 FE3A cpi 3Ah
3485 130B DA1013 jc out1x1
3486 130E C607 adi 7
3487
3488 1310 CD8712 out1x1: call cout
3489 1313 F1 pop psw
3490 1314 C9 ret
3491
3492 1315 out2x:
3493 1315 0F rrc
3494 1316 0F rrc
3495 1317 0F rrc
3496 1318 0F rrc
3497 1319 CD0413 call out1x
3498 131C 07 rlc
3499 131D 07 rlc
3500 131E 07 rlc
3501 131F 07 rlc
3502 1320 CD0413 call out1x
3503 1323 C9 ret
3504
3505 ; new_line
3506
3507 1324 3E0D new_line: mvi a,cr
3508 1326 CD8712 call cout
3509 1329 3E0A mvi a,lf
3510 132B CD8712 call cout
3511 132E C9 ret
3512
3513 132F 3E20 space: mvi a," "
3514 1331 CD8712 call cout
3515 1334 C9 ret
3516
3517 1335 3E09 send_tab: mvi a,9
3518 1337 CD8712 call cout
3519 133A C9 ret
3520
3521
3522
3523 133B 3A22F0 hex_dump: lda command
3524 133E FE68 cpi "h"
3525 1340 C29A13 jnz exit_hex_dump
3526
3527 1343 CD2413 call new_line
3528
3529 1346 0E08 mvi c,8 ; 8 lines
3530
3531 1348 C5 hex_dump2: push b
3532 1349 CD2413 call new_line
3533 134C 2A3CF0 lhld pointer ;user_PC
3534 134F 7C mov a,h
3535 1350 CD1513 call out2x
3536 1353 7D mov a,l
3537 1354 CD1513 call out2x
3538 1357 CD2F13 call space
3539
3540 135A 0E10 mvi c,16

Page 59 of 86
B8080.LST 3/12/2560 20:42

3541
3542 135C CD2F13 hex_dump1: call space
3543 135F 7E mov a,m
3544 1360 CD1513 call out2x
3545 1363 23 inx h
3546 1364 0D dcr c
3547 1365 C25C13 jnz hex_dump1
3548
3549 1368 CD2F13 call space
3550 136B CD2F13 call space
3551 136E CD2F13 call space
3552
3553 ; print ASCII representation 20H-7FH
3554 ; outside such range, print . instead
3555
3556 1371 11F0FF lxi d,0FFF0h ; load DE with -16
3557 1374 19 dad d ; ADD HL,DE
3558
3559 1375 0E10 mvi c,16
3560
3561 1377 7E hex_dump5: mov a,m
3562
3563 1378 FE20 cpi 20h ; <20H?
3564 137A DA8213 jc hex_dump3
3565 137D FE80 cpi 80h
3566 137F DA8413 jc hex_dump4
3567 1382 3E2E hex_dump3: mvi a,"."
3568 1384 CD8712 hex_dump4: call cout
3569
3570 1387 23 inx h
3571 1388 0D dcr c
3572 1389 C27713 jnz hex_dump5
3573
3574 138C 223CF0 shld pointer ;user_PC
3575
3576 138F C1 pop b
3577 1390 0D dcr c
3578 1391 C24813 jnz hex_dump2
3579
3580 1394 CD2413 call new_line
3581 1397 CD920D call send_prompt
3582
3583 139A C9 exit_hex_dump: ret
3584
3585
3586 139B 210081 dump_memory: lxi h,8100h
3587 139E 0E64 mvi c,100 ; 100 bytes display
3588
3589 13A0 CD2413 call new_line
3590 13A3 7E dump1: mov a,m
3591 13A4 CD1513 call out2x
3592 13A7 CD2F13 call space
3593 13AA 23 inx h
3594 13AB 0D dcr c
3595 13AC C2A313 jnz dump1
3596 13AF C9 ret
3597
3598 ; convert ASCII letter to one nibble 0-F
3599 ; 0-9 -> al-30
3600 ; A-F -> al-7

Page 60 of 86
B8080.LST 3/12/2560 20:42

3601 ; entry: A
3602 ; exit: A
3603
3604 13B0 D630 to_hex: sui "0"
3605 13B2 FE0A cpi 10
3606 13B4 DABB13 jc zero_nine
3607 13B7 E6DF ani 11011111b
3608 13B9 D607 sui 7 ; convert to A-F
3609 13BB zero_nine:
3610
3611 13BB C9 ret
3612
3613 ; read two ASCII bytes and convert them to one bye 8-bit
3614 ; exit: A
3615 ; used: A, E
3616
3617 13BC CD8F12 get_hex: call cin
3618 13BF CDB013 call to_hex
3619 13C2 0F rrc
3620 13C3 0F rrc
3621 13C4 0F rrc
3622 13C5 0F rrc
3623 13C6 5F mov e,a
3624 13C7 CD8F12 call cin
3625 13CA CDB013 call to_hex
3626 13CD 83 add e
3627 13CE C9 ret
3628
3629 ; read two ASCII bytes echo to screen and convert them to
3630 ; exit: A
3631
3632 13CF CD8F12 get_hex1: call cin
3633 13D2 CD8712 call cout
3634 13D5 CDB013 call to_hex
3635 13D8 0F rrc
3636 13D9 0F rrc
3637 13DA 0F rrc
3638 13DB 0F rrc
3639 13DC 5F mov e,a
3640 13DD CD8F12 call cin
3641 13E0 CD8712 call cout
3642 13E3 CDB013 call to_hex
3643 13E6 83 add e
3644 13E7 C9 ret
3645
3646 ; read two ASCII bytes echo to screen and convert them to
3647 ; exit: A
3648
3649 13E8 3A23F0 get_hex2: lda flag1
3650 13EB E6FC ani 0fch ; clear flag1.1 and flag1.0
3651 13ED 3223F0 sta flag1
3652
3653 13F0 CD8F12 call cin
3654 13F3 FE0D cpi cr
3655 13F5 CA3B14 jz exit_get_hex2
3656
3657 13F8 FE20 cpi " "
3658 13FA CA4414 jz exit_get_hex3
3659
3660 13FD FE30 cpi 30h ; hex must be 0-9 and A-F

Page 61 of 86
B8080.LST 3/12/2560 20:42

3661 13FF DAE813 jc get_hex2


3662
3663 1402 FE40 cpi 40h
3664 1404 DA1114 jc ascii_0_9
3665
3666 1407 FE61 cpi 97 ; < 97?
3667 1409 DAE813 jc get_hex2
3668
3669 140C FE67 cpi 103 ; >= 103?
3670 140E D2E813 jnc get_hex2
3671
3672 1411 ascii_0_9:
3673
3674 1411 CD8712 call cout
3675 1414 CDB013 call to_hex
3676 1417 0F rrc
3677 1418 0F rrc
3678 1419 0F rrc
3679 141A 0F rrc
3680 141B 5F mov e,a
3681
3682 141C get_2nd_hex:
3683
3684 141C CD8F12 call cin
3685
3686 141F FE30 cpi 30h ; hex must be 0-9 and A-F
3687 1421 DA1C14 jc get_2nd_hex
3688
3689 1424 FE40 cpi 40h
3690 1426 DA3314 jc ok_0_9
3691
3692 1429 FE61 cpi 97 ; < 97?
3693 142B DA1C14 jc get_2nd_hex
3694
3695 142E FE67 cpi 103 ; >= 103?
3696 1430 D21C14 jnc get_2nd_hex
3697
3698 1433 ok_0_9:
3699 1433 CD8712 call cout
3700 1436 CDB013 call to_hex
3701 1439 83 add e
3702 143A C9 ret
3703
3704 143B exit_get_hex2:
3705
3706 143B 3A23F0 lda flag1
3707 143E F601 ori 1
3708 1440 3223F0 sta flag1 ; Q key has been pressed
3709 1443 C9 ret
3710
3711 1444 exit_get_hex3:
3712
3713 1444 3A23F0 lda flag1
3714 1447 F602 ori 2
3715 1449 3223F0 sta flag1 ; SPACE key has been pressed
3716 144C C9 ret
3717
3718
3719 ; add check sum
3720

Page 62 of 86
B8080.LST 3/12/2560 20:43

3721
3722 ; get record, write to SRAM and jump to 8000h
3723 ; entry: A= byte received, B= byte check sum
3724
3725 add_bcs: macro ; add accumulator with byte check sum
3726 push psw
3727 add b
3728 mov b,a
3729 pop psw
3730 endm
3731
3732 001B = esc equ 1bh
3733
3734 144D CD8F12 get_record: call cin
3735 1450 FE1B cpi 27
3736 1452 CA9814 jz esc_quit
3737
3738 1455 FE3A cpi ":"
3739 1457 C24D14 jnz get_record ; wait until begin of record
3740
3741 145A 0600 mvi b,0 ; byte check sum
3742
3743 145C CDBC13 call get_hex ; get number of byte
3744 145F 4F mov c,a ; put to c
3745
3746 1460 add_bcs
3747 1460 F5 push psw
3748 1461 80 add b
3749 1462 47 mov b,a
3750 1463 F1 pop psw
3751 1464 endm
3752
3753 1464 CDBC13 call get_hex ; get destination address, put to bx
3754 1467 67 mov h,a ; save high byte
3755
3756 1468 add_bcs
3757 1468 F5 push psw
3758 1469 80 add b
3759 146A 47 mov b,a
3760 146B F1 pop psw
3761 146C endm
3762
3763 146C CDBC13 call get_hex
3764 146F 6F mov l,a ; and low byte
3765
3766 1470 add_bcs
3767 1470 F5 push psw
3768 1471 80 add b
3769 1472 47 mov b,a
3770 1473 F1 pop psw
3771 1474 endm
3772
3773 1474 CDBC13 call get_hex
3774
3775 1477 add_bcs
3776 1477 F5 push psw
3777 1478 80 add b
3778 1479 47 mov b,a
3779 147A F1 pop psw
3780 147B endm

Page 63 of 86
B8080.LST 3/12/2560 20:43

3781
3782 147B FE01 cpi 1 ; end of record type is
3783 147D C29914 jnz data_record ; jump if not 01
3784
3785 1480 CD8F12 wait_cr: call cin
3786 1483 FE0D cpi cr
3787 1485 C28014 jnz wait_cr ; until end of record sending
3788
3789 1488 3EFF mvi a, 0ffh ; turn speaker off
3790 148A D340 out port1
3791 148C AF xra a
3792 148D D300 out 0 ; turn off GPIO
3793
3794 148F CD6915 call print_bcd1
3795 1492 CD2F13 call space
3796 ; lda bcs
3797 ; call pint8u
3798 ; lxi h,error_text
3799 ; call put_str
3800 1495 CD2413 call new_line
3801
3802 1498 C9 esc_quit: ret
3803
3804
3805 1499 CDBC13 data_record: call get_hex ; get data byte
3806 149C 77 mov m,a ; save to SRAM at [HL]
3807
3808 149D add_bcs
3809 149D F5 push psw
3810 149E 80 add b
3811 149F 47 mov b,a
3812 14A0 F1 pop psw
3813 14A1 endm
3814
3815 14A1 CD3915 call inc_bcd1
3816
3817 ; ori 7fh
3818 ; out port1 ; make buzzer sound
3819
3820
3821 14A4 23 inx h ; next location
3822
3823 14A5 0D dcr c
3824 14A6 C29914 jnz data_record ; until c = 0
3825
3826 14A9 78 mov a,b
3827 14AA 2F cma
3828 14AB 47 mov b,a
3829 14AC 04 inr b ; compute two's complement
3830
3831 14AD CDBC13 call get_hex ; get check sum
3832
3833 14B0 B8 cmp b
3834 14B1 CABB14 jz skip_error
3835
3836 14B4 3A20F0 lda bcs
3837 14B7 3C inr a
3838 14B8 3220F0 sta bcs
3839
3840 14BB skip_error:

Page 64 of 86
B8080.LST 3/12/2560 20:43

3841 14BB 3A3AF0 lda temp ; then shift into temp8


3842 14BE 07 rlc
3843 14BF 323AF0 sta temp
3844 14C2 D300 out 0 ; send to GPIO
3845
3846 14C4 C34D14 jmp get_record ; back to next record
3847
3848
3849 ;************************ software UART 2400 bit/s **********
3850
3851 ; SEND ASCII LETTER TO TERMINAL
3852 ; ENTRY: A
3853
3854 14C7 5F SEND_BYTE: mov E,A
3855
3856 14C8 3EBF mvi a,0bFH
3857 14CA D340 OUT PORT1
3858 14CC CDF714 CALL BIT_DELAY ; SEND START BIT
3859
3860 14CF 1608 mvi d,8
3861
3862 14D1 7B CHK_BIT: mov a,e
3863 14D2 E601 ani 1
3864 14D4 CADE14 jz SEND_ZERO
3865
3866 14D7 3EFF mvi a,0FFH
3867 14D9 D340 OUT port1
3868 14DB C3E514 JMP NEXT_BIT
3869
3870 14DE 3EBF SEND_ZERO: mvi a,0bFH
3871 14E0 D340 OUT port1
3872 14E2 C3E514 JMP NEXT_BIT
3873
3874 14E5 CDF714 NEXT_BIT: CALL BIT_DELAY
3875
3876 14E8 7B mov a,e
3877 14E9 0F RRC
3878 14EA 5F mov e,a
3879 14EB 15 DCR D
3880 14EC C2D114 JNZ CHK_BIT
3881
3882 14EF 3EFF mvi a,0FFH
3883 14F1 D340 OUT PORT1
3884 14F3 CDF714 CALL BIT_DELAY ; SEND STOP BIT
3885 14F6 C9 RET
3886
3887 ; BIT PERIOD FOR 2400 BIT/S
3888
3889 14F7 0626 BIT_DELAY: MVI B,26h
3890 14F9 05 delay_bit: dcr b
3891 14FA C2F914 jnz delay_bit
3892 14FD C9 ret
3893
3894 ; 1.5 bit delay
3895
3896 14FE 063C delay_1_5: mvi b,3ch
3897 1500 05 delay_bit15: dcr b
3898 1501 C20015 jnz delay_bit15
3899 1504 C9 ret
3900

Page 65 of 86
B8080.LST 3/12/2560 20:43

3901 ; RECEIVE BYTE FROM 2400 BIT/S TERMINAL


3902 ; EXIT: A
3903
3904 1505 D5 GET_BYTE PUSH D
3905
3906 1506 DB20 CIN1 IN PORT0 ; CHECK START BIT
3907 1508 E620 ANI 20H ; TEST RXD BIT
3908 150A C20615 JNZ CIN1 ; REPEAT IF HIGH
3909
3910 150D CDFE14 CALL delay_1_5
3911
3912 1510 1607 MVI D,7
3913 1512 1E00 MVI E,0
3914
3915 1514 DB20 CHK_BIT_RX IN PORT0
3916 1516 E620 ANI 20H
3917 1518 C22215 JNZ BIT_IS_ONE
3918
3919 151B 7B MOV A,E
3920 151C E67F ANI 01111111B
3921 151E 5F MOV E,A
3922 151F F22915 JP NEXT_BIT_RX
3923
3924 1522 7B BIT_IS_ONE MOV A,E
3925 1523 F680 ORI 10000000B
3926 1525 5F MOV E,A
3927
3928 1526 F22915 JP NEXT_BIT_RX
3929
3930 1529 CDF714 NEXT_BIT_RX CALL BIT_DELAY
3931
3932 152C 7B MOV A,E
3933 152D 0F RRC
3934 152E 5F MOV E,A
3935
3936 152F 15 DCR D
3937 1530 C21415 JNZ CHK_BIT_RX
3938
3939 1533 CDF714 CALL BIT_DELAY ; CENTER OF STOP BIT
3940
3941 1536 7B MOV A,E ; RETURN BYTE TO A
3942
3943 1537 D1 POP D
3944
3945 1538 C9 RET
3946
3947
3948 ;---------------- increment BCD counter1 --------------------
3949
3950 1539 E5 inc_bcd1: push h
3951
3952 153A 2141F0 lxi h,bcd_counter1
3953 153D AF xra a
3954
3955 153E 7E mov a,m
3956 153F C601 adi 1
3957 1541 27 daa
3958 1542 77 mov m,a
3959 1543 23 inx h
3960

Page 66 of 86
B8080.LST 3/12/2560 20:43

3961 1544 7E mov a,m


3962 1545 CE00 aci 0
3963 1547 27 daa
3964 1548 77 mov m,a
3965 1549 23 inx h
3966 154A 7E mov a,m
3967 154B CE00 aci 0
3968 154D 27 daa
3969 154E 77 mov m,a
3970
3971 154F E1 pop h
3972
3973 1550 C9 ret
3974
3975 1551 E5 inc_bcd2: push h
3976
3977 1552 2144F0 lxi h,bcd_counter2
3978 1555 AF xra a
3979
3980 1556 7E mov a,m
3981 1557 C601 adi 1
3982 1559 27 daa
3983 155A 77 mov m,a
3984 155B 23 inx h
3985
3986 155C 7E mov a,m
3987 155D CE00 aci 0
3988 155F 27 daa
3989 1560 77 mov m,a
3990 1561 23 inx h
3991 1562 7E mov a,m
3992 1563 CE00 aci 0
3993 1565 27 daa
3994 1566 77 mov m,a
3995
3996 1567 E1 pop h
3997
3998 1568 C9 ret
3999
4000
4001 1569 print_bcd1:
4002 1569 2143F0 lxi h,bcd_counter1+2
4003 156C 7E mov a,m
4004 156D CD1513 call out2x
4005 1570 2142F0 lxi h,bcd_counter1+1
4006 1573 7E mov a,m
4007 1574 CD1513 call out2x
4008 1577 2141F0 lxi h,bcd_counter1
4009 157A 7E mov a,m
4010 157B CD1513 call out2x
4011 157E 21F51F lxi h,byte_text
4012 1581 CDAD12 call put_str
4013 1584 C9 ret
4014
4015 1585 210000 clear_bcd1: lxi h,0
4016 1588 2241F0 shld bcd_counter1
4017 158B 2242F0 shld bcd_counter1+1
4018 158E 2243F0 shld bcd_counter1+2
4019 1591 C9 ret
4020

Page 67 of 86
B8080.LST 3/12/2560 20:43

4021 1592 print_bcd2:


4022 1592 2146F0 lxi h,bcd_counter2+2
4023 1595 7E mov a,m
4024 1596 CD1513 call out2x
4025 1599 2145F0 lxi h,bcd_counter2+1
4026 159C 7E mov a,m
4027 159D CD1513 call out2x
4028 15A0 2144F0 lxi h,bcd_counter2
4029 15A3 7E mov a,m
4030 15A4 CD1513 call out2x
4031 15A7 21F51F lxi h,byte_text
4032 15AA CDAD12 call put_str
4033 15AD C9 ret
4034
4035 15AE 210000 clear_bcd2: lxi h,0
4036 15B1 2244F0 shld bcd_counter2
4037 15B4 2245F0 shld bcd_counter2+1
4038 15B7 2246F0 shld bcd_counter2+2
4039 15BA C9 ret
4040
4041 ; new function for key test
4042
4043 15BB 3EFF test_kit mvi a,0ffh
4044 15BD 3210F0 sta 0f010h
4045 15C0 3211F0 sta 0f011h
4046 15C3 3212F0 sta 0f012h
4047 15C6 3213F0 sta 0f013h
4048 15C9 3214F0 sta 0f014h
4049 15CC 3215F0 sta 0f015h
4050
4051
4052 15CF 1600 mvi d,0
4053 15D1 D5 loop1 push d
4054
4055 15D2 2110F0 lxi h,buffer ; display buffer
4056 15D5 CDAC0C call scan ; scan
4057
4058 15D8 D1 pop d
4059 15D9 15 dcr d
4060 15DA C2D115 jnz loop1
4061
4062 15DD 3EFF mvi a,0ffh
4063 15DF D300 out 0
4064
4065 15E1 CD3606 call beep_on ; call beep
4066
4067 15E4 3E00 mvi a,0
4068 15E6 D300 out 0
4069
4070 ; test if lcd connected
4071
4072 15E8 1600 chk_lcd mvi d,0
4073
4074 15EA repeat_chk_lcd
4075
4076 15EA DB82 in 82h ; command read LCD
4077
4078 15EC E680 ani 80h
4079 15EE CAF815 jz found_lcd
4080

Page 68 of 86
B8080.LST 3/12/2560 20:43

4081 15F1 15 dcr d


4082 15F2 C2EA15 jnz repeat_chk_lcd
4083 15F5 C30D16 jmp skip_test_lcd
4084
4085
4086 15F8 found_lcd
4087
4088 15F8 1E07 mvi e,7
4089 15FA CF rst 1 ; init lcd
4090
4091 15FB 21BB1E lxi h,prompt2
4092 15FE 1E0B mvi e,0bh
4093 1600 CF rst 1 ; print lcd
4094
4095 1601 210100 lxi h,1
4096 1604 1E0A mvi e,0ah
4097 1606 CF rst 1
4098 1607 21D31E lxi h,text3
4099 160A 1E0B mvi e,0bh
4100 160C CF rst 1
4101
4102 160D skip_test_lcd
4103
4104 ; test 10ms tick
4105
4106 160D 3EC3 mvi a,0c3h
4107 160F 323880 sta 8038h
4108 1612 3E20 mvi a,tick&0ffh
4109 1614 323980 sta 8039h
4110 1617 3E16 mvi a,tick>>8
4111 1619 323A80 sta 803ah
4112 161C FB ei
4113 161D C31D16 jmp $
4114
4115
4116 1620 3A00F0 tick lda 0f000h
4117 1623 3C inr a
4118 1624 3200F0 sta 0f000h
4119 1627 D300 out 0
4120 1629 FB ei
4121 162A C9 ret
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140

Page 69 of 86
B8080.LST 3/12/2560 20:43

4141
4142
4143
4144
4145
4146
4147
4148
4149
4150 ; constants
4151
4152 162B INS_TABLE:
4153
4154 162B 2B18 DWL C0 ; "NOP",TAB,RS ; 00
4155 162D 3018 DWL C1 ; "LXI",TAB,"B,",RS ; 01
4156 162F 3718 DWL C2 ; "STAX",TAB,"B",RS ; 02
4157 1631 3E18 DWL C3 ; "INX",TAB,"B",RS ; 03
4158 1633 4418 DWL C4 ; "INR",TAB,"B",RS ; 04
4159 1635 4A18 DWL C5 ; "DCR",TAB,"B",RS ; 05
4160 1637 5018 DWL C6 ; "MVI",TAB,"B,",RS ; 06
4161 1639 5718 DWL C7 ; "RLC",TAB,RS ; 07
4162 163B 5C18 DWL C8 ; "DFB",TAB,RS ; 08
4163 163D 6118 DWL C9 ; "DAD",TAB,"B",RS ; 09
4164 163F 6718 DWL CA ; "LDAX",TAB,"B",RS ; 0A
4165 1641 6E18 DWL CB ; "DCX",TAB,"B",RS ; 0B
4166 1643 7418 DWL CC ; "INR",TAB,"C",RS ; 0C
4167 1645 7A18 DWL CD ; "DCR",TAB,"C",RS ; 0D
4168 1647 8018 DWL CE ; "MVI",TAB,"C,",RS ; 0E
4169 1649 8718 DWL CF ; "RRC",TAB,RS ; 0F
4170 164B 8C18 DWL C10 ; "DFB",TAB,RS ; 10
4171 164D 9118 DWL C11 ; "LXI",TAB,"D,",RS ; 11
4172 164F 9818 DWL C12 ; "STAX",TAB,"D",RS ; 12
4173 1651 9F18 DWL C13 ; "INX",TAB,"D",RS ; 13
4174 1653 A518 DWL C14 ; "INR",TAB,"D",RS ; 14
4175 1655 AB18 DWL C15 ; "DCR",TAB,"D",RS ; 15
4176 1657 B118 DWL C16 ; "MVI",TAB,"D,",RS ; 16
4177 1659 B818 DWL C17 ; "RAL",TAB,RS ; 17
4178 165B BD18 DWL C18 ; "DFB",TAB,RS ; 18
4179 165D C218 DWL C19 ; "DAD",TAB,"D",RS ; 19
4180 165F C818 DWL C1A ; "LDAX",TAB,"D",RS ; 1A
4181 1661 CF18 DWL C1B ; "DCX",TAB,"D",RS ; 1B
4182 1663 D518 DWL C1C ; "INR",TAB,"E",RS ; 1C
4183 1665 DB18 DWL C1D ; "DCR",TAB,"E",RS ; 1D
4184 1667 E118 DWL C1E ; "MVI",TAB,"E,",RS ; 1E
4185 1669 E818 DWL C1F ; "RAR",TAB,RS ; 1F
4186 166B ED18 DWL C20 ; "RIM",TAB,RS ; 20
4187 166D F218 DWL C21 ; "LXI",TAB,"H,",RS ; 21
4188 166F F918 DWL C22 ; "SHLD",TAB,RS ; 22
4189 1671 FF18 DWL C23 ; "INX",TAB,"H",RS ; 23
4190 1673 0519 DWL C24 ; "INR",TAB,"H",RS ; 24
4191 1675 0B19 DWL C25 ; "DCR",TAB,"H",RS ; 25
4192 1677 1119 DWL C26 ; "MVI",TAB,"H,",RS ; 26
4193 1679 1819 DWL C27 ; "DAA",TAB,RS ; 27
4194 167B 1D19 DWL C28 ; "DFB",TAB,RS ; 28
4195 167D 2219 DWL C29 ; "DAD",TAB,"H",RS ; 29
4196 167F 2819 DWL C2A ; "LHLD",TAB,RS ; 2A
4197 1681 2E19 DWL C2B ; "DCX",TAB,"H",RS ; 2B
4198 1683 3419 DWL C2C ; "INR",TAB,"L",RS ; 2C
4199 1685 3A19 DWL C2D ; "DCR",TAB,"L",RS ; 2D
4200 1687 4019 DWL C2E ; "MVI",TAB,"L,",RS ; 2E

Page 70 of 86
B8080.LST 3/12/2560 20:43

4201 1689 4719 DWL C2F ; "CMA",TAB,RS ; 2F


4202 168B 4C19 DWL C30 ; "SIM",TAB,RS ; 30
4203 168D 5119 DWL C31 ; "LXI",TAB,"SP,",RS ; 31
4204 168F 5919 DWL C32 ; "STA",TAB,RS ; 32
4205 1691 5E19 DWL C33 ; "INX",TAB,"SP",RS ; 33
4206 1693 6519 DWL C34 ; "INR",TAB,"M",RS ; 34
4207 1695 6B19 DWL C35 ; "DCR",TAB,"M",RS ; 35
4208 1697 7119 DWL C36 ; "MVI",TAB,"M,",RS ; 36
4209 1699 7819 DWL C37 ; "STC",TAB,RS ; 37
4210 169B 7D19 DWL C38 ; "DFB",TAB,RS ; 38
4211 169D 8219 DWL C39 ; "DAD",TAB,"SP",RS ; 39
4212 169F 8919 DWL C3A ; "LDA",TAB,RS ; 3A
4213 16A1 8E19 DWL C3B ; "DCX",TAB,"SP",RS ; 3B
4214 16A3 9519 DWL C3C ; "INR",TAB,"A",RS ; 3C
4215 16A5 9B19 DWL C3D ; "DCR",TAB,"A",RS ; 3D
4216 16A7 A119 DWL C3E ; "MVI",TAB,"A,",RS ; 3E
4217 16A9 A819 DWL C3F ; "CMC",TAB,RS ; 3F
4218 16AB AD19 DWL C40 ; "MOV",TAB,"B,B",RS ; 40
4219 16AD B519 DWL C41 ; "MOV",TAB,"B,C",RS ; 41
4220 16AF BD19 DWL C42 ; "MOV",TAB,"B,D",RS ; 42
4221 16B1 C519 DWL C43 ; "MOV",TAB,"B,E",RS ; 43
4222 16B3 CD19 DWL C44 ; "MOV",TAB,"B,H",RS ; 44
4223 16B5 D519 DWL C45 ; "MOV",TAB,"B,L",RS ; 45
4224 16B7 DD19 DWL C46 ; "MOV",TAB,"B,M",RS ; 46
4225 16B9 E519 DWL C47 ; "MOV",TAB,"B,A",RS ; 47
4226 16BB ED19 DWL C48 ; "MOV",TAB,"C,B",RS ; 48
4227 16BD F519 DWL C49 ; "MOV",TAB,"C,C",RS ; 49
4228 16BF FD19 DWL C4A ; "MOV",TAB,"C,D",RS ; 4A
4229 16C1 051A DWL C4B ; "MOV",TAB,"C,E",RS ; 4B
4230 16C3 0D1A DWL C4C ; "MOV",TAB,"C,H",RS ; 4C
4231 16C5 151A DWL C4D ; "MOV",TAB,"C,L",RS ; 4D
4232 16C7 1D1A DWL C4E ; "MOV",TAB,"C,M",RS ; 4E
4233 16C9 251A DWL C4F ; "MOV",TAB,"C,A",RS ; 4F
4234 16CB 2D1A DWL C50 ; "MOV",TAB,"D,B",RS ; 50
4235 16CD 351A DWL C51 ; "MOV",TAB,"D,C",RS ; 51
4236 16CF 3D1A DWL C52 ; "MOV",TAB,"D,D",RS ; 52
4237 16D1 451A DWL C53 ; "MOV",TAB,"D,E",RS ; 53
4238 16D3 4D1A DWL C54 ; "MOV",TAB,"D,H",RS ; 54
4239 16D5 551A DWL C55 ; "MOV",TAB,"D,L",RS ; 55
4240 16D7 5D1A DWL C56 ; "MOV",TAB,"D,M",RS ; 56
4241 16D9 651A DWL C57 ; "MOV",TAB,"D,A",RS ; 57
4242 16DB 6D1A DWL C58 ; "MOV",TAB,"E,B",RS ; 58
4243 16DD 751A DWL C59 ; "MOV",TAB,"E,C",RS ; 59
4244 16DF 7D1A DWL C5A ; "MOV",TAB,"E,D",RS ; 5A
4245 16E1 851A DWL C5B ; "MOV",TAB,"E,E",RS ; 5B
4246 16E3 8D1A DWL C5C ; "MOV",TAB,"E,H",RS ; 5C
4247 16E5 951A DWL C5D ; "MOV",TAB,"E,L",RS ; 5D
4248 16E7 9D1A DWL C5E ; "MOV",TAB,"E,M",RS ; 5E
4249 16E9 A51A DWL C5F ; "MOV",TAB,"E,A",RS ; 5F
4250 16EB AD1A DWL C60 ; "MOV",TAB,"H,B",RS ; 60
4251 16ED B51A DWL C61 ; "MOV",TAB,"H,C",RS ; 61
4252 16EF BD1A DWL C62 ; "MOV",TAB,"H,D",RS ; 62
4253 16F1 C51A DWL C63 ; "MOV",TAB,"H,E",RS ; 63
4254 16F3 CD1A DWL C64 ; "MOV",TAB,"H,H",RS ; 64
4255 16F5 D51A DWL C65 ; "MOV",TAB,"H,L",RS ; 65
4256 16F7 DD1A DWL C66 ; "MOV",TAB,"H,M",RS ; 66
4257 16F9 E51A DWL C67 ; "MOV",TAB,"H,A",RS ; 67
4258 16FB ED1A DWL C68 ; "MOV",TAB,"L,B",RS ; 68
4259 16FD F51A DWL C69 ; "MOV",TAB,"L,C",RS ; 69
4260 16FF FD1A DWL C6A ; "MOV",TAB,"L,D",RS ; 6A

Page 71 of 86
B8080.LST 3/12/2560 20:43

4261 1701 051B DWL C6B ; "MOV",TAB,"L,E",RS ; 6B


4262 1703 0D1B DWL C6C ; "MOV",TAB,"L,H",RS ; 6C
4263 1705 151B DWL C6D ; "MOV",TAB,"L,L",RS ; 6D
4264 1707 1D1B DWL C6E ; "MOV",TAB,"L,M",RS ; 6E
4265 1709 251B DWL C6F ; "MOV",TAB,"L,A",RS ; 6F
4266 170B 2D1B DWL C70 ; "MOV",TAB,"M,B",RS ; 70
4267 170D 351B DWL C71 ; "MOV",TAB,"M,C",RS ; 71
4268 170F 3D1B DWL C72 ; "MOV",TAB,"M,D",RS ; 72
4269 1711 451B DWL C73 ; "MOV",TAB,"M,E",RS ; 73
4270 1713 4D1B DWL C74 ; "MOV",TAB,"M,H",RS ; 74
4271 1715 551B DWL C75 ; "MOV",TAB,"M,L",RS ; 75
4272 1717 5D1B DWL C76 ; "HLT",TAB,RS ; 76
4273 1719 621B DWL C77 ; "MOV",TAB,"M,A",RS ; 77
4274 171B 6A1B DWL C78 ; "MOV",TAB,"A,B",RS ; 78
4275 171D 721B DWL C79 ; "MOV",TAB,"A,C",RS ; 79
4276 171F 7A1B DWL C7A ; "MOV",TAB,"A,D",RS ; 7A
4277 1721 821B DWL C7B ; "MOV",TAB,"A,E",RS ; 7B
4278 1723 8A1B DWL C7C ; "MOV",TAB,"A,H",RS ; 7C
4279 1725 921B DWL C7D ; "MOV",TAB,"A,L",RS ; 7D
4280 1727 9A1B DWL C7E ; "MOV",TAB,"A,M",RS ; 7E
4281 1729 A21B DWL C7F ; "MOV",TAB,"A,A",RS ; 7F
4282 172B AA1B DWL C80 ; "ADD",TAB,"B",RS ; 80
4283 172D B01B DWL C81 ; "ADD",TAB,"C",RS ; 81
4284 172F B61B DWL C82 ; "ADD",TAB,"D",RS ; 82
4285 1731 BC1B DWL C83 ; "ADD",TAB,"E",RS ; 83
4286 1733 C21B DWL C84 ; "ADD",TAB,"H",RS ; 84
4287 1735 C81B DWL C85 ; "ADD",TAB,"L",RS ; 85
4288 1737 CE1B DWL C86 ; "ADD",TAB,"M",RS ; 86
4289 1739 D41B DWL C87 ; "ADD",TAB,"A",RS ; 87
4290 173B DA1B DWL C88 ; "ADC",TAB,"B",RS ; 88
4291 173D E01B DWL C89 ; "ADC",TAB,"C",RS ; 89
4292 173F E61B DWL C8A ; "ADC",TAB,"D",RS ; 8A
4293 1741 EC1B DWL C8B ; "ADC",TAB,"E",RS ; 8B
4294 1743 F21B DWL C8C ; "ADC",TAB,"H",RS ; 8C
4295 1745 F81B DWL C8D ; "ADC",TAB,"L",RS ; 8D
4296 1747 FE1B DWL C8E ; "ADC",TAB,"M",RS ; 8E
4297 1749 041C DWL C8F ; "ADC",TAB,"A",RS ; 8F
4298 174B 0A1C DWL C90 ; "SUB",TAB,"B",RS ; 90
4299 174D 101C DWL C91 ; "SUB",TAB,"C",RS ; 91
4300 174F 161C DWL C92 ; "SUB",TAB,"D",RS ; 92
4301 1751 1C1C DWL C93 ; "SUB",TAB,"E",RS ; 93
4302 1753 221C DWL C94 ; "SUB",TAB,"H",RS ; 94
4303 1755 281C DWL C95 ; "SUB",TAB,"L",RS ; 95
4304 1757 2E1C DWL C96 ; "SUB",TAB,"M",RS ; 96
4305 1759 341C DWL C97 ; "SUB",TAB,"A",RS ; 97
4306 175B 3A1C DWL C98 ; "SBB",TAB,"B",RS ; 98
4307 175D 401C DWL C99 ; "SBB",TAB,"C",RS ; 99
4308 175F 461C DWL C9A ; "SBB",TAB,"D",RS ; 9A
4309 1761 4C1C DWL C9B ; "SBB",TAB,"E",RS ; 9B
4310 1763 521C DWL C9C ; "SBB",TAB,"H",RS ; 9C
4311 1765 581C DWL C9D ; "SBB",TAB,"L",RS ; 9D
4312 1767 5E1C DWL C9E ; "SBB",TAB,"M",RS ; 9E
4313 1769 641C DWL C9F ; "SBB",TAB,"A",RS ; 9F
4314 176B 6A1C DWL CA0 ; "ANA",TAB,"B",RS ; A0
4315 176D 701C DWL CA1 ; "ANA",TAB,"C",RS ; A1
4316 176F 761C DWL CA2 ; "ANA",TAB,"D",RS ; A2
4317 1771 7C1C DWL CA3 ; "ANA",TAB,"E",RS ; A3
4318 1773 821C DWL CA4 ; "ANA",TAB,"H",RS ; A4
4319 1775 881C DWL CA5 ; "ANA",TAB,"L",RS ; A5
4320 1777 8E1C DWL CA6 ; "ANA",TAB,"M",RS ; A6

Page 72 of 86
B8080.LST 3/12/2560 20:43

4321 1779 941C DWL CA7 ; "ANA",TAB,"A",RS ; A7


4322 177B 9A1C DWL CA8 ; "XRA",TAB,"B",RS ; A8
4323 177D A01C DWL CA9 ; "XRA",TAB,"C",RS ; A9
4324 177F A61C DWL CAA ; "XRA",TAB,"D",RS ; AA
4325 1781 AC1C DWL CAB ; "XRA",TAB,"E",RS ; AB
4326 1783 B21C DWL CAC ; "XRA",TAB,"H",RS ; AC
4327 1785 B81C DWL CAD ; "XRA",TAB,"L",RS ; AD
4328 1787 BE1C DWL CAE ; "XRA",TAB,"M",RS ; AE
4329 1789 C41C DWL CAF ; "XRA",TAB,"A",RS ; AF
4330 178B CA1C DWL CB0 ; "ORA",TAB,"B",RS ; B0
4331 178D D01C DWL CB1 ; "ORA",TAB,"C",RS ; B1
4332 178F D61C DWL CB2 ; "ORA",TAB,"D",RS ; B2
4333 1791 DC1C DWL CB3 ; "ORA",TAB,"E",RS ; B3
4334 1793 E21C DWL CB4 ; "ORA",TAB,"H",RS ; B4
4335 1795 E81C DWL CB5 ; "ORA",TAB,"L",RS ; B5
4336 1797 EE1C DWL CB6 ; "ORA",TAB,"M",RS ; B6
4337 1799 F41C DWL CB7 ; "ORA",TAB,"A",RS ; B7
4338 179B FA1C DWL CB8 ; "CMP",TAB,"B",RS ; B8
4339 179D 001D DWL CB9 ; "CMP",TAB,"C",RS ; B9
4340 179F 061D DWL CBA ; "CMP",TAB,"D",RS ; BA
4341 17A1 0C1D DWL CBB ; "CMP",TAB,"E",RS ; BB
4342 17A3 121D DWL CBC ; "CMP",TAB,"H",RS ; BC
4343 17A5 181D DWL CBD ; "CMP",TAB,"L",RS ; BD
4344 17A7 1E1D DWL CBE ; "CMP",TAB,"M",RS ; BE
4345 17A9 241D DWL CBF ; "CMP",TAB,"A",RS ; BF
4346 17AB 2A1D DWL CC0 ; "RNZ",TAB,RS ; C0
4347 17AD 2F1D DWL CC1 ; "POP",TAB,"B",RS ; C1
4348 17AF 351D DWL CC2 ; "JNZ",TAB,RS ; C2
4349 17B1 3A1D DWL CC3 ; "JMP",TAB,RS ; C3
4350 17B3 3F1D DWL CC4 ; "CNZ",TAB,RS ; C4
4351 17B5 441D DWL CC5 ; "PUSH",TAB,"B",RS ; C5
4352 17B7 4B1D DWL CC6 ; "ADI",TAB,RS ; C6
4353 17B9 501D DWL CC7 ; "RST",TAB,"0",RS ; C7
4354 17BB 561D DWL CC8 ; "RZ",TAB,RS ; C8
4355 17BD 5A1D DWL CC9 ; "RET",TAB,RS ; C9
4356 17BF 5F1D DWL CCA ; "JZ",TAB,RS ; CA
4357 17C1 631D DWL CCB ; "DFB",TAB,RS ; CB
4358 17C3 681D DWL CCC ; "CZ",TAB,RS ; CC
4359 17C5 6C1D DWL CCD ; "CALL",TAB,RS ; CD
4360 17C7 721D DWL CCE ; "ACI",TAB,RS ; CE
4361 17C9 771D DWL CCF ; "RST",TAB,"1",RS ; CF
4362 17CB 7D1D DWL CD0 ; "RNC",TAB,RS ; D0
4363 17CD 821D DWL CD1 ; "POP",TAB,"D",RS ; D1
4364 17CF 881D DWL CD2 ; "JNC",TAB,RS ; D2
4365 17D1 8D1D DWL CD3 ; "OUT",TAB,RS ; D3
4366 17D3 921D DWL CD4 ; "CNC",TAB,RS ; D4
4367 17D5 971D DWL CD5 ; "PUSH",TAB,"D",RS ; D5
4368 17D7 9E1D DWL CD6 ; "SUI",TAB,RS ; D6
4369 17D9 A31D DWL CD7 ; "RST",TAB,"2",RS ; D7
4370 17DB A91D DWL CD8 ; "RC",TAB,RS ; D8
4371 17DD AD1D DWL CD9 ; "DFB",TAB,RS ; D9
4372 17DF B21D DWL CDA ; "JC",TAB,RS ; DA
4373 17E1 B61D DWL CDB ; "IN",TAB,RS ; DFB
4374 17E3 BA1D DWL CDC ; "CC",TAB,RS ; DC
4375 17E5 BE1D DWL CDD ; "DFB",TAB,RS ; DD
4376 17E7 C31D DWL CDE ; "SBI",TAB,RS ; DE
4377 17E9 C81D DWL CDF ; "RST",TAB,"3",RS ; DF
4378 17EB CE1D DWL CE0 ; "RPO",TAB,RS ; E0
4379 17ED D31D DWL CE1 ; "POP",TAB,"H",RS ; E1
4380 17EF D91D DWL CE2 ; "JPO",TAB,RS ; E2

Page 73 of 86
B8080.LST 3/12/2560 20:43

4381 17F1 DE1D DWL CE3 ; "XTHL",TAB,RS ; E3


4382 17F3 E41D DWL CE4 ; "CPO",TAB,RS ; E4
4383 17F5 E91D DWL CE5 ; "PUSH",TAB,"H",RS ; E5
4384 17F7 F01D DWL CE6 ; "ANI",TAB,RS ; E6
4385 17F9 F51D DWL CE7 ; "RST",TAB,"4",RS ; E7
4386 17FB FB1D DWL CE8 ; "RPE",TAB,RS ; E8
4387 17FD 001E DWL CE9 ; "PCHL",TAB,RS ; E9
4388 17FF 061E DWL CEA ; "JPE",TAB,RS ; EA
4389 1801 0B1E DWL CEB ; "XCHG",TAB,RS ; EB
4390 1803 111E DWL CEC ; "CPE",TAB,RS ; EC
4391 1805 161E DWL CED ; "DFB",TAB,RS ; ED
4392 1807 1B1E DWL CEE ; "XRI",TAB,RS ; EE
4393 1809 201E DWL CEF ; "RST",TAB,"5",RS ; EF
4394 180B 261E DWL CF0 ; "RP",TAB,RS ; F0
4395 180D 2A1E DWL CF1 ; "POP",TAB,"PSW",RS ; F1
4396 180F 321E DWL CF2 ; "JP",TAB,RS ; F2
4397 1811 361E DWL CF3 ; "DI",TAB,RS ; F3
4398 1813 3A1E DWL CF4 ; "CP",TAB,RS ; F4
4399 1815 3E1E DWL CF5 ; "PUSH",TAB,"PSW",RS ; F5
4400 1817 471E DWL CF6 ; "ORI",TAB,RS ; F6
4401 1819 4C1E DWL CF7 ; "RST",TAB,"6",RS ; F7
4402 181B 521E DWL CF8 ; "RM",TAB,RS ; F8
4403 181D 561E DWL CF9 ; "SPHL",TAB,RS ; F9
4404 181F 5C1E DWL CFA ; "JM",TAB,RS ; FA
4405 1821 601E DWL CFB ; "EI",TAB,RS ; FB
4406 1823 641E DWL CFC ; "CM",TAB,RS ; FC
4407 1825 681E DWL CFD ; "DFB",TAB,RS ; FD
4408 1827 6D1E DWL CFE ; "CPI",TAB,RS ; FE
4409 1829 721E DWL CFF ; "RST",TAB,"7",RS, ; FF
4410
4411 ; --------- mnemonic table ----------------------------------
4412
4413
4414 182B MNEM
4415 182B 4E4F500900C0 DFB "NOP",TAB,RS ; 00
4416 1830 4C58490942C1 DFB "LXI",TAB,"B,",RS ; 01
4417 1837 5354415809C2 DFB "STAX",TAB,"B",RS ; 02
4418 183E 494E580942C3 DFB "INX",TAB,"B",RS ; 03
4419 1844 494E520942C4 DFB "INR",TAB,"B",RS ; 04
4420 184A 4443520942C5 DFB "DCR",TAB,"B",RS ; 05
4421 1850 4D56490942C6 DFB "MVI",TAB,"B,",RS ; 06
4422 1857 524C430900C7 DFB "RLC",TAB,RS ; 07
4423 185C 4446420900C8 DFB "DFB",TAB,RS ; 08
4424 1861 4441440942C9 DFB "DAD",TAB,"B",RS ; 09
4425 1867 4C44415809CA DFB "LDAX",TAB,"B",RS ; 0A
4426 186E 4443580942CB DFB "DCX",TAB,"B",RS ; 0B
4427 1874 494E520943CC DFB "INR",TAB,"C",RS ; 0C
4428 187A 4443520943CD DFB "DCR",TAB,"C",RS ; 0D
4429 1880 4D56490943CE DFB "MVI",TAB,"C,",RS ; 0E
4430 1887 5252430900CF DFB "RRC",TAB,RS ; 0F
4431 188C 4446420900C10 DFB "DFB",TAB,RS ; 10
4432 1891 4C58490944C11 DFB "LXI",TAB,"D,",RS ; 11
4433 1898 5354415809C12 DFB "STAX",TAB,"D",RS ; 12
4434 189F 494E580944C13 DFB "INX",TAB,"D",RS ; 13
4435 18A5 494E520944C14 DFB "INR",TAB,"D",RS ; 14
4436 18AB 4443520944C15 DFB "DCR",TAB,"D",RS ; 15
4437 18B1 4D56490944C16 DFB "MVI",TAB,"D,",RS ; 16
4438 18B8 52414C0900C17 DFB "RAL",TAB,RS ; 17
4439 18BD 4446420900C18 DFB "DFB",TAB,RS ; 18
4440 18C2 4441440944C19 DFB "DAD",TAB,"D",RS ; 19

Page 74 of 86
B8080.LST 3/12/2560 20:43

4441 18C8 4C44415809C1A DFB "LDAX",TAB,"D",RS ; 1A


4442 18CF 4443580944C1B DFB "DCX",TAB,"D",RS ; 1B
4443 18D5 494E520945C1C DFB "INR",TAB,"E",RS ; 1C
4444 18DB 4443520945C1D DFB "DCR",TAB,"E",RS ; 1D
4445 18E1 4D56490945C1E DFB "MVI",TAB,"E,",RS ; 1E
4446 18E8 5241520900C1F DFB "RAR",TAB,RS ; 1F
4447 18ED 52494D0900C20 DFB "RIM",TAB,RS ; 20
4448 18F2 4C58490948C21 DFB "LXI",TAB,"H,",RS ; 21
4449 18F9 53484C4409C22 DFB "SHLD",TAB,RS ; 22
4450 18FF 494E580948C23 DFB "INX",TAB,"H",RS ; 23
4451 1905 494E520948C24 DFB "INR",TAB,"H",RS ; 24
4452 190B 4443520948C25 DFB "DCR",TAB,"H",RS ; 25
4453 1911 4D56490948C26 DFB "MVI",TAB,"H,",RS ; 26
4454 1918 4441410900C27 DFB "DAA",TAB,RS ; 27
4455 191D 4446420900C28 DFB "DFB",TAB,RS ; 28
4456 1922 4441440948C29 DFB "DAD",TAB,"H",RS ; 29
4457 1928 4C484C4409C2A DFB "LHLD",TAB,RS ; 2A
4458 192E 4443580948C2B DFB "DCX",TAB,"H",RS ; 2B
4459 1934 494E52094CC2C DFB "INR",TAB,"L",RS ; 2C
4460 193A 444352094CC2D DFB "DCR",TAB,"L",RS ; 2D
4461 1940 4D5649094CC2E DFB "MVI",TAB,"L,",RS ; 2E
4462 1947 434D410900C2F DFB "CMA",TAB,RS ; 2F
4463 194C 53494D0900C30 DFB "SIM",TAB,RS ; 30
4464 1951 4C58490953C31 DFB "LXI",TAB,"SP,",RS ; 31
4465 1959 5354410900C32 DFB "STA",TAB,RS ; 32
4466 195E 494E580953C33 DFB "INX",TAB,"SP",RS ; 33
4467 1965 494E52094DC34 DFB "INR",TAB,"M",RS ; 34
4468 196B 444352094DC35 DFB "DCR",TAB,"M",RS ; 35
4469 1971 4D5649094DC36 DFB "MVI",TAB,"M,",RS ; 36
4470 1978 5354430900C37 DFB "STC",TAB,RS ; 37
4471 197D 4446420900C38 DFB "DFB",TAB,RS ; 38
4472 1982 4441440953C39 DFB "DAD",TAB,"SP",RS ; 39
4473 1989 4C44410900C3A DFB "LDA",TAB,RS ; 3A
4474 198E 4443580953C3B DFB "DCX",TAB,"SP",RS ; 3B
4475 1995 494E520941C3C DFB "INR",TAB,"A",RS ; 3C
4476 199B 4443520941C3D DFB "DCR",TAB,"A",RS ; 3D
4477 19A1 4D56490941C3E DFB "MVI",TAB,"A,",RS ; 3E
4478 19A8 434D430900C3F DFB "CMC",TAB,RS ; 3F
4479 19AD 4D4F560942C40 DFB "MOV",TAB,"B,B",RS ; 40
4480 19B5 4D4F560942C41 DFB "MOV",TAB,"B,C",RS ; 41
4481 19BD 4D4F560942C42 DFB "MOV",TAB,"B,D",RS ; 42
4482 19C5 4D4F560942C43 DFB "MOV",TAB,"B,E",RS ; 43
4483 19CD 4D4F560942C44 DFB "MOV",TAB,"B,H",RS ; 44
4484 19D5 4D4F560942C45 DFB "MOV",TAB,"B,L",RS ; 45
4485 19DD 4D4F560942C46 DFB "MOV",TAB,"B,M",RS ; 46
4486 19E5 4D4F560942C47 DFB "MOV",TAB,"B,A",RS ; 47
4487 19ED 4D4F560943C48 DFB "MOV",TAB,"C,B",RS ; 48
4488 19F5 4D4F560943C49 DFB "MOV",TAB,"C,C",RS ; 49
4489 19FD 4D4F560943C4A DFB "MOV",TAB,"C,D",RS ; 4A
4490 1A05 4D4F560943C4B DFB "MOV",TAB,"C,E",RS ; 4B
4491 1A0D 4D4F560943C4C DFB "MOV",TAB,"C,H",RS ; 4C
4492 1A15 4D4F560943C4D DFB "MOV",TAB,"C,L",RS ; 4D
4493 1A1D 4D4F560943C4E DFB "MOV",TAB,"C,M",RS ; 4E
4494 1A25 4D4F560943C4F DFB "MOV",TAB,"C,A",RS ; 4F
4495 1A2D 4D4F560944C50 DFB "MOV",TAB,"D,B",RS ; 50
4496 1A35 4D4F560944C51 DFB "MOV",TAB,"D,C",RS ; 51
4497 1A3D 4D4F560944C52 DFB "MOV",TAB,"D,D",RS ; 52
4498 1A45 4D4F560944C53 DFB "MOV",TAB,"D,E",RS ; 53
4499 1A4D 4D4F560944C54 DFB "MOV",TAB,"D,H",RS ; 54
4500 1A55 4D4F560944C55 DFB "MOV",TAB,"D,L",RS ; 55

Page 75 of 86
B8080.LST 3/12/2560 20:43

4501 1A5D 4D4F560944C56 DFB "MOV",TAB,"D,M",RS ; 56


4502 1A65 4D4F560944C57 DFB "MOV",TAB,"D,A",RS ; 57
4503 1A6D 4D4F560945C58 DFB "MOV",TAB,"E,B",RS ; 58
4504 1A75 4D4F560945C59 DFB "MOV",TAB,"E,C",RS ; 59
4505 1A7D 4D4F560945C5A DFB "MOV",TAB,"E,D",RS ; 5A
4506 1A85 4D4F560945C5B DFB "MOV",TAB,"E,E",RS ; 5B
4507 1A8D 4D4F560945C5C DFB "MOV",TAB,"E,H",RS ; 5C
4508 1A95 4D4F560945C5D DFB "MOV",TAB,"E,L",RS ; 5D
4509 1A9D 4D4F560945C5E DFB "MOV",TAB,"E,M",RS ; 5E
4510 1AA5 4D4F560945C5F DFB "MOV",TAB,"E,A",RS ; 5F
4511 1AAD 4D4F560948C60 DFB "MOV",TAB,"H,B",RS ; 60
4512 1AB5 4D4F560948C61 DFB "MOV",TAB,"H,C",RS ; 61
4513 1ABD 4D4F560948C62 DFB "MOV",TAB,"H,D",RS ; 62
4514 1AC5 4D4F560948C63 DFB "MOV",TAB,"H,E",RS ; 63
4515 1ACD 4D4F560948C64 DFB "MOV",TAB,"H,H",RS ; 64
4516 1AD5 4D4F560948C65 DFB "MOV",TAB,"H,L",RS ; 65
4517 1ADD 4D4F560948C66 DFB "MOV",TAB,"H,M",RS ; 66
4518 1AE5 4D4F560948C67 DFB "MOV",TAB,"H,A",RS ; 67
4519 1AED 4D4F56094CC68 DFB "MOV",TAB,"L,B",RS ; 68
4520 1AF5 4D4F56094CC69 DFB "MOV",TAB,"L,C",RS ; 69
4521 1AFD 4D4F56094CC6A DFB "MOV",TAB,"L,D",RS ; 6A
4522 1B05 4D4F56094CC6B DFB "MOV",TAB,"L,E",RS ; 6B
4523 1B0D 4D4F56094CC6C DFB "MOV",TAB,"L,H",RS ; 6C
4524 1B15 4D4F56094CC6D DFB "MOV",TAB,"L,L",RS ; 6D
4525 1B1D 4D4F56094CC6E DFB "MOV",TAB,"L,M",RS ; 6E
4526 1B25 4D4F56094CC6F DFB "MOV",TAB,"L,A",RS ; 6F
4527 1B2D 4D4F56094DC70 DFB "MOV",TAB,"M,B",RS ; 70
4528 1B35 4D4F56094DC71 DFB "MOV",TAB,"M,C",RS ; 71
4529 1B3D 4D4F56094DC72 DFB "MOV",TAB,"M,D",RS ; 72
4530 1B45 4D4F56094DC73 DFB "MOV",TAB,"M,E",RS ; 73
4531 1B4D 4D4F56094DC74 DFB "MOV",TAB,"M,H",RS ; 74
4532 1B55 4D4F56094DC75 DFB "MOV",TAB,"M,L",RS ; 75
4533 1B5D 484C540900C76 DFB "HLT",TAB,RS ; 76
4534 1B62 4D4F56094DC77 DFB "MOV",TAB,"M,A",RS ; 77
4535 1B6A 4D4F560941C78 DFB "MOV",TAB,"A,B",RS ; 78
4536 1B72 4D4F560941C79 DFB "MOV",TAB,"A,C",RS ; 79
4537 1B7A 4D4F560941C7A DFB "MOV",TAB,"A,D",RS ; 7A
4538 1B82 4D4F560941C7B DFB "MOV",TAB,"A,E",RS ; 7B
4539 1B8A 4D4F560941C7C DFB "MOV",TAB,"A,H",RS ; 7C
4540 1B92 4D4F560941C7D DFB "MOV",TAB,"A,L",RS ; 7D
4541 1B9A 4D4F560941C7E DFB "MOV",TAB,"A,M",RS ; 7E
4542 1BA2 4D4F560941C7F DFB "MOV",TAB,"A,A",RS ; 7F
4543 1BAA 4144440942C80 DFB "ADD",TAB,"B",RS ; 80
4544 1BB0 4144440943C81 DFB "ADD",TAB,"C",RS ; 81
4545 1BB6 4144440944C82 DFB "ADD",TAB,"D",RS ; 82
4546 1BBC 4144440945C83 DFB "ADD",TAB,"E",RS ; 83
4547 1BC2 4144440948C84 DFB "ADD",TAB,"H",RS ; 84
4548 1BC8 414444094CC85 DFB "ADD",TAB,"L",RS ; 85
4549 1BCE 414444094DC86 DFB "ADD",TAB,"M",RS ; 86
4550 1BD4 4144440941C87 DFB "ADD",TAB,"A",RS ; 87
4551 1BDA 4144430942C88 DFB "ADC",TAB,"B",RS ; 88
4552 1BE0 4144430943C89 DFB "ADC",TAB,"C",RS ; 89
4553 1BE6 4144430944C8A DFB "ADC",TAB,"D",RS ; 8A
4554 1BEC 4144430945C8B DFB "ADC",TAB,"E",RS ; 8B
4555 1BF2 4144430948C8C DFB "ADC",TAB,"H",RS ; 8C
4556 1BF8 414443094CC8D DFB "ADC",TAB,"L",RS ; 8D
4557 1BFE 414443094DC8E DFB "ADC",TAB,"M",RS ; 8E
4558 1C04 4144430941C8F DFB "ADC",TAB,"A",RS ; 8F
4559 1C0A 5355420942C90 DFB "SUB",TAB,"B",RS ; 90
4560 1C10 5355420943C91 DFB "SUB",TAB,"C",RS ; 91

Page 76 of 86
B8080.LST 3/12/2560 20:43

4561 1C16 5355420944C92 DFB "SUB",TAB,"D",RS ; 92


4562 1C1C 5355420945C93 DFB "SUB",TAB,"E",RS ; 93
4563 1C22 5355420948C94 DFB "SUB",TAB,"H",RS ; 94
4564 1C28 535542094CC95 DFB "SUB",TAB,"L",RS ; 95
4565 1C2E 535542094DC96 DFB "SUB",TAB,"M",RS ; 96
4566 1C34 5355420941C97 DFB "SUB",TAB,"A",RS ; 97
4567 1C3A 5342420942C98 DFB "SBB",TAB,"B",RS ; 98
4568 1C40 5342420943C99 DFB "SBB",TAB,"C",RS ; 99
4569 1C46 5342420944C9A DFB "SBB",TAB,"D",RS ; 9A
4570 1C4C 5342420945C9B DFB "SBB",TAB,"E",RS ; 9B
4571 1C52 5342420948C9C DFB "SBB",TAB,"H",RS ; 9C
4572 1C58 534242094CC9D DFB "SBB",TAB,"L",RS ; 9D
4573 1C5E 534242094DC9E DFB "SBB",TAB,"M",RS ; 9E
4574 1C64 5342420941C9F DFB "SBB",TAB,"A",RS ; 9F
4575 1C6A 414E410942CA0 DFB "ANA",TAB,"B",RS ; A0
4576 1C70 414E410943CA1 DFB "ANA",TAB,"C",RS ; A1
4577 1C76 414E410944CA2 DFB "ANA",TAB,"D",RS ; A2
4578 1C7C 414E410945CA3 DFB "ANA",TAB,"E",RS ; A3
4579 1C82 414E410948CA4 DFB "ANA",TAB,"H",RS ; A4
4580 1C88 414E41094CCA5 DFB "ANA",TAB,"L",RS ; A5
4581 1C8E 414E41094DCA6 DFB "ANA",TAB,"M",RS ; A6
4582 1C94 414E410941CA7 DFB "ANA",TAB,"A",RS ; A7
4583 1C9A 5852410942CA8 DFB "XRA",TAB,"B",RS ; A8
4584 1CA0 5852410943CA9 DFB "XRA",TAB,"C",RS ; A9
4585 1CA6 5852410944CAA DFB "XRA",TAB,"D",RS ; AA
4586 1CAC 5852410945CAB DFB "XRA",TAB,"E",RS ; AB
4587 1CB2 5852410948CAC DFB "XRA",TAB,"H",RS ; AC
4588 1CB8 585241094CCAD DFB "XRA",TAB,"L",RS ; AD
4589 1CBE 585241094DCAE DFB "XRA",TAB,"M",RS ; AE
4590 1CC4 5852410941CAF DFB "XRA",TAB,"A",RS ; AF
4591 1CCA 4F52410942CB0 DFB "ORA",TAB,"B",RS ; B0
4592 1CD0 4F52410943CB1 DFB "ORA",TAB,"C",RS ; B1
4593 1CD6 4F52410944CB2 DFB "ORA",TAB,"D",RS ; B2
4594 1CDC 4F52410945CB3 DFB "ORA",TAB,"E",RS ; B3
4595 1CE2 4F52410948CB4 DFB "ORA",TAB,"H",RS ; B4
4596 1CE8 4F5241094CCB5 DFB "ORA",TAB,"L",RS ; B5
4597 1CEE 4F5241094DCB6 DFB "ORA",TAB,"M",RS ; B6
4598 1CF4 4F52410941CB7 DFB "ORA",TAB,"A",RS ; B7
4599 1CFA 434D500942CB8 DFB "CMP",TAB,"B",RS ; B8
4600 1D00 434D500943CB9 DFB "CMP",TAB,"C",RS ; B9
4601 1D06 434D500944CBA DFB "CMP",TAB,"D",RS ; BA
4602 1D0C 434D500945CBB DFB "CMP",TAB,"E",RS ; BB
4603 1D12 434D500948CBC DFB "CMP",TAB,"H",RS ; BC
4604 1D18 434D50094CCBD DFB "CMP",TAB,"L",RS ; BD
4605 1D1E 434D50094DCBE DFB "CMP",TAB,"M",RS ; BE
4606 1D24 434D500941CBF DFB "CMP",TAB,"A",RS ; BF
4607 1D2A 524E5A0900CC0 DFB "RNZ",TAB,RS ; C0
4608 1D2F 504F500942CC1 DFB "POP",TAB,"B",RS ; C1
4609 1D35 4A4E5A0900CC2 DFB "JNZ",TAB,RS ; C2
4610 1D3A 4A4D500900CC3 DFB "JMP",TAB,RS ; C3
4611 1D3F 434E5A0900CC4 DFB "CNZ",TAB,RS ; C4
4612 1D44 5055534809CC5 DFB "PUSH",TAB,"B",RS ; C5
4613 1D4B 4144490900CC6 DFB "ADI",TAB,RS ; C6
4614 1D50 5253540930CC7 DFB "RST",TAB,"0",RS ; C7
4615 1D56 525A0900 CC8 DFB "RZ",TAB,RS ; C8
4616 1D5A 5245540900CC9 DFB "RET",TAB,RS ; C9
4617 1D5F 4A5A0900 CCA DFB "JZ",TAB,RS ; CA
4618 1D63 4446420900CCB DFB "DFB",TAB,RS ; CB
4619 1D68 435A0900 CCC DFB "CZ",TAB,RS ; CC
4620 1D6C 43414C4C09CCD DFB "CALL",TAB,RS ; CD

Page 77 of 86
B8080.LST 3/12/2560 20:43

4621 1D72 4143490900CCE DFB "ACI",TAB,RS ; CE


4622 1D77 5253540931CCF DFB "RST",TAB,"1",RS ; CF
4623 1D7D 524E430900CD0 DFB "RNC",TAB,RS ; D0
4624 1D82 504F500944CD1 DFB "POP",TAB,"D",RS ; D1
4625 1D88 4A4E430900CD2 DFB "JNC",TAB,RS ; D2
4626 1D8D 4F55540900CD3 DFB "OUT",TAB,RS ; D3
4627 1D92 434E430900CD4 DFB "CNC",TAB,RS ; D4
4628 1D97 5055534809CD5 DFB "PUSH",TAB,"D",RS ; D5
4629 1D9E 5355490900CD6 DFB "SUI",TAB,RS ; D6
4630 1DA3 5253540932CD7 DFB "RST",TAB,"2",RS ; D7
4631 1DA9 52430900 CD8 DFB "RC",TAB,RS ; D8
4632 1DAD 4446420900CD9 DFB "DFB",TAB,RS ; D9
4633 1DB2 4A430900 CDA DFB "JC",TAB,RS ; DA
4634 1DB6 494E0900 CDB DFB "IN",TAB,RS ; DFB
4635 1DBA 43430900 CDC DFB "CC",TAB,RS ; DC
4636 1DBE 4446420900CDD DFB "DFB",TAB,RS ; DD
4637 1DC3 5342490900CDE DFB "SBI",TAB,RS ; DE
4638 1DC8 5253540933CDF DFB "RST",TAB,"3",RS ; DF
4639 1DCE 52504F0900CE0 DFB "RPO",TAB,RS ; E0
4640 1DD3 504F500948CE1 DFB "POP",TAB,"H",RS ; E1
4641 1DD9 4A504F0900CE2 DFB "JPO",TAB,RS ; E2
4642 1DDE 5854484C09CE3 DFB "XTHL",TAB,RS ; E3
4643 1DE4 43504F0900CE4 DFB "CPO",TAB,RS ; E4
4644 1DE9 5055534809CE5 DFB "PUSH",TAB,"H",RS ; E5
4645 1DF0 414E490900CE6 DFB "ANI",TAB,RS ; E6
4646 1DF5 5253540934CE7 DFB "RST",TAB,"4",RS ; E7
4647 1DFB 5250450900CE8 DFB "RPE",TAB,RS ; E8
4648 1E00 5043484C09CE9 DFB "PCHL",TAB,RS ; E9
4649 1E06 4A50450900CEA DFB "JPE",TAB,RS ; EA
4650 1E0B 5843484709CEB DFB "XCHG",TAB,RS ; EB
4651 1E11 4350450900CEC DFB "CPE",TAB,RS ; EC
4652 1E16 4446420900CED DFB "DFB",TAB,RS ; ED
4653 1E1B 5852490900CEE DFB "XRI",TAB,RS ; EE
4654 1E20 5253540935CEF DFB "RST",TAB,"5",RS ; EF
4655 1E26 52500900 CF0 DFB "RP",TAB,RS ; F0
4656 1E2A 504F500950CF1 DFB "POP",TAB,"PSW",RS ; F1
4657 1E32 4A500900 CF2 DFB "JP",TAB,RS ; F2
4658 1E36 44490900 CF3 DFB "DI",TAB,RS ; F3
4659 1E3A 43500900 CF4 DFB "CP",TAB,RS ; F4
4660 1E3E 5055534809CF5 DFB "PUSH",TAB,"PSW",RS ; F5
4661 1E47 4F52490900CF6 DFB "ORI",TAB,RS ; F6
4662 1E4C 5253540936CF7 DFB "RST",TAB,"6",RS ; F7
4663 1E52 524D0900 CF8 DFB "RM",TAB,RS ; F8
4664 1E56 5350484C09CF9 DFB "SPHL",TAB,RS ; F9
4665 1E5C 4A4D0900 CFA DFB "JM",TAB,RS ; FA
4666 1E60 45490900 CFB DFB "EI",TAB,RS ; FB
4667 1E64 434D0900 CFC DFB "CM",TAB,RS ; FC
4668 1E68 4446420900CFD DFB "DFB",TAB,RS ; FD
4669 1E6D 4350490900CFE DFB "CPI",TAB,RS ; FE
4670 1E72 5253540937CFF DFB "RST",TAB,"7",RS, ; FF
4671
4672
4673
4674
4675
4676
4677 1E78 0D0A0A3830prompt1: dfb cr,lf,lf,"8080 MICROPROCESSOR KIT [2016]
4678
4679 ;convert dfb 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77
4680

Page 78 of 86
B8080.LST 3/12/2560 20:43

4681 1EA5 BD309BBA36convert: dfb 0bdh,30h,9bh,0bah,36h,0aeh,0afh,38h,0bfh,0


4682
4683 1EB5 0000000000off_display: dfb 0,0,0,0,0,0
4684
4685 ; lcd message |--- 20 letters ---|
4686 1EBB 3830383020prompt2: dfb "8080 MICROPROCESSOR KIT",0
4687 1ED3 33326B4220text3: dfb "32kB RAM",0
4688
4689
4690 1EDC 6C6F616420download_text: dfb "load Intel hex file...",0
4691 1EF3 3E00 prompt_text: dfb ">",0
4692 1EF5 6E6577206Cnew_text: dfb "new location = ",0
4693 1F05 6564697420edit_text: dfb "edit memory location = ",0
4694 1F1D 0D0A456E74edit_text1: dfb cr,lf,"Enter to quit, SPACE key to view
4695 1F48 0D0A0A4144edit_text2: dfb cr,lf,lf,"ADDR DATA",0
4696
4697 1F56 6A756D7020jump_text1: dfb "jump to address [",0
4698 1F68 5D203D2000jump_text2: dfb "] = ",0
4699 1F6D 7072696E74ascii_text: dfb "print ASCII code",0
4700
4701 1F7E 426567696Efill_text1: dfb "Begin address = ",0
4702 1F8F 20456E6420fill_text2: dfb " End address = ",0
4703 1F9F 2044617461fill_text3: dfb " Data = ",0
4704
4705 1FA8 206572726Ferror_text: dfb " errors",0
4706
4707 1FB0 6469736173disassemble_text: dfb "disassemble...",0
4708
4709 0000 = eos equ 0
4710
4711 1FBF 41463D00 af_text: dfb "AF=",eos
4712 1FC3 42433D00 bc_text: dfb "BC=",eos
4713 1FC7 44453D00 de_text: dfb "DE=",eos
4714 1FCB 484C3D00 hl_text: dfb "HL=",eos
4715 1FCF 53503D00 sp_text: dfb "SP=",eos
4716 1FD3 544F533D00tos_text: dfb "TOS=",eos
4717
4718 1FD8 50433D00 pc_text: dfb "PC=",eos
4719 1FDC 5B53205A20flag_text: dfb "[S Z - AC - P - CY]=",eos
4720
4721 1FF2 533D00 sign_text: dfb "S=",0
4722
4723 1FF5 2062797465byte_text: dfb " bytes loaded",0
4724
4725 2003 535441434Bstack_text: dfb "STACK Memory Contents..",0
4726
4727 201B 7365742076set_register_text: dfb "set value to user register (enter
4728
4729
4730 204A 0D0A0A3830help_text: dfb cr,lf,lf,"8080 MICROPROCESSOR KIT (? HELP
4731 206D 0D0A41202Dhelp_text1: dfb cr,lf, "A - ASCII code"
4732 207D 0D0A43202D dfb cr,lf, "C - clear watch variables"
4733 2098 0D0A44202D dfb cr,lf, "D - disassemble"
4734 20A9 0D0A45202D dfb cr,lf, "E - edit memory"
4735 20BA 0D0A46202D dfb cr,lf, "F - fill constant"
4736 20CD 0D0A48202D dfb cr,lf, "H - hex dump"
4737 20DB 0D0A49202D dfb cr,lf, "I - i/o location and 7-segment
4738 2100 0D0A4A202D dfb cr,lf, "J - jump to user program"
4739 211A 0D0A4B202D dfb cr,lf, "K - display user STACK"
4740 2132 0D0A4C202D dfb cr,lf, "L - load Intel hex file"

Page 79 of 86
B8080.LST 3/12/2560 20:43

4741 214B 0D0A4D202D dfb cr,lf, "M - monitor call number"


4742 2164 0D0A4E202D dfb cr,lf, "N - new location pointer"
4743 217E 0D0A51202D dfb cr,lf, "Q - quick home location"
4744 2197 0D0A52202D dfb cr,lf, "R - user register display"
4745 21B2 0D0A53202D dfb cr,lf, "S - set value to user register
4746 21D2 0D0A57202D dfb cr,lf, "W - watch variables"
4747 ; dfb cr,lf, "SPACE BAR - single step"
4748 21E7 0D0A3F202D dfb cr,lf, "? - help menu",cr,lf,0
4749
4750
4751 21F9 0D0A303048io_text dfb cr,lf,"00H 8-bit GPIO1 LED"
4752 220E 0D0A dfb cr,lf
4753 2210 0D0A504F52 dfb cr,lf,"PORT0 (input)=20H, PORT1(digit)=40
4754 2249 0D0A dfb cr,lf
4755 224B 0D0A4C4344 dfb cr,lf,"LCD CMD WR=80H, CMD RD=82H, DATA
4756 2281 0D0A dfb cr,lf
4757 2283 0D0A555345 dfb cr,lf,"USER = A0H-BFH, C0H-DFH, E0H-FFH"
4758 22A5 0D0A dfb cr,lf
4759 22A7 0D0A372D73 dfb cr,lf,"7-segment code for 0-F"
4760 22BF 0D0A303D30 dfb cr,lf,"0=0bdh,1=30h,2=9bh,3=0bah,4=36h,5=0aeh,
4761 22F4 0D0A383D30 dfb cr,lf,"8=0bfh,9=0beh,A=3fh,B=0a7h,C=8dh,D=0b3h
4762
4763
4764
4765 232A monitor_text:
4766
4767 232A 7365652069 dfb "see input parameters in user manual",cr
4768 234F 0D0A31456E dfb cr,lf,"1Enn MVI E,function_number"
4769 236B 0D0A434620 dfb cr,lf,"CF RST 1"
4770 2377 0D0A dfb cr,lf
4771 2379 0D0A303020 dfb cr,lf,"00 - demo" ; #0 running LED with
4772 2384 0D0A303120 dfb cr,lf,"01 - delay" ; #1 simple delay routine
4773 2390 0D0A303220 dfb cr,lf,"02 - cold_boot" ; #2 show 8085 runnin
4774 23A0 0D0A303320 dfb cr,lf,"03 - scan" ; #3 scan display
4775 23AB 0D0A303420 dfb cr,lf,"04 - cin" ; #4 get byte from
4776 23B5 0D0A303520 dfb cr,lf,"05 - cout" ; #5 print byte to
4777 23C0 0D0A303620 dfb cr,lf,"06 - put_str" ; #6 print string
4778 23CE 0D0A303720 dfb cr,lf,"07 - init_lcd" ; #7 initialize lcd
4779 23DD 0D0A303820 dfb cr,lf,"08 - lcd_ready" ; #8 wait until
4780 23ED 0D0A303920 dfb cr,lf,"09 - clear_lcd" ; #9 clear lcd displa
4781 23FD 0D0A304120 dfb cr,lf,"0A - goto_xy" ; #10 set lcd cursor
4782 240B 0D0A304220 dfb cr,lf,"0B - put_str_lcd" ; #11 print ASCII
4783 241D 0D0A304320 dfb cr,lf,"0C - put_ch_lcd" ; #12 print ASCII
4784 242E 0D0A304420 dfb cr,lf,"0D - demo2",0 ; #13 run GPIO LED
4785 243B 0D0A304520 dfb cr,lf,"0E - pint16u",0 ;#14 print 16-bit
4786
4787
4788
4789 ; data segment
4790
4791 F000 org system_ram
4792
4793 F000 watch_ram dfs 16 ; watch variable F000-F00F
4794 F010 buffer dfs 16 ; buffer display
4795 F020 bcs dfs 1 ; byte checksum
4796 F021 key dfs 1 ; key position
4797 F022 command dfs 1 ; serial command
4798 F023 flag1 dfs 1 ; user flag
4799 ; flag1.0 Space key was pressed
4800 ; flag1.1 Enter key was pressed

Page 80 of 86
B8080.LST 3/12/2560 20:43

4801 F024 beep_flag dfs 1 ; beep/no beep


4802
4803 F025 uart_found dfs 1 ; 0 = no uart, 1 uart found
4804
4805 F026 entry_mode dfs 1 ; 0 for data mode
4806 ; 1 for address mode
4807 ; 2 register display
4808 F027 counter1 dfs 1 ; event counter1 for data entry
4809 F028 counter2 dfs 1 ; event counter2 for address entry
4810 F029 warm_code dfs 1 ; warm boot code
4811
4812 F02A user_PC dfs 2 ; user PC
4813 F02C user_AF dfs 2 ; user AF
4814 F02E user_BC dfs 2 ; user BC
4815 F030 user_DE dfs 2 ; user DE
4816 F032 user_HL dfs 2 ; user HL
4817 F034 user_SP dfs 2 ; user SP
4818 F036 tos dfs 2 ; Top of STACK
4819 F038 current_register dfs 2 ; stores current displayed register
4820
4821 F03A temp dfs 2 ; temporary 16-bit storage
4822
4823 F03C pointer dfs 2 ; for hex dump
4824
4825
4826 F03E break_address dfs 2 ; break address
4827 F040 break_opcode dfs 1 ; opcode that saved
4828
4829 F041 bcd_counter1 dfs 3 ; 6-digit BCD counter1
4830 F044 bcd_counter2 dfs 3 ; 6-digit BCD counter2
4831
4832 F047 line_buffer dfs 16 ; reserved for terminal printing
4833
4834
4835 F057 save_stack dfs 2 ; for saving system stack
4836 F059 system_stack dfs 32
4837 F079 user_stack dfs 32
4838
4839 0000 END
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840
4840

Page 81 of 86
B8080.LST 3/12/2560 20:43

4840
4840 10CD AC_TEXT 09F7 ADDRESS_MODE 1FBF AF_TEXT
4841 12BB ALT_PUT_STR 1411 ASCII_0_9 0DCA ASCII_PRINT
4842 0DE2 ASCII_PRINT1 1F6D ASCII_TEXT F041 BCD_COUNTER1
4843 F044 BCD_COUNTER2 F020 BCS 1FC3 BC_TEXT
4844 0965 BEEP_CHK F024 BEEP_FLAG 0636 BEEP_ON
4845 017E BIN1 0189 BIN2 017C BIN2ASCII
4846 0193 BIN3 019E BIN4 14F7 BIT_DELAY
4847 1522 BIT_IS_ONE 08C0 BREAK F03E BREAK_ADDRESS
4848 F040 BREAK_OPCODE F010 BUFFER 0080 BUSY
4849 0627 BUZZER 0638 BUZZER1 1FF5 BYTE_TEXT
4850 182B C0 1830 C1 188C C10
4851 1891 C11 1898 C12 189F C13
4852 18A5 C14 18AB C15 18B1 C16
4853 18B8 C17 18BD C18 18C2 C19
4854 18C8 C1A 18CF C1B 18D5 C1C
4855 18DB C1D 18E1 C1E 18E8 C1F
4856 1837 C2 18ED C20 18F2 C21
4857 18F9 C22 18FF C23 1905 C24
4858 190B C25 1911 C26 1918 C27
4859 191D C28 1922 C29 1928 C2A
4860 192E C2B 1934 C2C 193A C2D
4861 1940 C2E 1947 C2F 183E C3
4862 194C C30 1951 C31 1959 C32
4863 195E C33 1965 C34 196B C35
4864 1971 C36 1978 C37 197D C38
4865 1982 C39 1989 C3A 198E C3B
4866 1995 C3C 199B C3D 19A1 C3E
4867 19A8 C3F 1844 C4 19AD C40
4868 19B5 C41 19BD C42 19C5 C43
4869 19CD C44 19D5 C45 19DD C46
4870 19E5 C47 19ED C48 19F5 C49
4871 19FD C4A 1A05 C4B 1A0D C4C
4872 1A15 C4D 1A1D C4E 1A25 C4F
4873 184A C5 1A2D C50 1A35 C51
4874 1A3D C52 1A45 C53 1A4D C54
4875 1A55 C55 1A5D C56 1A65 C57
4876 1A6D C58 1A75 C59 1A7D C5A
4877 1A85 C5B 1A8D C5C 1A95 C5D
4878 1A9D C5E 1AA5 C5F 1850 C6
4879 1AAD C60 1AB5 C61 1ABD C62
4880 1AC5 C63 1ACD C64 1AD5 C65
4881 1ADD C66 1AE5 C67 1AED C68
4882 1AF5 C69 1AFD C6A 1B05 C6B
4883 1B0D C6C 1B15 C6D 1B1D C6E
4884 1B25 C6F 1857 C7 1B2D C70
4885 1B35 C71 1B3D C72 1B45 C73
4886 1B4D C74 1B55 C75 1B5D C76
4887 1B62 C77 1B6A C78 1B72 C79
4888 1B7A C7A 1B82 C7B 1B8A C7C
4889 1B92 C7D 1B9A C7E 1BA2 C7F
4890 185C C8 1BAA C80 1BB0 C81
4891 1BB6 C82 1BBC C83 1BC2 C84
4892 1BC8 C85 1BCE C86 1BD4 C87
4893 1BDA C88 1BE0 C89 1BE6 C8A
4894 1BEC C8B 1BF2 C8C 1BF8 C8D
4895 1BFE C8E 1C04 C8F 1861 C9
4896 1C0A C90 1C10 C91 1C16 C92
4897 1C1C C93 1C22 C94 1C28 C95
4898 1C2E C96 1C34 C97 1C3A C98

Page 82 of 86
B8080.LST 3/12/2560 20:43

4899 1C40 C99 1C46 C9A 1C4C C9B


4900 1C52 C9C 1C58 C9D 1C5E C9E
4901 1C64 C9F 1867 CA 1C6A CA0
4902 1C70 CA1 1C76 CA2 1C7C CA3
4903 1C82 CA4 1C88 CA5 1C8E CA6
4904 1C94 CA7 1C9A CA8 1CA0 CA9
4905 1CA6 CAA 1CAC CAB 1CB2 CAC
4906 1CB8 CAD 1CBE CAE 1CC4 CAF
4907 186E CB 1CCA CB0 1CD0 CB1
4908 1CD6 CB2 1CDC CB3 1CE2 CB4
4909 1CE8 CB5 1CEE CB6 1CF4 CB7
4910 1CFA CB8 1D00 CB9 1D06 CBA
4911 1D0C CBB 1D12 CBC 1D18 CBD
4912 1D1E CBE 1D24 CBF 1874 CC
4913 1D2A CC0 1D2F CC1 1D35 CC2
4914 1D3A CC3 1D3F CC4 1D44 CC5
4915 1D4B CC6 1D50 CC7 1D56 CC8
4916 1D5A CC9 1D5F CCA 1D63 CCB
4917 1D68 CCC 1D6C CCD 1D72 CCE
4918 1D77 CCF 187A CD 1D7D CD0
4919 1D82 CD1 1D88 CD2 1D8D CD3
4920 1D92 CD4 1D97 CD5 1D9E CD6
4921 1DA3 CD7 1DA9 CD8 1DAD CD9
4922 1DB2 CDA 1DB6 CDB 1DBA CDC
4923 1DBE CDD 1DC3 CDE 1DC8 CDF
4924 1880 CE 1DCE CE0 1DD3 CE1
4925 1DD9 CE2 1DDE CE3 1DE4 CE4
4926 1DE9 CE5 1DF0 CE6 1DF5 CE7
4927 1DFB CE8 1E00 CE9 1E06 CEA
4928 1E0B CEB 1E11 CEC 1E16 CED
4929 1E1B CEE 1E20 CEF 1887 CF
4930 1E26 CF0 1E2A CF1 1E32 CF2
4931 1E36 CF3 1E3A CF4 1E3E CF5
4932 1E47 CF6 1E4C CF7 1E52 CF8
4933 1E56 CF9 1E5C CFA 1E60 CFB
4934 1E64 CFC 1E68 CFD 1E6D CFE
4935 1E72 CFF 0CCD CHECKMORE 0D3E CHECK_LOWEST
4936 0D1D CHECK_RXD 0D11 CHECK_S27 14D1 CHK_BIT
4937 1514 CHK_BIT_RX 15E8 CHK_LCD 128F CIN
4938 1506 CIN1 0F3B CLEAR1 1585 CLEAR_BCD1
4939 15AE CLEAR_BCD2 08FA CLEAR_BREAK 01E3 CLEAR_LCD
4940 0F2E CLEAR_WATCH 0BA9 CODE1 0BF1 CODE10
4941 0BF9 CODE11 0C01 CODE12 0C09 CODE13
4942 0C11 CODE14 0C19 CODE15 0C21 CODE16
4943 0C29 CODE17 0C31 CODE18 0C39 CODE19
4944 0BB1 CODE2 0C41 CODE20 0C49 CODE21
4945 0C51 CODE22 0C59 CODE23 0C61 CODE24
4946 0C69 CODE25 0C71 CODE26 0C79 CODE27
4947 0BB9 CODE3 0BC1 CODE4 0BC9 CODE5
4948 0BD1 CODE6 0BD9 CODE7 0BE1 CODE8
4949 0BE9 CODE9 0B73 COLD1 0B71 COLD2
4950 0B82 COLD3 0B6C COLD_BOOT F022 COMMAND
4951 0082 COMMAND_READ 0080 COMMAND_WRITE 0D4D CONNECT_TERMINAL
4952 0023 CONTROL_8254 0034 CONTROL_WORD_8254 1EA5 CONVERT
4953 0020 COUNTER0_8254 F027 COUNTER1 0021 COUNTER1_8254
4954 F028 COUNTER2 0022 COUNTER2_8254 1287 COUT
4955 000D CR F038 CURRENT_REGISTER 10D4 CY_TEXT
4956 05FF DATA_KEY 060A DATA_KEY1 0612 DATA_KEY2
4957 061A DATA_KEY3 0622 DATA_KEY4 0A04 DATA_MODE
4958 0083 DATA_READ 1499 DATA_RECORD 0081 DATA_WRITE

Page 83 of 86
B8080.LST 3/12/2560 20:43

4959 0CA5 DEBOUNCE 0CA7 DEBOUNCE1 098B DEBUG


4960 0A6E DECREMENT 05F6 DELAY 14FE DELAY_1_5
4961 14F9 DELAY_BIT 1500 DELAY_BIT15 0631 DELAY_NOBEEP
4962 064F DELAY_US 0651 DELAY_US1 0940 DELETE_BYTE
4963 094F DELETE_BYTE1 0B96 DEMO 0B98 DEMO1_2
4964 1FC7 DE_TEXT 0040 DIGIT 0306 DIS2
4965 0370 DISASSEM1 037F DISASSEM2 032E DISASSEM3
4966 031A DISASSEMBLE 02F3 DISASSEMBLE1 1FB0 DISASSEMBLE_TEXT
4967 0656 DISPLAY_OFF 0DA8 DOWNLOAD 1EDC DOWNLOAD_TEXT
4968 13A3 DUMP1 139B DUMP_MEMORY 03E6 D_DISASSEM1
4969 03F5 D_DISASSEM2 03A4 D_DISASSEM3 0390 D_DISASSEMBLE
4970 03BC D_ONE_TAB 11A4 EDIT1 117F EDIT_LOCATION
4971 1F05 EDIT_TEXT 1F1D EDIT_TEXT1 1F48 EDIT_TEXT2
4972 06FF ENTER_ADDRESS 06C5 ENTER_DATA 06EA ENTER_DATA1
4973 0665 ENTER_REGISTER F026 ENTRY_MODE 0000 EOS
4974 1FA8 ERROR_TEXT 001B ESC 1498 ESC_QUIT
4975 0DFB EXIT_ASCII_PRINT 01EA EXIT_CLEAR 0F48 EXIT_CLEAR_WATCH
4976 0319 EXIT_DISASSEMBLE 0DC9 EXIT_DOWNLOAD 1201 EXIT_EDIT
4977 11F2 EXIT_EDIT1 111B EXIT_FILL 143B EXIT_GET_HEX2
4978 1444 EXIT_GET_HEX3 125D EXIT_HELP 139A EXIT_HEX_DUMP
4979 1245 EXIT_IO 117E EXIT_JUMP 1134 EXIT_MONITOR
4980 121E EXIT_NEW_LOCATION 0DA7 EXIT_PROMPTING 1233 EXIT_QUICK_HOME
4981 10C9 EXIT_REGISTER 0F10 EXIT_SET_USER 0FA3 EXIT_STACK
4982 0F63 EXIT_STEP 0F57 EXIT_WATCH 10D8 FILL_MEMORY
4983 110A FILL_MEMORY1 1F7E FILL_TEXT1 1F8F FILL_TEXT2
4984 1F9F FILL_TEXT3 F023 FLAG1 1FDC FLAG_TEXT
4985 1281 FOUND 15F8 FOUND_LCD 0578 FUNCTION1
4986 05DC FUNCTION10 05E7 FUNCTION11 0583 FUNCTION2
4987 058E FUNCTION3 0599 FUNCTION4 05A5 FUNCTION5
4988 05B0 FUNCTION6 05BB FUNCTION7 05C6 FUNCTION8
4989 05D1 FUNCTION9 0A0F FUNCTION_2ND 056D FUNCTION_KEY
4990 141C GET_2ND_HEX 1505 GET_BYTE 1293 GET_COMMAND
4991 13BC GET_HEX 13CF GET_HEX1 13E8 GET_HEX2
4992 0BA1 GET_KEY_CODE 0406 GET_NUMBER_OF_BYTE 144D GET_RECORD
4993 0991 GO 020D GOTO_XY 021C GOTO_XY1
4994 0227 GOTO_XY2 0232 GOTO_XY3 023D GOTO_XY4
4995 0000 GPIO 1246 HELP 204A HELP_TEXT
4996 206D HELP_TEXT1 133B HEX_DUMP 135C HEX_DUMP1
4997 1348 HEX_DUMP2 1382 HEX_DUMP3 1384 HEX_DUMP4
4998 1377 HEX_DUMP5 1FCB HL_TEXT 0977 HOME
4999 8100 HOME_ADDRESS 0A5B INCREMENT 1539 INC_BCD1
5000 1551 INC_BCD2 0172 INIT_8254 01EB INIT_LCD
5001 125E INIT_UART 0915 INSERT_BYTE 0928 INSERT_BYTE1
5002 162B INS_TABLE 1234 IO_ADDRESS 21F9 IO_TEXT
5003 06FB IT_IS_RAM 1F56 JUMP_TEXT1 1F68 JUMP_TEXT2
5004 1135 JUMP_TO_USER_PGM F021 KEY 0561 KEY_EXECUTE
5005 01D9 LCD_READY 01DA LCD_READY1 000A LF
5006 F047 LINE_BUFFER 0CD8 LONG_DELAY 15D1 LOOP1
5007 0169 MAIN 182B MNEM 0B33 MODE1
5008 0B6A MODE2 0AF8 MODE_INDICATOR 0A33 MODIFY_REGISTER
5009 0244 MONITOR_CALL 111C MONITOR_FUNCTION 232A MONITOR_TEXT
5010 8000 MY_ROM 1324 NEW_LINE 1202 NEW_LOCATION
5011 1EF5 NEW_TEXT 14E5 NEXT_BIT 1529 NEXT_BIT_RX
5012 0CF5 NEXT_KEY 12A7 NO_DATA 0D49 NO_KEY_PRESSED
5013 040E NUMBER1 0456 NUMBER10 045E NUMBER11
5014 0466 NUMBER12 046E NUMBER13 0476 NUMBER14
5015 047E NUMBER15 0486 NUMBER16 048E NUMBER17
5016 0496 NUMBER18 049E NUMBER19 0416 NUMBER2
5017 04A6 NUMBER20 04AE NUMBER21 04B6 NUMBER22
5018 04BE NUMBER23 04C6 NUMBER24 04CE NUMBER25

Page 84 of 86
B8080.LST 3/12/2560 20:43

5019 04D6 NUMBER26 04DE NUMBER27 04E6 NUMBER28


5020 04EE NUMBER29 041E NUMBER3 04F6 NUMBER30
5021 04FE NUMBER31 0506 NUMBER32 050E NUMBER33
5022 0516 NUMBER34 051E NUMBER35 0526 NUMBER36
5023 052E NUMBER37 0536 NUMBER38 053E NUMBER39
5024 0426 NUMBER4 0546 NUMBER40 054E NUMBER41
5025 0556 NUMBER42 055E NUMBER43 042E NUMBER5
5026 0436 NUMBER6 043E NUMBER7 0446 NUMBER8
5027 044E NUMBER9 1EB5 OFF_DISPLAY 0659 OFF_DISPLAY1
5028 1433 OK_0_9 0346 ONE_TAB 0973 OPTION1
5029 1304 OUT1X 1310 OUT1X1 1315 OUT2X
5030 1FD8 PC_TEXT 01C7 PINT1 01D2 PINT2
5031 01AC PINT8U F03C POINTER 0020 PORT0
5032 0040 PORT1 0060 PORT2 1569 PRINT_BCD1
5033 1592 PRINT_BCD2 0F49 PRINT_WATCH 0F11 PRINT_WATCH_RAM
5034 1E78 PROMPT1 1EBB PROMPT2 12C2 PROMPT3
5035 0D8A PROMPTING 1EF3 PROMPT_TEXT 023E PUT_CH_LCD
5036 07E3 PUT_FLAG 07EB PUT_HIGH1 086C PUT_HIGH2
5037 12AD PUT_STR 12B4 PUT_STR1 12EF PUT_STR2
5038 01FD PUT_STR_LCD 0204 PUT_STR_LCD1 10D1 P_TEXT
5039 121F QUICK_HOME 01E1 READY2 0AB4 READ_MEMORY
5040 0A89 READ_REGISTER 0757 REGISTER1 089A REGISTER10
5041 0773 REGISTER2 078F REGISTER3 07AB REGISTER4
5042 07C7 REGISTER5 07EE REGISTER6 0816 REGISTER7
5043 0841 REGISTER8 0872 REGISTER9 0FA4 REGISTER_DISPLAY
5044 0FAC REGISTER_DISPLAY1 0FAF REGISTER_DISPLAY2 1041 REGISTER_FLAG1
5045 10C2 REGISTER_FLAG10 1046 REGISTER_FLAG2 1060 REGISTER_FLAG3
5046 1065 REGISTER_FLAG4 107F REGISTER_FLAG5 1084 REGISTER_FLAG6
5047 109E REGISTER_FLAG7 10A3 REGISTER_FLAG8 10BD REGISTER_FLAG9
5048 15EA REPEAT_CHK_LCD 0000 ROM 0000 RS
5049 F057 SAVE_STACK 0CAC SCAN 0CBA SCAN1
5050 0C7C SCAN_KEY 0C93 SCAN_KEY1 0C8D SCAN_KEY2
5051 0C8D SCAN_KEY3 0C7C SCAN_KEY4 0060 SEGMENT
5052 0739 SELECT_REGISTER 14C7 SEND_BYTE 0D92 SEND_PROMPT
5053 12F6 SEND_PROMPT1 12FD SEND_PROMPT3 1335 SEND_TAB
5054 14DE SEND_ZERO 0D4E SERIAL_COMMAND 0298 SERVICE_RST2
5055 0276 SERVICE_RST7 02BD SERVICE_TRAP 201B SET_REGISTER_TEXT
5056 0E38 SET_USER1 0E63 SET_USER2 0E8E SET_USER3
5057 0EB9 SET_USER4 0EE4 SET_USER5 0F0F SET_USER6
5058 0DFC SET_USER_REGISTER 0715 SHIFT_ADDRESS 06D8 SHIFT_DATA
5059 0CEB SHIFT_KEY 0670 SHIFT_REGISTER 1FF2 SIGN_TEXT
5060 09B5 SINGLE_STEP 0F58 SINGLE_STEP_ 02EE SKIP1
5061 09D5 SKIP2 0CDE SKIP23 0122 SKIP_BOOT
5062 0D29 SKIP_CHECK_S27 0147 SKIP_COLD_BOOT 11E2 SKIP_EDIT1
5063 11EB SKIP_EDIT2 14BB SKIP_ERROR 116F SKIP_LOAD_PC
5064 07ED SKIP_PUT_HIGH1 086E SKIP_PUT_HIGH2 015E SKIP_SEND_PROMPT
5065 0D87 SKIP_SERIAL 160D SKIP_TEST_LCD 0020 SP
5066 132F SPACE 1FCF SP_TEXT 0F64 STACK_DISPLAY
5067 0F78 STACK_DISPLAY1 2003 STACK_TEXT 0100 START
5068 F000 SYSTEM_RAM F059 SYSTEM_STACK 0009 TAB
5069 F03A TEMP 0623 TEST_BUZZER 15BB TEST_KIT
5070 05E8 TEST_LED 05EA TEST_LED1 1ED3 TEXT3
5071 1620 TICK 0B8A TITLE F036 TOS
5072 1FD3 TOS_TEXT 13B0 TO_HEX 0A7E TO_SEVEN_SEGMENT
5073 0040 UART_BUFFER 0040 UART_DIVISOR_LSB 0041 UART_DIVISOR_MSB
5074 0042 UART_FIFO F025 UART_FOUND 0043 UART_LCR
5075 0045 UART_LINE_STATUS 0047 UART_SCR F02C USER_AF
5076 F02E USER_BC F030 USER_DE F032 USER_HL
5077 F02A USER_PC 0030 USER_PORT_A 0031 USER_PORT_B
5078 0032 USER_PORT_C 0033 USER_PORT_CONTROL F034 USER_SP

Page 85 of 86
B8080.LST 3/12/2560 20:43

5079 F079 USER_STACK 0D48 VALID_KEY 0258 VECTOR_TABLE


5080 0CDA WAIT1 0CE3 WAIT2 1480 WAIT_CR
5081 F029 WARM_CODE 0F21 WATCH1 F000 WATCH_RAM
5082 13BB ZERO_NINE 10CA ZERO_TEXT
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083
5083

Page 86 of 86
NOTE

You might also like