8085 microprocessor training kit user's manual - · pdf fileoverview the mtk-85 is a...

116
8085 Microprocessor Training Kit User's Manual Wichit Sirichote, [email protected] Rev3.0, March 29, 2015

Upload: dinhnguyet

Post on 31-Jan-2018

414 views

Category:

Documents


13 download

TRANSCRIPT

Page 1: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

8085 Microprocessor Training KitUser's Manual

Wichit Sirichote, [email protected] Rev3.0, March 29, 2015

Page 2: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

ContentsOverview……………………………………………………..………………….3

Hardware Features – Software Features

Getting Started…..………………………………………………………………4

AC Adapter – LED Display and Keypad – RESET – ADDR – DATA – INC – DEC – HOME – ALT – GO – STEP – MOD – Program #1 – Program #2 – Program #3

Connecting Terminal..……………………………………….…………………16

Command ‘A’ – Command ‘C’ – Command ‘D’ – Command ‘E’ – Command ‘F’ – Command ‘H’ – Command ‘I’ – Command ‘J’ – Command ‘K’ – Command ‘L’ – Command ‘M’ – Command ‘N’ – Command ‘Q’ – Command ‘R’ – Command ‘S’ – Command ‘W’ – Command ‘SPACE BAR’

Hardware……………………………………………………………………….23

CPU – Memory – GPIO – Programmable Port 8255 – Programmable Counter 8254 – Headers and Connectors – Interrupt Test Button – Technical Specifications – Monitor Call Number-NVRAM Bootable

Appendix A LCD Driver RoutinesAppendix B SCAN Keyboard and Display SubroutinesAppendix C UART Driver RoutinesAppendix D Using NVRAM BootableAppendix E Machine Code and 8085 InstructionsAppendix F Hardware SchematicAppendix G Monitor source code listing

2

Page 3: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Overview

The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The kit enables studying from low level programming with direct machine code entering to high level programming with PC tools easily. A nice feature, single-step running, helps students learn the operation of microprocessor instructions quickly and clearly. The user registers provide simple means to verify the code execution. Using a PC as the terminal, theMTK-85 can receive the Intel hex file and disassemble the machine code into 8085instructions.

Figure 1: Components layout of the MTK-85.

Hardware Features:

• CPU: Mitsubishi M5M80C85AP-2 @4MHz• Memory: 32kB Monitor ROM and 32kB SRAM

3

Page 4: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

• Simple I/O Port: 8-bit GPIO built with 74LS175 D-type F-F and 74LS126 Tri-state buffer

• Programmable Ports: two 8255 chips, system and user ports• Programmable Counter: 8254• UART: 16C550 compatible UART chip

Onboard I/O devices:

• 6-digit seven segment super bright LED,• 28-keypad,• 4-bit dot LED indicates status of GPIO,• buzzer,• Direct BUS interface text LCD,• Serial Interface: RS232C 9600bit/s 8-data bit no parity one stop bit• +5V Power Supply: low-dropout voltage regulator with input protection• 40-pin header for CPU bus• 40-pin header for user port, 8255 and 8254• 16-pin header for simple GPIO port• onboard logic probe power supply• Test button for single pulse generation to the interrupt pins• Brown-out Protection• No jumper settings

Software Features:

• Enter the machine code in hexadecimal• Single-step execution• Examine and modify user registers• Run user code with software break-point• Insert and Delete byte• Built-in LCD drivers• Download Intel Hex file• Disassemble machine code into 8085 instructions• Display user registers and disassemble the instruction after single-stepping• NVRAM Bootable, runs user code when power up the board

4

Page 5: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Getting Started

AC Adapter

The MTK-85 board requires DC power input to operate. The input voltage acceptsfrom +6V to +12V. You may find any AC-to-DC adapter having DC jack with polarity as shown in Figure 2. The board has protection diode to prevent wrong polarity. If your adapter’s jack has different polarity, when plug it to the board, no power will be supplied.

+-Figure 2: Polarity of DC jack.

Since the onboard voltage regulator is a low-dropout, so heat dissipation of the voltage regulator will be (Vin-Vout) x 350mA (current consumption). The minimum voltage developed across Vout and Vin is 0.2V. So to provide +5VDC to the logic board, we can have Vin as low as say +6V. With such input, the dissipation of the voltage regulator will only be less than 350mW!

The common AC adapters mostly provide +12VDC output. You can use it also. However dissipation at the LM2940 will be higher. For example, the developed potential will be 12V-5V=7V. So heat dissipation will be 350mA x 7V=2.5W!

When power up the board, the 8085 begins read the instruction from the memory at location 0000H. The location from 0000H to 7FFFH or 32kB is ROM space. It contains the monitor program. The monitor program enables us to enter 8085 instruction using HEX digit into the RAM. We can let the 8085 RUN our program easily using monitor key GO.

When the board was powered up, the cold message running text 8085 will show on 7-segment LED and the onboard dot LED will turn on and the buzzer will sound beep. The HOME location is pointed to RAM at address 8100H. The data LED will display the content at 8100H.

LED Display and Keypad

The MTK-85 has 6 digits 7-segment LED and 28 tact switches keypad.

5

Page 6: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Four digits labeled with text “ADDRESS” is used for displaying the memory address and user registers contents. Two digits labeled with text “DATA” is for displaying the 8-bit data byte at address shown in the left-hand. The dot indicator indicates the current mode of HEX digit entering. Figure 3 shows the memory location 8100 has an 8-bit data, 1E. The dot indicates the current mode is data entry. Typing Hex key will insert hex digit into data memory.

Figure 3: The 7-segment display shows ADDRESS and DATA fields.

Keypad has two groups: the left-hand is 16-hex key 0-F and the right-hand is 10-function key. The hex key also has alternate functions when used with ALT key.

Figure 3: Keyboard layout, HEX and Function Keys.

6

Page 7: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Let’s see the functions key as follows.

RESETis hardware reset. Press reset will force the CPU begins execution the ROM monitor at address 0000H. (The reset out signal which is active high also feed to reset pins of the UART and two 8255 PPI).

ADDR changes current mode to ADDRESS entry mode. The dot indicator will move to ADDRESS filed.

DATA changes current mode to DATA entry mode. The dot indicator will move to DATA filed.

Key + increments current address by one. The content of new address will show indata field LED.

Key - decrements current address by one. The content of new address will show indata field LED.

HOME brings home address back to current display. The home address is 8100H.

ALT enables alternate functions that used with HEX key. We can press ALT followed with HEX key. The Alternate functions are described below.

ALT 0 displays user register AF. The Accumulator and Flag registers. Contents ofaccumulator is high byte and Flag is low byte.

ALT 1 displays user register BC.

ALT 2 displays user register DE.

ALT 3 displays user register HL.

ALT 4 displays user register SP.

ALT 5 displays user register PC.

ALT 6 displays CARRY flag.

ALT 7 displays ZERO flag.

ALT 8 displays SIGN flag.

7

Page 8: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

ALT 9 displays HALF CARRY flag.

ALT A displays PARITY flag.

ALT B sets break address.

ALT C clears break address.

ALT D deletes one of the current location and shifts the next byte UP.

ALT E inserts one byte and shifts the next byte DOWN.

GO forces CPU to jump from monitor program to user program at current address.

STEP executes one instruction at address shown in current display.

MOD modifies the user registers. It was used together with ALT 0-5.

User registers are the memory space in RAM prepared for saving and loading to the CPU registers when the CPU jump from monitor program to user program and back to the monitor program. It is useful for program debugging. We will learn how to use them easily in the program testing section.

Entering the program into RAM and Run it.

Test Program 1

Let’s learn how to use hex keypad to help enter the computer code to memory and test run it. Suppose we want to write the program that displays the contents of the accumulator using onboard 4-bit dot LED. Since the MTK-85 has 4-bit dot LED tied to the 4-bit output port. Logic ‘1’ presents at a given bit will make the LED ON. Logic ‘0’ makes the LED OFF. We will write the small program that shows the low nibble of the accumulator contents.

8

Page 9: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Figure 4: Sending the Accumulator content to the PORT.

Our program is,

main: inr a ; increment accumulator out 0 ; write to port 00 jmp main ; jump back to main

We see that the program has only three instructions, i.e., inr a, out 0 and jmp main.

The program was written using 8085 instructions. To test our program, we must translate above program into the machine code. This can be done easily with hand-code assembly. See Appendix E for machine code of the instructions.

Since we will write the machine code to the memory for testing, so the space must be RAM. We must know the memory allocation. Figure 5 shows the memory space allocation. We see that the board provides begin address for user program at 8100H. Some of the locations from 8000H to 803CH are reserved for interrupts vectors. The RAM locations from F000H to FFFFH are used by monitor program.

9

Page 10: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Figure 5: Memory space allocation.

Thus we can place our machine code started at location 8100. After translation we get the code for each instruction easily.

8100 3C main: inr a8101 D300 out 08103 C30081 jmp main

The 1st instruction, inr a, increments the accumulator by one. It has one byte machine code 3C. This byte will be placed at location 8100.

The 2nd instruction, out 0, write accumulator contents to the port at location 00 hastwo bytes machine code, D300. D3 is the instruction OUT and 00 is port location.

10

Page 11: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Figure 6: I/O space allocation.

The 3rd instruction, jmp main, jump back to location 8100 has three bytes machine code, C3,00,81. C3 is the JMP, and 8100 is location to be jump (Intel places low byte to low address and high byte to high address).

Above program has only 6 bytes. We can enter such code into RAM easily using HEX key. Here is the byte sequence from address 8100 to 8105.

ADDRESS DATA8100 3C8101 D38102 008103 C38104 008105 81

Now enter the code into memory address 8100.

Step 1 Press RESET, the address display will show 8100 and the data LED will show its contents.

11

Page 12: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

The current mode will be data entry. We can swap entry mode for hex key between address and data by pressing key ADDR or DATA. The DOT indicator will swap between ADDR mode and DATA mode.

To enter a byte to this location, press HEX key 3 and key C.

The 3C byte will enter to address 8100.

Step 2 Press key + to increment address.

The address display will show 8101. Then repeat step1 until 81 byte was entered to address 8105.

You can use key + or key - to check the hex code, you can modify it easily in DATA entry mode.

We will begin set the value to user Accumulator beforehand. It will clear the user register A to zero.

Press key ALT, 0/AF, display will show the content of user Accumulator and Flag register.

Press key MOD, then key 0,0,0,0. The AF will be 0000.

Press key HOME, this brings current location to 8100.

Press key STEP, the display will show next instruction to be executed at address 8101. We can examine the content of AF by key ALT, 0/AF. We see that now Accumulator is 01.

Press key STEP again, the 01 will send to LED onboard GPIO. This is the content of the accumulator after increment instruction.

The next instruction, JMP 8100 will be executed.

We can keep press key STEP, we will see everytime the instruction out 0 was executed, the value of accumulator will write to the GPIO LED.

It works! This demonstration how STEP key helps running the program single instruction.

Instead of execution one instruction using single step, we can run the program without stopping for each instruction. We will try with key GO.

12

Page 13: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Now press HOME to bring current location to 8100, press RUN.

What happen to the LED?

Did you see the LED counting?

Should it be counting up?

There are two methods of program running. First is to use single stepping. This kind executes only one instruction at a time when we press STEP key. We can learn the operation easily with user registers. The monitor program loads the contents of user registers to the CPU registers beforehand, after the instruction has been executed, the contents of CPU registers will then be saved back to the user registers. Thus we can examine the result after the instruction has been executed easily.

But above program, when we try with key GO, the CPU will jump from monitor program to user program and never get back to monitor program. Since the instruction JMP 8100 will jump back to 8100 forever. We see that the number incrementing in the accumulator will be very fast.

How can we make the speed of counting slower? We can just simply add the job that uses CPU time. Now let’s see below program.

org 8100h ; begin of codemain: inr a ; increment accumulator out 0 ; write to port 00

; add the simple delay using register pair DE

lxi d,1050h ; load 16-bit constant to DEdelay: dcr e ; decrement E jnz delay ; jump to delay location if E != 0 dcr d ; decrement D jnz delay ; jump to delay location if D != 0

jmp main ; done, jump back to main again

I suppose now you can translate the instruction into the machine code. The first mnemonic, ORG is not 8085 instruction. It is the assembler directive that tells the

13

Page 14: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

assembler program to place the hex code begins at location 8100. We will learn using assembler when using PC tools on later.

The portion of inserted code is bolded letters. We see that the method of time delay is just to let the CPU counts the value in register D and register E. Counting is done by instruction DCR E, decrement register by one for register E and D. The JNZ, jump to specified location when ZERO flag is not set. That means if the content of register E or D is not ZERO, it will jump back to decrement again. Untilthey are ZERO, the CPU will continue execute the next instruction.

Here is my translation from instructions to machine code.

org 8100h ; begin of code8100 3C main: inr a ; increment accumulator8101 D300 out 0 ; write to port 00

; add the simple delay using register pair DE

8103 115010 lxi d,1050h ; load 16-bit constant to DE8106 1D delay: dcr e ; decrement E8107 C20681 jnz delay ; jump to 81060 if E != 0810A 15 dcr d ; decrement D810B C20681 jnz delay ; jump to 8106 if D != 0

810E C30081 jmp main ; jump back to main again

This program has 17 bytes code. We can enter the code into RAM from 8100 to 8110 easily.

ADDRESS DATA8100 3C8101 D38102 008103 118104 508105 108106 1D8107 C28108 06

14

Page 15: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

8109 81810A 15810B C2810C 06810D 81810E C3810F 008110 81

After finished entering the code, press HOME to bring current RAM location to 8100. Then press key GO.

What happen to the onboard LED?

Can we change the speed of counting? How?

To stop running, press RESET key. You can modify the initial value of register DE, 1050 to whatever you want to speed up or slow down.

Test Program #2

This program shows how to use key GO to force CPU jump from monitor programto user program.

8100 1E02 main: mvi e,28102 CF rst 18103 C30081 jmp main This program has only 6 bytes i.e., 1E, 02, CF, C3, 00, 81. Enter the code, and press key HOME, GO.

We will see the cold message repeat running on the display. RST 1 having machine code CF is the method that used to call built-in monitor functions. Register E is monitor call number.

To stop program#2 running, we must press RESET key.

Test Program #3

We can test the program with software breakpoint. The instruction RTS 7 having machine code FF returns control back to monitor program and saves the contents of CPU registers to user registers. We can check the result in user registers easily.

15

Page 16: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Here is the program that adds two BCD numbers 19H and 02H. The result will be 21H.

8100 3E19 mvi a,19h ; load accumulator with 19h8102 0602 mvi b,2 ; load register B with 028104 80 add b ; add register B to accumulator8105 27 daa ; adjust result to BCD8106 FF rst 7 ; jump back to monitor

After enter the code, you can run it with key GO. Check the result in Accumulator with ALT 0.

For small program, we can place the RST 7 to the end of the program.

However for long program, sometime we may need to check at a given location, the board also provides tool that helps inserting the RST 7 instruction to the specified location. This tool is called set break point. Suppose we want to verify the result after add b instruction. We can set break point at location 8105 by setting the address to 8105 with key ADDR 8,1,0,5. Then press ALT B, the display will show this address was set breakpoint.

Press HOME and GO, check user AF with ALT 0, we see that after addition, the result in Accumulator is 1B. To clear this break address, press ALT C. The displaywill show current address 8105. The code 27 will be restored back to address 8105. We can continue execution, press RUN, and check result in AF again, we will get 21. This the correct BCD number from the addition of 19+02=21.

16

Page 17: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Connecting Terminal

The kit provides RS232 port for connecting the terminal. The ROM monitor contains ASCII commands when using UART to connect a terminal. The UART drivers and serial commands are automatically configured when UART chip was inserted. Communication format is 9600 bit/sec, 8 data bit, no parity and one stop bit. We can use PC running VT100 terminal emulation. The CD has teraterm software for emulating VT100 terminal.

Figure 7: Connecting PC running teraterm and kit with RS232 cable.

There is no need to switch between standalone mode and terminal mode. Both commands using keypad or terminal commands are working concurrently.

When press reset the prompt appears on screen.

MTK-85 8085 MICROPROCESSOR TRAINING KIT (? HELP)

8100>

Type ? for help menu listing.

17

RS232C cable

Page 18: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

MTK-85 8085 MICROPROCESSOR TRAINING KIT (? HELP)

A - ASCII codeC - clear watch variablesD - disassembleE - edit memoryF - fill constantH - hex dumpI - i/o address mapJ - jump to user programK - display user STACKL - load Intel hex fileM - monitor call numberN - new location pointerQ - quick home locationR - user register displayS - set value to user registerW - watch variablesSPACE BAR - single step? - help menu

8100>

Command ‘A’ prints the hexadecimal code for printable ASCII characters.

Command ‘C’ clears the 16-byte watch variables.

The monitor provides quick access to a16-byte RAM for program testing. The watch variables use RAM space from F000-F00F. Command 'W' prints such memory on screen.

8100>F000 AD FD FC 15 8E 9C DB 4D 4F 19 5F FD EB 3E 8A F58100>

Command ‘D’ disassembles the machine code into 8085 instructions.

8100>disassemble...

8100 3E19 MVI A,198102 0602 MVI B,028104 80 ADD B

18

Page 19: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

8105 27 DAA8106 FF RST 78107 C20681 JNZ 8106810A 15 DCR D810B C20681 JNZ 8106810E C30081 JMP 81008111 62 MOV H,D8112 CDF862 CALL 62F88115 80 ADD B8116 DC1642 CC 42168119 A5 ANA L811A D3C1 OUT C1811C 68 MOV L,B

811D>

Command ‘E’ examines and modify the data in memory. We can use this command to enter machine code. To view the content, uses Space key and to enter byte, press two digits. To quit just press ENTER.

8100>edit memory location = 8100Enter to quit, SPACE key to view content

ADDR DATA8100 [3E]8101 [19] 018102 [06]8103 [02]8104 [80] d38105 [27] 008106 [FF]8107 [C2]8108 [06]

8108>

Command ‘F’ fills 8-bit constant to memory. The example shows filling byte 00 to address 9010-9020.

9016>Begin address = 9010 End address = 9020 Data = 009016>

19

Page 20: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Command ‘H’ dumps memory. The content of memory from current pointer 9010to 908F will display in hexadecimal. The ASCII code for each byte will be displayed also. The dot will be displayed for nonprintable ASCII code.

9010>

9010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................9020 4D C2 97 CB DA DF A0 BE 9E 73 1A 34 E3 A6 83 4E M........s.4...N9030 97 47 81 CE C1 99 98 CB 14 ED 45 DE 35 6A 7C F1 .G........E.5j|.9040 F0 36 B2 69 CF 1D 90 90 70 F1 73 D8 C1 4F DF 56 .6.i....p.s..O.V9050 A8 E2 30 84 76 AA C5 18 A7 84 C5 32 81 BF B9 03 ..0.v......2....9060 8A 13 8C FD 4A 82 B9 99 4E 24 33 9E EB 16 A8 0D ....J...N$3.....9070 A9 31 CD B7 BB 4E 8D BE FF 5B 3C 8D EA 5E 4F 7F .1...N...[<..^O�9080 41 00 89 F3 54 BF EC BF E0 9F 72 CB 7D E8 34 7A A...T.....r.}.4z

9090>

Command ‘I’ displays onboard I/O address.

9090>00H-0FH onboard 4-bit GPIO, D0-D3=output port D4-D7=input port

10H-13H 8255 system PPI, 10H=PORTA, 11H=PORTB, 12H=PORTC, 13H=CONTROL

20H-23H 8254 programmable counter, 20H=counter0, 21H= counter1 22H=counter2, 23H control register

30H-33H 8255 user PPI, 30H=PORTA, 31H=PORTB, 32H=PORTC, 33H=CONTROL

40H-47H C16550 UART registers9090>

Command ‘J’ jumps from monitor program to user program. The example shows jump to address 9000. The user register displays results after running the code. The RST 7 returns control back to monitor program.

9090>jump to address [9006] = 9000

AF=5800 BC=19F4 DE=C256 HL=9504 SP=F098 PC=9007 S=0 Z=0 AC=0 P=0 CY=09090>

Command ‘K’ displays user STACK memory. The example below shows running instruction PUSH H.

20

Page 21: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

We first check the user register with command ‘r’. We see that TOP of STACK is F098. After pressing SPACE BAR for single step, the SP is now F096. We can seethe contents of STACK memory with command k. The contents of HL was saved in STACK.

9000>press r for user register display

AF=5800 BC=19F4 DE=C256 HL=9504 SP=F098 PC=9000 S=0 Z=0 AC=0 P=0 CY=09000>press SPACE bar for single step 9000 E5 PUSH H

AF=5800 BC=19F4 DE=C256 HL=9504 SP=F096 PC=9001 S=0 Z=0 AC=0 P=0 CY=09000>press k for STACK display

ADDR DATAF096 [04]F097 [95]F098 [C0]

9000>

Command ‘L’ loads Intel Hex file to memory. The Assembler and C compiler for8085 CPU produce standard Intel Hex file. The hex file contains machine code represented by ASCII letters. The example below uses Teraterm to download the hex file. The hex file is ASCII text file. So with the teraterm, we can go to Send File. We can let it show only file with .hex extension by typing *.hex. Then doubleclicks at the hex file.

The onboard dot LED will indicate downloading is on going. When completed, thereport will show number of byte received and print checksum error. If no error it will show 0 errors.

9080>load Intel hex file...000005 bytes loaded 0 errors

9080>

Command ‘M’ shows monitor call number. Some of common subroutines can be called through RST 1 with function number preloaded in register E.

9080>see input parameters in user manual

1Enn MVI E,function_numberCF RST 1

00 - demo

21

Page 22: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

01 - delay02 - cold_boot03 - scan04 - cin05 - cout06 - put_str07 - init_lcd08 - lcd_ready09 - clear_lcd0A - goto_xy0B - put_str_lcd0C - put_ch_lcd0D - demo2

9080>

Command ‘N’ sets new location pointer at prompt. The example sets new pointer to E000 and press ‘d’ to disassemble.

9080>new location = e000E000>disassemble...

E000 53 MOV D,EE001 32DE2A STA 2ADEE004 62 MOV H,DE005 25 DCR HE006 C9 RETE007 1C INR EE008 43 MOV B,EE009 CC4A05 CZ 054AE00C 2655 MVI H,55E00E 67 MOV H,AE00F 04 INR BE010 F3 DIE011 0E25 MVI C,25E013 54 MOV D,HE014 AF XRA AE015 C3F0C3 JMP C3F0

E018>

Command ‘Q’ sets location pointer at prompt to 9000 and sets user PC to 9000.

9000>

AF=5800 BC=19F4 DE=C256 HL=9504 SP=F096 PC=9000 S=0 Z=0 AC=0 P=0 CY=0

22

Page 23: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

9000>

Command ‘R’ displays user registers contents.

9000>

AF=5800 BC=19F4 DE=C256 HL=9504 SP=F098 PC=9000 S=0 Z=0 AC=0 P=0 CY=09000>

Command ‘S’ sets value to user registers.

9013>set value to user register (enter A for AF) ?AF=0404 ff009013>

AF=FF00 BC=19F4 DE=0434 HL=0534 SP=F096 PC=9006 S=0 Z=0 AC=0 P=0 CY=09013>

Command ‘W’ prints watch variables.

9013>F000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Command ‘SPACEBAR’ executes the instruction at address in user PC. The instruction will show on screen with user registers result after execution.

Suppose we write a program as shown below. org 9000h

xra a

loop: out 0 mov h,a inr h push h pop d mov a,d jmp loop

end

Then translate it to machine code file using the Assembler program. Download hex file.

9000>load Intel hex file...000011 bytes loaded 0 errors

23

Page 24: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

9000>disassemble...

9000 AF XRA A9001 D300 OUT 009003 67 MOV H,A9004 24 INR H9005 E5 PUSH H9006 D1 POP D9007 7A MOV A,D9008 C30190 JMP 9001900B 00 NOP900C 00 NOP900D 00 NOP900E 00 NOP900F 00 NOP9010 00 NOP9011 00 NOP9012 00 NOP

9013>print user register with command r

AF=5800 BC=19F4 DE=C256 HL=1234 SP=F098 PC=9000 S=0 Z=0 AC=0 P=0 CY=09013>press SPACE key to execute instruction at 9000, we see A=00

9000 AF XRA A

AF=0044 BC=19F4 DE=C256 HL=1234 SP=F098 PC=9001 S=0 Z=1 AC=0 P=1 CY=09013>press SPACE key, the content of A will send to GPIO

9001 D300 OUT 00

AF=0044 BC=19F4 DE=C256 HL=1234 SP=F098 PC=9003 S=0 Z=1 AC=0 P=1 CY=09013>press SPACE key, the content of A will copy to H 9003 67 MOV H,A

AF=0044 BC=19F4 DE=C256 HL=0034 SP=F098 PC=9004 S=0 Z=1 AC=0 P=1 CY=09013> press SPACE key, the content of H will increment by 1 9004 24 INR H

AF=0000 BC=19F4 DE=C256 HL=0134 SP=F098 PC=9005 S=0 Z=0 AC=0 P=0 CY=09013> press SPACE key, the content SP will decrement by 2 9005 E5 PUSH H

AF=0000 BC=19F4 DE=C256 HL=0134 SP=F096 PC=9006 S=0 Z=0 AC=0 P=0 CY=09013> press K, to see the content of STACK memory

ADDR DATAF096 [34]F097 [01]F098 [C0]

9013> press SPACE key, DE will be loaded with top of STACK 9006 D1 POP D

AF=0000 BC=19F4 DE=0134 HL=0134 SP=F098 PC=9007 S=0 Z=0 AC=0 P=0 CY=09013> press SPACE key, the content of D will copy to A

24

Page 25: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

9007 7A MOV A,D

AF=0100 BC=19F4 DE=0134 HL=0134 SP=F098 PC=9008 S=0 Z=0 AC=0 P=0 CY=09013> press SPACE key, PC will be loaded with 9001 9008 C30190 JMP 9001

AF=0100 BC=19F4 DE=0134 HL=0134 SP=F098 PC=9001 S=0 Z=0 AC=0 P=0 CY=09013> press SPACE key, the content of A will send to GPIO, see LED! 9001 D300 OUT 00

AF=0100 BC=19F4 DE=0134 HL=0134 SP=F098 PC=9003 S=0 Z=0 AC=0 P=0 CY=0

25

Page 26: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Hardware

A block diagram of the MTK-85 board is shown below. For complete hardware schematic, see Appendix D.

CPU

The CPU is a CMOS 80C85. The XTAL frequency is 4MHz. The reset signal is generated by simple RC circuit. The CPU is protected by brownout circuit. In case of power supply is dipped caused by AC supply voltage dropped. Thebrownout circuit detects VCC, if it is below threshold level, it will reset the CPU.

The brownout condition can be tested by using a variable power supply. To test it, adjust the board VIN from 0-12V slowly and see the CPU can start running properly or not.

Memory

The onboard has 64kB memory. The 32kB ROM monitor 27C256 is placed at address 0000-7FFFH. And the 32kB SRAM 62256, is placed at address 8000H-FFFFH.

Some of interrupt vectors are relocated to RAM, so user can write the jump instruction to the location of such interrupt service routine easily. Here is the location of interrupts.

26

Page 27: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

8010H RST 28018H RST 38020H RST 48028H RST 5802CH RST 5.58030H RST 68034H RST 6.5803CH RST 7.5

Note:1. RST 7 is used for software breakpoint.2. RST 1 is used for monitor function call.3. TRAP is used for hardware single-step.4. RST 7.5 is tied to OUT0 of 8254 programmable counter.5. Monitor program uses last page of RAM for data storage, STACK area, and

monitor control functions. The space is from F000H to F098H.

GPIO

GPIO provides 4-bit output port using D type F-F, 74LS175 and 4-bit input port using tri-state buffer, 74LS126. The address is 00 for both ports. The low-nibble D0-D3 is output port. The higher-nibble D4-D7 is input port. The signal from bothports appeared at J1, 16-pin header.

27

Page 28: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

System Programmable Port 8255

The I/O addresses of system port, 8255 are PORTA=10H, PORTB=11H, PORTC=12H and Control Port = 13H. Buzzer control pin is PORT C bit 7. To enable buzzer, write 7FH to PORTC.

User Programmable Port 8255

The board provides a user programmable parallel port, 8255. The 8255’s registers are mapped to I/O address from 30H to 33H.

30H PORTA31H PORTB32H PORTC33H CONTROL PORT

Programmable Counter 8254

The programmable counter, 8254 was supplied with clock signal from CLOCKOUT or 2MHz for counter0 and counter1. The internal registers of 8254 are mapped to I/O space from 20H to 23H.

28

Page 29: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

20H COUNTER021H COUNTER122H COUNTER223H CONTROL REGISTER

29

Page 30: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Headers and Connectors

CPU Header JP1

User 8255 and 8254 Header JP1

30

Page 31: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Onboard LCD Header JR1

RS232C DB9 male connector VB1

31

Page 32: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Interrupts Test Button

The interrupt test button provides a single positive pulse that tied to CPU hardwareinterrupt pins, RST5.5, RST6.5 and INTR. User can select the pulse to be triggered for each pin by dip switch SW1. The onboard LED, D4 indicates the pulse is activated when press Test button.

Technical Specifications

CPU: CMOS 80C85 @4MHzMemory: 64kB, 32kB 27C256, 32kB 62256I/O port: Programmable Parallel port 8255x2, 8-bit GPIOCounter: Programmable Counter 8254UART: 16-byte FIFO TL16C550 compatibleROM monitor: 8085.asm Brownout Protection: KIA7045 Board Size: 8.90 x 8.13 inchWeight: 320g (complete components except LCD)DC Power Supply: AC-to-DC adapter 6V-12V 400mAPower consumption: (350mA @12VDC)

Monitor Call Number

00 - demoScan 7-segment display with buffer display pointed by HLEntry: HLExit: none

01 - delayDelay subroutine using register pair DE, D is outer loop delay, E is inner loop.Entry: DEExit: none

02 - cold_bootDisplay cold-boot message on 7-segment LED. Entry: none

03 - scanScan keyboard and display one cycle. Entry: HL points the display bufferExit: key = scan code –1 no key pressed

32

Page 33: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

04 - cinGet character from console Entry: noneExit: A = character received

05 - coutSend character to console Entry: A = character to be sentExit: none

06 - put_strPrint string to console, string is terminated by 0. Entry: HLExit: none

07 - init_lcdInitialize LCD module Entry: noneExit: none

08 - lcd_readyWait until LCD module is ready. Entry: noneExit: none

09 - clear_lcdClear LCD display Entry: noneExit: none

0A - goto_xySet cursor position of LCD Entry: HL, H = x, L = y Exit: none

0B - put_str_lcdPrint string to LCD, string is terminated by 0 Entry: HLExit: none

0C - put_ch_lcdPrint character to LCD at current cursor position

33

Page 34: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Entry: AExit: none

0D - demo2Running GPIO LEDEntry: noneExit: none

NVRAM Bootable

User can replace U3, SRAM with a Nonvolatile RAM for program storage, when the board is power off. A JMP instruction placed at 8000H will enable NVRAM bootable. The monitor program checks the location 8000H. If it has C3 (opcode of JMP instruction), it will jump to address 8000H. The feature allows application code to run easily. The monitor subroutines are still available for the application program.

To get back to monitor mode, user can press USER key while press RESET. The byte C3 at location 8000H will change to 00.

The sample code that demonstrates NVRAM Bootable is shown in Appendix D.

34

Page 35: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix A Onboard LCD Driver Routines

;------------------- onboard LCD registers -----------------command_write equ 50hcommand_read equ 52hdata_write equ 51hdata_read equ 53hbusy equ 80h

;--------------------- LCD driver routines -----------------lcd_ready: push psw

lcd_ready1: in command_read ani busy jnz lcd_ready1 ; wait until lcd ready pop psw

ret

clear_lcd: call lcd_ready mvi a,1 out command_writeexit_clear: ret

init_lcd: call lcd_ready mvi a,38h out command_write call lcd_ready mvi a, 0ch out command_write call clear_lcd

ret

; print ASCII text on LCD; entry: HL pointer with 0 for end of string

put_str_lcd: mov a,m ; get A from [HL] cpi 0 jnz put_str_lcd1 ret

put_str_lcd1:

call lcd_ready

35

Page 36: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

out data_write inx h jp put_str_lcd

; goto_xy set cursor location on lcd; entry: HL: H = x, L = y

goto_xy: call lcd_ready mov a,l cpi 0 jnz goto_xy1 mov a,h adi 80h out command_write ret

goto_xy1: cpi 1 jnz goto_xy2 mov a,h adi 0c0h out command_write ret

goto_xy2: cpi 2 jnz goto_xy3 mov a,h adi 094h out command_write ret

goto_xy3: cpi 3 jnz goto_xy4 mov a,h adi 0d4h out command_write ret

goto_xy4: ret

; put_ch_lcd put character to lcd; entry: A

put_ch_lcd: call lcd_ready out data_write ret

36

Page 37: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix B Subroutine Scan keyboard and Display

; subroutine scan keyboard and display; entry: hl pointer to display buffer; exit: key = scan code; -1 no key pressed;

scan: push h push b push d

mvi c,6 ; for 6-digit LED mvi e,0 ; digit scan code appears at 4-to-10

decoder mvi d,0 ; key position mvi a,0ffh ; put -1 to key sta key ; key = -1

scan1: mov a,e ori 0f0h ; high nibble must be 1111 out system_port_c ; active digit first mov a,m ; load a with [hl] out system_port_b ; then turn segment on

mvi b,0 ; delay for electron transition process wait1: dcr b jnz wait1

in system_port_a ; read input port

mvi b,8 ; check all 8-rowshift_key: rar ; rotate right through carry jc next_key ; if carry = 1 then no key

pressed

push psw mov a,d sta key ; save key position pop psw

next_key: inr d ; next key position

dcr b ; until 8-bit was shifted jnz shift_key

37

Page 38: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

mvi a,0 ; clear a out system_port_b ; turn off led

inr e ; next digit scan code inx h ; next location

dcr c ; next column jnz scan1

pop d pop b pop h ret

;---------- 8255 PPI system port I/O address ---------------system_port_a: equ 10hsystem_port_b: equ 11hsystem_port_c: equ 12hsystem_port_control: equ 13h

38

Page 39: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix C UART Driver Routines

;---------- 16C550 compatible UART I/O address ------------; e.g. UM8250B, 16C450, 16C550

uart_buffer: equ 40huart_line_status: equ 45huart_fifo: equ 42huart_lcr: equ 43huart_divisor_lsb: equ 40huart_divisor_msb: equ 41huart_scr: equ 47h

; initialize 16C550 uart to 9600 8n1 with 2MHz clock; 2MHz/13 = 153846Hz

init_uart:

mvi a,83h out uart_lcr ; set DLAB bit to access divider

mvi a,13 out uart_divisor_lsb mvi a,0 out uart_divisor_msb ; 2MHz/13 = 153846 Hz ; 153846Hz/16 = 9615Hz mvi a,7 out uart_fifo ; init fifo and clear all buffers mvi a,03h out uart_lcr ; clar DLAB

; check uart line status, if the byte is FF then no uart;; xra a out uart_scr ; check if there is uart in uart_scr cpi 0 jz found xra a sta uart_found ret

found mvi a,1 sta uart_found ret

39

Page 40: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

cout: mov b,a ; save a

cout1: in uart_line_status ani 20h ; transmitter ready? jz cout1

mov a,b ; restore a out uart_buffer ret

cin: in uart_line_status ani 1 ; data available? jz cin in uart_buffer ret

; print string terminated by 0; input: HL

put_str: mov a,m ; get A from [HL] cpi 0 jnz put_str1 ret

put_str1: call cout inx h jp put_str

40

Page 41: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

41

Page 42: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix D Using NVRAM Bootable

; MTK-85 8085 Microprocessor Training Kit; exp1.asm;; Using 8254 to produce 30.52Hz interrupt signal at RST7.5;; The 8254 counter0 was loaded with 0000 by system monitor.; The input clock to the 8254 is 2MHz, the OUT0 then

produces; 2MHz/65536 = 30.52Hz interrupt at RST7.5!; CPU "8085.TBL" ;CPU TABLE HOF "INT8" ;HEX FORMATgpio equ 0

; enable NVRAM boot running

org 8000h jmp start ; put instruction JMP to boot from

RAM

org 803ch ; interrupt vector of RST7.5 (relocated from 003CH)

jmp service_rst7.5

org 8100h

start: mvi a,11111011b ; enable rst7.5 sim ; set interrupt mask register ei ; enable interrupt

jmp $ ; jump here

service_rst7.5:

lda count ; increment count inr a sta count out gpio ; write to onboard LED ei ret

org 0e000h

42

Page 43: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

count dfs 1 ; use RAM one byte for count variable

end

43

Page 44: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix E Machine code and 8085 Instructions

44

Page 45: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

!""#$%&'()(*+,-&$#(./%#(+$%(*$#0/$&,(/1(2324(5$6789,7&/$6

MOVE, LOAD and STORE

40 MOV B,B41 MOV B,C42 MOV B,D43 MOV B,E44 MOV B,H45 MOV B,L46 MOV B,M47 MOV B,A48 MOV C,B49 MOV C,C4A MOV C,D4B MOV C,E4C MOV C,H4D MOV C,L4E MOV C,M4F MOV C,A50 MOV D,B51 MOV D,C52 MOV D,D53 MOV D,E54 MOV D,H55 MOV D,L56 MOV D,M57 MOV D,A58 MOV E,B59 MOV E,C5A MOV E,D5B MOV E,E5C MOV E,H5D MOV E,L5E MOV E,M5F MOV E,A60 MOV H,B61 MOV H,C62 MOV H,D63 MOV H,E64 MOV H,H65 MOV H,L66 MOV H,M67 MOV H,A68 MOV L,B69 MOV L,C6A MOV L,D6B MOV L,E6C MOV L,H6D MOV L,L

6E MOV L,M6F MOV L,A70 MOV M,B71 MOV M,C72 MOV M,D73 MOV M,E74 MOV M,H75 MOV M,L77 MOV M,A78 MOV A,B79 MOV A,C7A MOV A,D7B MOV A,E7C MOV A,H7D MOV A,L7E MOV A,M7F MOV A,A

3E nn MVI A,byte06 nn MVI B,byte0E nn MVI C,byte16 nn MVI D,byte1E nn MVI E,byte26 nn MVI H,byte2E nn MVI L,byte36 nn MVI M,byte

01 nnnn LXI B,dble11 nnnn LXI D,dble21 nnnn LXI H,dble31 nnnn LXI SP,dble

02 STAX B12 STAX D0A LDAX B1A LDAX D32 nnnn STA adr3A nnnn LDA adr22 nnnn SHLD adr2A nnnn LHLD adrEB XCHG

STACK

C5 PUSH BD5 PUSH DE5 PUSH HF5 PUSH PSW

Page 46: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

C1 POP BD1 POP DE1 POP HF1 POP PSWE3 XTHLF9 SPHL33 INX SP3B DCX SP

ARITHEMATICS

C6 nn ADI byteCE nn ACI byte

80 ADD B81 ADD C82 ADD D83 ADD E84 ADD H85 ADD L86 ADD M87 ADD A88 ADC B89 ADC C8A ADC D8B ADC E8C ADC H8D ADC L8E ADC M8F ADC A

D6 nn SUI byteDE nn SBI byte

90 SUB B91 SUB C92 SUB D93 SUB E94 SUB H95 SUB L96 SUB M97 SUB A98 SBB B99 SBB C9A SBB D9B SBB E9C SBB H9D SBB L9E SBB M9F SBB A

09 DAD B19 DAD D29 DAD H39 DAD SP

LOGICAL

E6 nn ANI byteEE nn XRI byteF6 nn ORI byteA0 ANA BA1 ANA CA2 ANA DA3 ANA EA4 ANA HA5 ANA LA6 ANA MA7 ANA AA8 XRA BA9 XRA CAA XRA DAB XRA EAC XRA HAD XRA LAE XRA MAF XRA AB0 ORA BB1 ORA CB2 ORA DB3 ORA EB4 ORA HB5 ORA LB6 ORA MB7 ORA A

COMPARE

FE nn CPI byteB8 CMP BB9 CMP CBA CMP DBB CMP EBC CMP HBD CMP LBE CMP MBF CMP A

ROTATE

Page 47: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

07! RLC17 RAL0F RRC1F RAR

JUMP

C3 nnnn JMP adrDA nnnn JC adrD2 nnnn JNC adrCA nnnn JZ adrC2 nnnn JNZ adrF2 nnnn JP adrFA nnnn JM adrEA nnnn JPE adrE2 nnnn JPO adrE9 PCHL

CALL

CD nnnn CALL adrDC nnnn CC adrD4 nnnn CNC adrCC nnnn CZ adrC4 nnnn CNZ adrF4 nnnn CP adrFC nnnn CM adrEC nnnn CPE adrE4 nnnn CPO adr

RETURN

C9 RETD8 RCD0 RNCC8 RZC0 RNZF0 RPF8 RME8 RPEE0 RPO

RESTART

C7 RST 0CF RST 1D7 RST 2DF RST 3E7 RST 4EF RST 5

F7 RST 6FF RST 7

INPUT/OUTPUT

DB nn IN byteD3 nn OUT byte

INCREMENT/DECREMENT

04 INR B0C INR C14 INR D1C INR E24 INR H2C INR L34 INR M3C INR A03 INX B13 INX D23 INX H05 DCR B0D DCR C15 DCR D1D DCR E25 DCR H2D DCR L35 DCR M3D DCR A0B DCX B1B DCX D2B DCX H

SPECIALS

2F CMA37 STC3F CMC27 DAA

CONTROL

00! NOPF3 DIFB EI76 HLT20 RIM30 SIM

Page 48: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix F Hardware schematic

45

Page 49: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

55

44

33

22

11

DD

CC

BB

AA

0x0000-0x7FFF

Monitor

Program

0x8000-0xFFFF

32kB

SRAM,

NVRAM

memory

&i/o

decoder

NO

NC

<Doc>

2

8085 Microprocesssor Training Kit

B

14

Saturday, July 30, 2005

Title

Size

Docum

ent Num

berR

ev

Date:

Sheet

of

D2

D6

A12

/RD

D1

A[8..14]

ALE

D0

D1

D2

D3

A9

/RD

RA

M_C

E

A11

D3

A8

D0

D5

A11

/WR

D1

D0

A11

D5

D0

A10

D7

D2

D4

D7

D6

D3

A15

/WR

A9

A6

D[0..7]

A9

A8

A13

/RD

D5

D6

D4

D3

A8

A14

A13

D2

A12

A14

A10

A10

D5

A5

D6

A12A

13

D4

A15

D7

D1

D7

A14

RO

M_C

E

D4

ALE

RE

SE

T_IN

IO/M

RA

M_C

ER

OM

_CE

SO

D

SID

RE

SE

T_OU

T

D0

D1

D2

D3

D4

D5

D6

D7

/RD

SO

D

S1

CLK

OU

T

SID

ALE

/WR

S0

RE

AD

Y

IO/M

A4

A6

A7

A2

A3

A0

A5

A1

*INTR

*RS

T6.5*R

ST7.5

INTA

HO

LD

*RS

T5.5

RE

SE

T_OU

TH

LDA

HO

LD

INTA

CLK

OU

T

A7

HLD

AR

EA

DY

A3

A2

A7

A3

A3

A5

A4

A4

A4

A7

A1

A2

A0

A2

A[0..7]

A6

A1

A1

A6

A0

A4

A5

A0

A5

A6

A7

TRA

P

RS

T5.5

S0

ALE

TRA

P

S1

S0

S1

INTR

RS

T7.5R

ST6.5

*RS

T5.5

*RS

T6.5

*INTR

RS

T5.5

RS

T6.5

RS

T7.5

INTR

D0

D1

D2

D3

D4

D5

D6

D7

GP

IO_LE

D1

GP

IO_LE

D2

GP

IO_LE

D3

GP

IO_LE

D4

GP

IO/WR

/RD

RE

SE

T_IN

GP

IO_LE

D1

GP

IO_LE

D2

GP

IO_LE

D3

GP

IO_LE

D4

VS

S

SID

SY

STE

M_P

PI

GP

IO

D[0..7]

reset

CTC

US

ER

_PP

IU

AR

TLC

D_E

A[0..7]

CLK

OU

T

WR

RD

TRA

CE

*RS

T7.5

VC

C

+5V

+5V

+5V+5V

+5V

+5V

+5V

+5V

+5V

+5V+5V

VC

C

+5V

+5V

+5V

R3

4.7k

J1

13579111315

246810121416

++++++++

++++++++

U25

KIA

7045

1 2 3

VC

CG

ND

OU

T

U9E

74LS04

1110

D4LE

D

U9A

74LS04

12

U9B

74LS04

34

U9F

74LS04

1312

U9C

74LS04

56

U4

74HC

573

1 1120

1918171615141312

23456789

OE

LEVC

C

1Q2Q3Q4Q5Q6Q7Q8Q

1D2D3D4D5D6D7D8D

R1

100k

U9D

74LS04

98

U6D

4001

121311

U2

27C256

109876543252421232262720221

1112131516171819

A0

A1

A2

A3

A4

A5

A6

A7

A8

A9

A10

A11

A12

A13

A14

CE

OE

VP

P

O0

O1

O2

O3

O4

O5

O6

O7

U3

HM

62256B

109876543252421232261202227

1112131516171819

A0

A1

A2

A3

A4

A5

A6

A7

A8

A9

A10

A11

A12

A13

A14

CE

OE

WE

D0

D1

D2

D3

D4

D5

D6

D7

U10

74LS164

1289

345610111213

ABCLK

CLR

QA

QB

QC

QD

QE

QF

QG

QH

SW

2

PS

2273

213

R7

330

U7

MS

M80C

85A

361256987101129333935

1213141516171819212223242526272830313234337438

RS

T-IN

X1

X2

SID

TRA

P

RS

T 5.5R

ST 6.5

RS

T 7.5

INTR

INTA

S0

S1

HO

LD

RE

AD

Y

AD

0A

D1

AD

2A

D3

AD

4A

D5

AD

6A

D7

A8

A9

A10

A11

A12

A13

A14

A15

ALE

WR

RD

IO/M

RS

T-OT

CLK

OS

OD

HLD

A

D1

1N4148

R5

4.7k

U6A

4001

123

R2

1k

U6B

4001

564

D2

LED

D3

LED

D5

LED

R4

4.7k

D6

LED

R10

4.7k

SW

1

SW

DIP

-4/SM

1234

8765

U1

74LS175

45121391

237610111514

D1

D2

D3

D4

CLK

CLR

Q1

Q1

Q2

Q2

Q3

Q3

Q4

Q4

U5

74LS126

1 23

4 568

910

111213

1OE 1A

1Y

2OE 2A

2Y3Y3A

3OE

4Y4A

4OE

U8

GA

L16V8D

111

1213141516171819

23456789

I/CLK

I/OE

I/O/Q

I/O/Q

I/O/Q

I/O/Q

I/O/Q

I/O/Q

I/O/Q

I/O/Q

IIIIIIII

U6C

4001

8910

Q1

4MH

z

+C

31uF

JP1

HE

AD

ER

20X2

12

34

56

78

910

1112

1314

1516

1718

1920

2122

2324

2526

2728

2930

3132

3334

3536

3738

3940

S1

RE

SE

T

R21

4.7k

R6

330

C1

47pF

R15

4.7k

R8

330

C2

47pF

R9

330

R11

330

Page 50: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

55

44

33

22

11

DD

CC

BB

AA

COMMON

CATHODE

6-DIGIT

7-SEGMENT

LED

user_key1

user_key2

0x10-0x13

<Doc>

2

8085 Microprocessor Training Kit

B

24

Saturday, July 30, 2005

Title

Size

Docum

ent Num

berR

ev

Date:

Sheet

of

SP

EA

KE

R

PA

0P

A1

PA

2P

A3

PA

4P

A5

PC

0P

C1

PC

2P

C3

PC

3

PC

0

PC

2P

C1

PA

7P

A6

PA

0P

A1

PA

2P

A3

PA

4P

A5

PA

6P

A7

PB

7P

B6

PB

5P

B4

PB

3P

B2

PB

1P

B0

PB

0P

B1

PB

2P

B3

PB

4P

B5

PB

6P

B7

D7

D1

D6

D0

D2

D5

D4

D3

A1

A0

SP

EA

KE

R

PA

7

PA

6

A0

A4

A5

A6

A1

A2

A3A7

PC

5P

C4

VS

S

TRA

CE

reset

D[0..7]

SY

STE

M_P

PI

A[0..7]

RD

WR

VC

C+5V

+5V

VC

C

+5V

SW

18

U12

TOS

-5161AE

764219105

38 a

bcdefg

dp

com1com2

SW

28

U16

TOS

-5161AE

764219105

38 a

bcdefg

dp

com1com2

U18

74LS145

15141312

123456791011

ABCD

0123456789

R13

100

SW

22

U19

8255

34 33 32 31 30 29 28 27 5 36 9 8 35 6

4 3 2 1 40 39 38 37 18 19 20 21 22 23 24 2514 15 16 17 13 12 11 10

D0

D1

D2

D3

D4

D5

D6

D7

RD

WR

A0

A1

RE

SE

TC

S

PA

0P

A1

PA

2P

A3

PA

4P

A5

PA

6P

A7

PB

0P

B1

PB

2P

B3

PB

4P

B5

PB

6P

B7

PC

0P

C1

PC

2P

C3

PC

4P

C5

PC

6P

C7

U17

TOS

-5161AE

764219105

38 a

bcdefg

dp

com1com2

Q2

BC

327

1

2

3

SW

26

SW

29

SW

PU

SH

BU

TTON

U14

TOS

-5161AE

764219105

38 a

bcdefg

dp

com1com2

U15

TOS

-5161AE

764219105

38 a

bcdefg

dp

com1com2

SW

4S

W6

SW

11

SW

23

SW

9

C

R14

4.7k

123456789

SW

15

SW

19

SW

13

SW

17

SU

1

SP

EA

KE

R

SW

27

U11

74LS244

246811131517119

181614129753

1A1

1A2

1A3

1A4

2A1

2A2

2A3

2A4

1G2G

1Y1

1Y2

1Y3

1Y4

2Y1

2Y2

2Y3

2Y4

SW

21

R12

R-P

AC

K

116

215

314

413

512

611

710

89

U13

TOS

-5161AE

764219105

38 a

bcdefg

dp

com1com2

SW

7

SW

25

SW

12

SW

16

SW

5

SW

20

SW

3

SW

10

SW

8

SW

14

SW

24

Page 51: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

55

44

33

22

11

DD

CC

BB

AA

text

LCD

R/W

RS

RS232

level

converter

User

PPI

counter/timer

UART

0x20-0x23

0x30-0x33

0x40-0x47

0x50-0x53

2MHz

<Doc>

2

8085 Microprocessor Training Kit

B

34

Saturday, July 30, 2005

Title

Size

Docum

ent Num

berR

ev

Date:

Sheet

of

D2

D3

D4

D7

D5

D6

D0

D1

D2

D3

D4

D7

D5

D6

D0

D1

D2

D3

D4

D7

D5

D6

D0

D1 A

0A

1

A1

A0

A0

A1

A2

D2

D3

D0

D4

D1

D6

D5

LCD

_EA1

D7

A0

A3A7

A4

A2

A1

A5

A0

A6

US

ER

_PA

5U

SE

R_P

A6

US

ER

_PA

0

US

ER

_PA

3U

SE

R_P

A2

US

ER

_PA

4

US

ER

_PA

1

US

ER

_PA

7

TxD

RxD

TxD

RxD

DC

D

DC

D

RTS

RTS

VS

S

US

ER

_PA

7U

SE

R_P

A6

US

ER

_PA

5U

SE

R_P

A4

US

ER

_PA

3U

SE

R_P

A2

US

ER

_PA

1U

SE

R_P

A0

resetU

SE

R_P

PI

CTC

UA

RT

D[0..7]

A[0..7]

CLK

OU

T

*RS

T7.5

LCD

_E

WR

RD

WR

RD

WR

RD

reset

VC

C

+5V

+5V

+5V

+5V

+5V

VC

C

+5V

+5V

U22

8255

343332313029282753698356

43214039383718192021222324251415161713121110

D0

D1

D2

D3

D4

D5

D6

D7

RD

WR

A0

A1

RE

SE

TC

S

PA

0P

A1

PA

2P

A3

PA

4P

A5

PA

6P

A7

PB

0P

B1

PB

2P

B3

PB

4P

B5

PB

6P

B7

PC

0P

C1

PC

2P

C3

PC

4P

C5

PC

6P

C7

U21

8254

876543212223192021

91110151413181617

D0

D1

D2

D3

D4

D5

D6

D7

RD

WR

A0

A1

CS

CLK

0G

0O

UT0

CLK

1G

1O

UT1

CLK

2G

2O

UT2

U20

TL16C550A

10

11

121314 1819212225353637383916

9

282726

123456783431232429303233

17

15

SD

I

SD

O

CS

0C

S1

CS

2

WR

1W

R2

RD

1R

D2

AD

SM

RC

TSD

SR

DC

DRI

XIN

RC

LK

A0

A1

A2

D0

D1

D2

D3

D4

D5

D6

D7

OU

T1O

UT2

DD

ISTX

RD

YR

XR

DY

INTR

PT

RTS

DTR

XO

UT

BA

UD

OU

T

SW

30

backlight

213

JR1

CO

NN

RE

CT 16

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

+

C7

10uF

+

C8

10uF

+

C9

10uF R17

4.7kR

184.7k

R19

10K

13

2

U23

MA

X232A

138

1110 1345

26

129

147R

1INR

2IN

T1INT2IN C

+C

1-C

2+C

2-

V+

V-

R1O

UT

R2O

UT

T1OU

TT2O

UT

+

C6

10uF 10V

VB

1

SU

B-D

9, (male) use straight cable

594837261

JP2

HE

AD

ER

20X2

12

34

56

78

910

1112

1314

1516

1718

1920

2122

2324

2526

2728

2930

3132

3334

3536

3738

3940

Page 52: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

55

44

33

22

11

DD

CC

BB

AA

<Doc>

8085 Microprocessor Training Kit

B

44

Saturday, July 30, 2005

Title

Size

Docum

ent Num

berR

ev

Date:

Sheet

of

VS

S

VC

C

+5V

+5V

+5V

+5V

VC

C

C16

0.1uFC

120.1uF

+C

2610uF

J5

CO

N3

123

+C

111000uF25V

TP1

+5V1TP

2

GN

D1

C21

0.1uFC

220.1uF

C17

0.1uF

+C

2410uF

C23

0.1uF

J6

DC

Input

12

R20

2k

+C

2510uF

+C

10

10uF 16VC

13

0.1uF

D7

PO

WE

R LE

D (red)

C14

0.1uF

U24

LM2490-5.0

1

2

3V

IN

GND

VO

UT

C18

0.1uF

C20

0.1uF

D8

1N4007

12

+C

2710uF

C19

0.1uF

C15

0.1uF

Page 53: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

Appendix G Monitor source code listing

46

Page 54: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

123456789

10111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576

;----------------------------------------------------------------- ; A8085.ASM ; monitor program for MTK-85 8085 MICROPROCESSOT TRAINING KIT ; COPYRIGHT (C) 2007-2015 BY WICHIT SIRICHOTE, [email protected] ; ; source file was assembled with C32 Cross Assembler V3.0 ; ; 18 May 2007 add insert byte, ALT E ; delete byte, ALT D ; click sound when key pressed ; ; 8 March 2015 remove repeat key ; modified address and data entry mode ; ;----------------------------------------------------------------- 0000 CPU "8085.TBL" ;CPU TABLE 0000 HOF "INT8" ;HEX FORMAT ; ---------- onboard GPIO -------------------------------------- 0000 = gpio equ 0 ; D0-D3 is 4-bit output port, D4-D7 is 4-bit input port ;---------- 8255 PPI system port I/O address ---------------------- 0010 = system_port_a: equ 10h 0011 = system_port_b: equ 11h 0012 = system_port_c: equ 12h 0013 = system_port_control: equ 13h ;-------------------- 8254 counter/timer -------------------------- 0020 = counter0_8254 equ 20h 0021 = counter1_8254 equ 21h 0022 = counter2_8254 equ 22h 0023 = control_8254 equ 23h 0034 = control_word_8254 equ 00110100B ; mode 0, counter0 ;---------- 8255 PPI user port I/O address ------------------------ 0030 = user_port_a: equ 30h 0031 = user_port_b: equ 31h 0032 = user_port_c: equ 32h 0033 = user_port_control: equ 33h ;---------- 16C550 compatible UART I/O address -------------------- ; e.g., UM8250B, 16C450, 16C550 0040 = uart_buffer: equ 40h 0045 = uart_line_status: equ 45h 0042 = uart_fifo: equ 42h 0043 = uart_lcr: equ 43h 0040 = uart_divisor_lsb: equ 40h 0041 = uart_divisor_msb: equ 41h 0047 = uart_scr: equ 47h ;------------------- onboard LCD registers ------------------------ 0050 = command_write equ 50h 0052 = command_read equ 52h 0051 = data_write equ 51h 0053 = data_read equ 53h 0080 = busy equ 80h 0009 = TAB EQU 9 ; ASCII TAB 0000 = RS EQU 0 ; terminator 000D = cr: equ 0dh 000A = lf: equ 0ah 0020 = sp: equ 20h

A8085.LST 29/3/2558 15:27

Page 1 of 63

Page 55: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

7778798081828384858687888990919293949596979899

100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152

F000 = system_ram equ 0f000h ;system_stack equ 0ffffh 8100 = home_address equ 8100h 0000 = rom equ 0000h ; change to 8000 for testing under RAM ; chnage to 0000 for rom programming 8000 = my_rom equ 8000h 0000 ORG rom 0000 C30001 JMP START ; reset vector 0008 ORG rom+8 ; RST 1 opcode is CF 0008 C35C02 jmp monitor_call 0010 ORG rom+10h ; RST 2 used for testing RST 7 ; jmp service_rst2 0010 C31080 jmp my_rom+10h 0018 ORG rom+18h ; DF RST 3 for testing monitor call function in RAM 0018 C31880 jmp my_rom+18h ; jmp monitor_call 0020 ORG rom+20h ; RST 4 0020 C32080 jmp my_rom+20h 0024 ORG rom+24h ; jmp my_rom+24h 0024 C3D802 jmp service_trap ; sing step running service routine 0028 ORG rom+28h ; RST 5 0028 C32880 jmp my_rom+28h 002C ORG rom+2ch ; relocate RST5.5 to external ram 002C C32C80 jmp my_rom+2ch 0030 ORG rom+30h ; relocate RST 6 0030 C33080 jmp my_rom+30h 0034 ORG rom+34h ; relocate RST6.5 to external ram 0034 C33480 jmp my_rom+34h 0038 ORG ROM+38H 0038 C38E02 jmp service_rst7 ; RST 7 service jump back to monitor 003C ORG rom+3ch ; relocate RST7.5 to external ram 003C C33C80 jmp my_rom+3ch 0100 ORG rom+100h 0100 F3 START di 0101 3178F0 lxi sp,system_stack+32 ; point to top of system stack 0104 2198F0 lxi h,user_stack+32 ; point to top of user stack 0107 2233F0 shld user_SP 010A 3E90 MVI A,90H 010C D313 OUT system_port_control 010E 3EF0 mvi a,0f0h ; disable trap 0110 D312 out system_port_c 0112 CDED11 call init_uart 0115 CD0302 call init_lcd 0118 218B1D lxi h,prompt2 011B CD1502 call put_str_lcd 011E 210100 lxi h,01 0121 CD2502 call goto_xy

A8085.LST 29/3/2558 15:27

Page 2 of 63

Page 56: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228

0124 21A01D lxi h,text3 0127 CD1502 call put_str_lcd 012A CD8A01 call init_8254 ; NVRAM booting ; if location 8000H has C3 opcode then jump to 8000H ; if user press USER1 with RESET put 00 to 8000H ; ans skip booting 012D DB10 in system_port_a 012F E680 ani 80h 0131 CA4101 jz skip_boot 0134 3A0080 lda 8000H 0137 FEC3 cpi 0c3h 0139 C24101 jnz skip_boot 013C 210080 lxi h,8000h 013F E5 push h 0140 C9 ret ; jump to NVRAM 0141 AF skip_boot: xra a ; write 00 to 8000H 0142 320080 sta 8000H 0145 3226F0 sta counter1 ; clear counter1 0148 3A28F0 lda warm_code 014B FE24 cpi "$" 014D CA5F01 jz skip_cold_boot 0150 3E24 mvi a,"$" 0152 3228F0 sta warm_code 0155 CD2806 call test_buzzer 0158 3EFF mvi a,0ffh 015A D300 out gpio ; make GPIO LED on 015C CD5C0B call cold_boot 015F skip_cold_boot: 015F 210081 lxi h,home_address 0162 2229F0 shld user_PC 0165 223BF0 shld pointer 0168 3A24F0 lda uart_found 016B FE00 cpi 0 016D CA7601 jz skip_send_prompt 0170 CD9A12 call send_prompt3 0173 CD210D call send_prompt 0176 skip_send_prompt: 0176 AF xra a 0177 D300 out gpio ; turn LED off 0179 3E00 mvi a,0 017B 3225F0 sta entry_mode ; set data entry mode 017E CDA40A call read_memory 0181 CD640C main: call scan_key 0184 CD7C05 call key_execute 0187 F28101 jp main ;---------------- initialize counter0 for RST7.5 interrupt ---------------- 018A 3E34 init_8254: mvi a, control_word_8254 018C D323 out control_8254 018E AF xra a 018F D320 out counter0_8254

A8085.LST 29/3/2558 15:27

Page 3 of 63

Page 57: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304

0191 D320 out counter0_8254 0193 C9 ret ; convert 8-bit unsigned in A to ASCII string in line_buffer ; entry: A 0194 bin2ascii: 0194 1E00 mvi e,0 0196 FE64 bin1 cpi 100 0198 DAA101 jc bin2 019B D664 sui 100 019D 1C inr e 019E C39601 jmp bin1 01A1 57 bin2: mov d,a 01A2 7B mov a,e 01A3 C630 adi "0" 01A5 3246F0 sta line_buffer 01A8 7A mov a,d 01A9 1E00 mvi e,0 01AB FE0A bin3: cpi 10 01AD DAB601 jc bin4 01B0 D60A sui 10 01B2 1C inr e 01B3 C3AB01 jmp bin3 01B6 57 bin4: mov d,a 01B7 7B mov a,e 01B8 C630 adi "0" 01BA 3247F0 sta line_buffer+1 01BD 7A mov a,d 01BE C630 adi "0" 01C0 3248F0 sta line_buffer+2 01C3 C9 ret ; print 8-bit unsigned decimal to terminal ; entry: A 01C4 CD9401 pint8u: call bin2ascii 01C7 3A46F0 lda line_buffer 01CA FE30 cpi "0" 01CC CADF01 jz pint1 01CF CD1612 call cout 01D2 3A47F0 lda line_buffer+1 01D5 CD1612 call cout 01D8 3A48F0 lda line_buffer+2 01DB CD1612 call cout 01DE C9 ret 01DF 3A47F0 pint1: lda line_buffer+1 01E2 FE30 cpi "0" 01E4 CAEA01 jz pint2 01E7 CD1612 call cout 01EA 3A48F0 pint2: lda line_buffer+2 01ED CD1612 call cout 01F0 C9 ret ; convert 16-bit unsigned integer to ASCII code stored in line_buffer ; entry: HL ;--------------------- LCD driver routines --------------------------------

A8085.LST 29/3/2558 15:27

Page 4 of 63

Page 58: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380

01F1 F5 lcd_ready: push psw 01F2 DB52 lcd_ready1: in command_read 01F4 E680 ani 80h 01F6 C2F201 jnz lcd_ready1 ; wait until lcd ready 01F9 F1 pop psw 01FA C9 ret 01FB CDF101 clear_lcd: call lcd_ready 01FE 3E01 mvi a,1 0200 D350 out command_write 0202 C9 exit_clear: ret 0203 CDF101 init_lcd: call lcd_ready 0206 3E38 mvi a,38h 0208 D350 out command_write 020A CDF101 call lcd_ready 020D 3E0C mvi a, 0ch 020F D350 out command_write 0211 CDFB01 call clear_lcd 0214 C9 ret ; print ASCII text on LCD ; entry: HL pointer with 0 for end of string 0215 7E put_str_lcd: mov a,m ; get A from [HL] 0216 FE00 cpi 0 0218 C21C02 jnz put_str_lcd1 021B C9 ret 021C put_str_lcd1: 021C CDF101 call lcd_ready 021F D351 out data_write 0221 23 inx h 0222 F21502 jp put_str_lcd ; goto_xy set cursor location on lcd ; entry: HL: H = x, L = y 0225 CDF101 goto_xy: call lcd_ready 0228 7D mov a,l 0229 FE00 cpi 0 022B C23402 jnz goto_xy1 022E 7C mov a,h 022F C680 adi 80h 0231 D350 out command_write 0233 C9 ret 0234 FE01 goto_xy1: cpi 1 0236 C23F02 jnz goto_xy2 0239 7C mov a,h 023A C6C0 adi 0c0h 023C D350 out command_write 023E C9 ret 023F FE02 goto_xy2: cpi 2 0241 C24A02 jnz goto_xy3 0244 7C mov a,h 0245 C694 adi 094h 0247 D350 out command_write 0249 C9 ret 024A FE03 goto_xy3: cpi 3 024C C25502 jnz goto_xy4 024F 7C mov a,h 0250 C6D4 adi 0d4h 0252 D350 out command_write 0254 C9 ret 0255 C9 goto_xy4: ret ; put_ch_lcd put character to lcd ; entry: A

A8085.LST 29/3/2558 15:27

Page 5 of 63

Page 59: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456

0256 CDF101 put_ch_lcd: call lcd_ready 0259 D351 out data_write 025B C9 ret ;-------------------------------------------------------------------- ; monitor call entry ; entry: E = monitor call number 0-255 ; calling monitor function is made with RST 1 command after loading the ; regsiter E with call number ; destroy: BC user must save it in stack memory 025C E5 monitor_call: push h 025D F5 push psw 025E D5 push d 025F 7B mov a,e ; get call number 0260 07 rlc ; x2 0261 5F mov e,a ; put it back 0262 217002 lxi h,vector_table 0265 1600 mvi d,0 0267 19 dad d ; get location in jump table 0268 4E mov c,m 0269 23 inx h 026A 46 mov b,m 026B D1 pop d 026C F1 pop psw 026D E1 pop h 026E C5 push b ; push address into top of stack 026F C9 ret ; jump to monitor call function 0270 vector_table: 0270 860B dwl demo ; #0 running LED with HL pointer 0272 FB05 dwl delay ; #1 simple delay routine 0274 5C0B dwl cold_boot ; #2 show 8085 running 0276 940C dwl scan ; #3 scan display one cycle 0278 2212 dwl cin ; #4 get byte from console 027A 1612 dwl cout ; #5 print byte to console 027C 3F12 dwl put_str ; #6 print string with 0 terminator to console 027E 0302 dwl init_lcd ; #7 initialize lcd 0280 F101 dwl lcd_ready ; #8 wait until lcd is ready 0282 FB01 dwl clear_lcd ; #9 clear lcd display 0284 2502 dwl goto_xy ; #10 set lcd cursor position 0286 1502 dwl put_str_lcd ; #11 print ASCII string on lcd 0288 5602 dwl put_ch_lcd ; #12 print ASCII letter on lcd 028A ED05 dwl test_led ; #13 run LED onboard 028C C401 dwl pint8u ; #14 print 8-bit unsigned to terminal ; save CPU registers to stack and write them to user registers ; 028E service_rst7: 028E F5 push psw 028F C5 push b 0290 D5 push d 0291 E1 pop h 0292 222FF0 shld user_DE 0295 E1 pop h 0296 222DF0 shld user_BC 0299 E1 pop h 029A 222BF0 shld user_AF 029D E1 pop h 029E 2229F0 shld user_PC ; store next PC 02A1 210000 lxi h,0000h 02A4 39 dad sp ; get SP 02A5 2233F0 shld user_SP ; save user SP

A8085.LST 29/3/2558 15:27

Page 6 of 63

Page 60: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532

02A8 CDA40A call read_memory 02AB CD3B0F call register_display1 02AE 2A56F0 lhld save_stack 02B1 F9 sphl ; restore system stack 02B2 C9 ret ; test diplay register after break ; RST 2 opcode is D7 ; later will be changed to RST 7 02B3 service_rst2: 02B3 F5 push psw 02B4 C5 push b 02B5 D5 push d 02B6 E1 pop h 02B7 222FF0 shld user_DE 02BA E1 pop h 02BB 222DF0 shld user_BC 02BE E1 pop h 02BF 222BF0 shld user_AF 02C2 E1 pop h 02C3 2229F0 shld user_PC ; store next PC 02C6 210000 lxi h,0000h 02C9 39 dad sp ; get content of SP 02CA 2233F0 shld user_SP ; save user SP 02CD CDA40A call read_memory 02D0 CD3B0F call register_display1 02D3 2A56F0 lhld save_stack 02D6 F9 sphl ; restore system stack 02D7 C9 ret ; service trap for single step running ; disable trap input by setting system port c.6 ; save CPU registers to user registers 02D8 service_trap: 02D8 F5 push psw ; save A and Flag 02D9 3EFF mvi a,0ffh 02DB D312 out system_port_c ; turn trap off by clearing shift register 02DD C5 push b 02DE D5 push d 02DF E5 push h 02E0 E1 pop h 02E1 2231F0 shld user_HL ; save HL 02E4 E1 pop h 02E5 222FF0 shld user_DE 02E8 E1 pop h 02E9 222DF0 shld user_BC 02EC E1 pop h 02ED 222BF0 shld user_AF 02F0 E1 pop h ; store next PC 02F1 2229F0 shld user_PC 02F4 210000 lxi h,0 02F7 39 dad sp 02F8 2233F0 shld user_SP ; save user SP

A8085.LST 29/3/2558 15:27

Page 7 of 63

Page 61: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608

02FB CDA40A call read_memory 02FE 3A24F0 lda uart_found 0301 FE00 cpi 0 0303 CA0903 jz skip1 0306 CD3B0F call register_display1 0309 skip1: 0309 2A56F0 lhld save_stack 030C F9 sphl ; restore system stack 030D C9 ret ; jump back to main body ; disassemble machine code into mnemonic 030E disassemble1: 030E 3A22F0 lda command 0311 FE64 cpi "d" 0313 C23403 jnz exit_disassemble 0316 21881E lxi h,disassemble_text 0319 CD3F12 call put_str 031C CDC112 call new_line 031F 0E10 mvi c,16 ; 16 lines 0321 C5 dis2: push b 0322 CDC112 call new_line 0325 CDAB03 call d_disassemble 0328 C1 pop b 0329 0D dcr c 032A C22103 jnz dis2 032D CDC112 call new_Line 0330 CD210D call send_prompt 0333 C9 ret 0334 C9 exit_disassemble: ret ; disassemble opcode to mnemonic ; entry: user_PC ; exit: user_PC = next address 0335 2A29F0 disassemble: lhld user_PC 0338 E5 push h 0339 7C mov a,h 033A CDB212 call out2x 033D 7D mov a,l 033E CDB212 call out2x 0341 CDCC12 call space 0344 7E mov a,m ; get opcode 0345 CD2104 call get_number_of_byte 0348 4F mov c,a 0349 7E disassem3: mov a,m 034A CDB212 call out2x 034D 23 inx h 034E 0D dcr c 034F C24903 jnz disassem3 0352 E1 pop h 0353 7E mov a,m 0354 CD2104 call get_number_of_byte

A8085.LST 29/3/2558 15:27

Page 8 of 63

Page 62: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684

0357 FE01 cpi 1 0359 C26103 jnz one_tab 035C 3E09 mvi a,tab ; print two tabs for one byte opcode 035E CD1612 call cout 0361 3E09 one_tab: mvi a,tab ; else only one tab 0363 CD1612 call cout 0366 E5 push h 0367 7E mov a,m ; get opcode 0368 F5 push psw 0369 210000 lxi h,0000h ; clear HL 036C 6F mov l,a 036D 29 dad h ; HL = HLx2 036E 5D mov e,l 036F 54 mov d,h 0370 21F214 lxi h,ins_table 0373 19 dad d ; ADD HL,DE 0374 5E mov e,m 0375 23 inx h 0376 56 mov d,m 0377 6B mov l,e 0378 62 mov h,d 0379 CD3F12 call put_str 037C F1 pop psw 037D E1 pop h 037E CD2104 call get_number_of_byte 0381 FE01 cpi 1 0383 C28B03 jnz disassem1 0386 23 inx h 0387 2229F0 shld user_PC 038A C9 ret 038B FE02 disassem1: cpi 2 038D C29A03 jnz disassem2 0390 23 inx h 0391 7E mov a,m 0392 CDB212 call out2x 0395 23 inx h 0396 2229F0 shld user_PC 0399 C9 ret 039A 23 disassem2: inx h 039B 23 inx h 039C 7E mov a,m 039D CDB212 call out2x 03A0 2B dcx h 03A1 7E mov a,m 03A2 CDB212 call out2x 03A5 23 inx h 03A6 23 inx h 03A7 2229F0 shld user_PC 03AA C9 ret ; disassemble opcode to mnemonic with command 'd' ; entry: pointer ; exit: pointer = next address 03AB 2A3BF0 d_disassemble: lhld pointer 03AE E5 push h 03AF 7C mov a,h 03B0 CDB212 call out2x 03B3 7D mov a,l

A8085.LST 29/3/2558 15:27

Page 9 of 63

Page 63: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760

03B4 CDB212 call out2x 03B7 CDCC12 call space 03BA 7E mov a,m ; get opcode 03BB CD2104 call get_number_of_byte 03BE 4F mov c,a 03BF 7E d_disassem3: mov a,m 03C0 CDB212 call out2x 03C3 23 inx h 03C4 0D dcr c 03C5 C2BF03 jnz d_disassem3 03C8 E1 pop h 03C9 7E mov a,m 03CA CD2104 call get_number_of_byte 03CD FE01 cpi 1 03CF C2D703 jnz d_one_tab 03D2 3E09 mvi a,tab ; print two tabs for one byte opcode 03D4 CD1612 call cout 03D7 3E09 d_one_tab: mvi a,tab ; else only one tab 03D9 CD1612 call cout 03DC E5 push h 03DD 7E mov a,m ; get opcode 03DE F5 push psw 03DF 210000 lxi h,0000h ; clear HL 03E2 6F mov l,a 03E3 29 dad h ; HL = HLx2 03E4 5D mov e,l 03E5 54 mov d,h 03E6 21F214 lxi h,ins_table 03E9 19 dad d ; ADD HL,DE 03EA 5E mov e,m 03EB 23 inx h 03EC 56 mov d,m 03ED 6B mov l,e 03EE 62 mov h,d 03EF CD3F12 call put_str 03F2 F1 pop psw 03F3 E1 pop h 03F4 CD2104 call get_number_of_byte 03F7 FE01 cpi 1 03F9 C20104 jnz d_disassem1 03FC 23 inx h 03FD 223BF0 shld pointer 0400 C9 ret 0401 FE02 d_disassem1: cpi 2 0403 C21004 jnz d_disassem2 0406 23 inx h 0407 7E mov a,m 0408 CDB212 call out2x 040B 23 inx h 040C 223BF0 shld pointer 040F C9 ret 0410 23 d_disassem2: inx h 0411 23 inx h 0412 7E mov a,m 0413 CDB212 call out2x 0416 2B dcx h 0417 7E mov a,m

A8085.LST 29/3/2558 15:27

Page 10 of 63

Page 64: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836

0418 CDB212 call out2x 041B 23 inx h 041C 23 inx h 041D 223BF0 shld pointer 0420 C9 ret ; get number of byte ; entry: A = OPCODE ; exit: A = number of byte, 1,2,3 ; 0 = undefined opcode 0421 get_number_of_byte: 0421 FE01 cpi 01 0423 C22904 jnz number1 0426 3E03 mvi a,3 0428 C9 ret 0429 FE06 number1: cpi 6 042B C23104 jnz number2 042E 3E02 mvi a,2 0430 C9 ret 0431 FE0E number2: cpi 0eh 0433 C23904 jnz number3 0436 3E02 mvi a,2 0438 C9 ret 0439 FE11 number3: cpi 11h 043B C24104 jnz number4 043E 3E03 mvi a,3 0440 C9 ret 0441 FE16 number4: cpi 16h 0443 C24904 jnz number5 0446 3E02 mvi a,2 0448 C9 ret 0449 FE1E number5: cpi 1eh 044B C25104 jnz number6 044E 3E02 mvi a,2 0450 C9 ret 0451 FE21 number6: cpi 21h 0453 C25904 jnz number7 0456 3E03 mvi a,3 0458 C9 ret 0459 FE22 number7: cpi 22h 045B C26104 jnz number8 045E 3E03 mvi a,3 0460 C9 ret 0461 FE26 number8: cpi 26h 0463 C26904 jnz number9 0466 3E02 mvi a,2 0468 C9 ret 0469 FE2A number9: cpi 2ah 046B C27104 jnz number10 046E 3E03 mvi a,3 0470 C9 ret 0471 FE2E number10: cpi 2eh 0473 C27904 jnz number11 0476 3E02 mvi a,2 0478 C9 ret 0479 FE31 number11: cpi 31h 047B C28104 jnz number12 047E 3E03 mvi a,3 0480 C9 ret 0481 FE32 number12: cpi 32h 0483 C28904 jnz number13

A8085.LST 29/3/2558 15:27

Page 11 of 63

Page 65: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912

0486 3E03 mvi a,3 0488 C9 ret 0489 FE36 number13: cpi 36h 048B C29104 jnz number14 048E 3E03 mvi a,3 0490 C9 ret 0491 FE3A number14: cpi 3ah 0493 C29904 jnz number15 0496 3E03 mvi a,3 0498 C9 ret 0499 FE3E number15: cpi 3eh 049B C2A104 jnz number16 049E 3E02 mvi a,2 04A0 C9 ret 04A1 FEC2 number16: cpi 0c2h 04A3 C2A904 jnz number17 04A6 3E03 mvi a,3 04A8 C9 ret 04A9 FEC3 number17: cpi 0c3h 04AB C2B104 jnz number18 04AE 3E03 mvi a,3 04B0 C9 ret 04B1 FEC4 number18: cpi 0c4h 04B3 C2B904 jnz number19 04B6 3E03 mvi a,3 04B8 C9 ret 04B9 FEC6 number19: cpi 0c6h 04BB C2C104 jnz number20 04BE 3E02 mvi a,2 04C0 C9 ret 04C1 FECA number20: cpi 0cah 04C3 C2C904 jnz number21 04C6 3E03 mvi a,3 04C8 C9 ret 04C9 FECC number21: cpi 0cch 04CB C2D104 jnz number22 04CE 3E03 mvi a,3 04D0 C9 ret 04D1 FECD number22: cpi 0cdh 04D3 C2D904 jnz number23 04D6 3E03 mvi a,3 04D8 C9 ret 04D9 FECE number23: cpi 0ceh 04DB C2E104 jnz number24 04DE 3E02 mvi a,2 04E0 C9 ret 04E1 FED2 number24: cpi 0d2h 04E3 C2E904 jnz number25 04E6 3E03 mvi a,3 04E8 C9 ret 04E9 FED3 number25: cpi 0d3h 04EB C2F104 jnz number26 04EE 3E02 mvi a,2 04F0 C9 ret 04F1 FED4 number26: cpi 0d4h 04F3 C2F904 jnz number27 04F6 3E03 mvi a,3 04F8 C9 ret 04F9 FED6 number27: cpi 0d6h 04FB C20105 jnz number28 04FE 3E02 mvi a,2

A8085.LST 29/3/2558 15:27

Page 12 of 63

Page 66: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988

0500 C9 ret 0501 FEDA number28: cpi 0dah 0503 C20905 jnz number29 0506 3E03 mvi a,3 0508 C9 ret 0509 FEDB number29: cpi 0dbh 050B C21105 jnz number30 050E 3E02 mvi a,2 0510 C9 ret 0511 FEDC number30: cpi 0dch 0513 C21905 jnz number31 0516 3E03 mvi a,3 0518 C9 ret 0519 FEE2 number31: cpi 0e2h 051B C22105 jnz number32 051E 3E03 mvi a,3 0520 C9 ret 0521 FEE4 number32: cpi 0e4h 0523 C22905 jnz number33 0526 3E03 mvi a,3 0528 C9 ret 0529 FEE6 number33: cpi 0e6h 052B C23105 jnz number34 052E 3E02 mvi a,2 0530 C9 ret 0531 FEEA number34: cpi 0eah 0533 C23905 jnz number35 0536 3E03 mvi a,3 0538 C9 ret 0539 FEEC number35: cpi 0ech 053B C24105 jnz number36 053E 3E03 mvi a,3 0540 C9 ret 0541 FEEE number36: cpi 0eeh 0543 C24905 jnz number37 0546 3E02 mvi a,2 0548 C9 ret 0549 FEF2 number37: cpi 0f2h 054B C25105 jnz number38 054E 3E03 mvi a,3 0550 C9 ret 0551 FEF4 number38: cpi 0f4h 0553 C25905 jnz number39 0556 3E03 mvi a,3 0558 C9 ret 0559 FEF6 number39: cpi 0f6h 055B C26105 jnz number40 055E 3E02 mvi a,2 0560 C9 ret 0561 FEFA number40: cpi 0fah 0563 C26905 jnz number41 0566 3E03 mvi a,3 0568 C9 ret 0569 FEFC number41: cpi 0fch 056B C27105 jnz number42 056E 3E03 mvi a,3 0570 C9 ret 0571 FEFE number42: cpi 0feh 0573 C27905 jnz number43 0576 3E02 mvi a,2 0578 C9 ret

A8085.LST 29/3/2558 15:27

Page 13 of 63

Page 67: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

989990991992993994995996997998999

10001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064

0579 3E01 number43: mvi a,1 057B C9 ret ; execute key 0-F or 10H-19H 057C FE10 key_execute: cpi 10h 057E D28805 jnc function_key ; 0-9 jump to data key 0581 57 mov d,a 0582 CD3706 call buzzer 0585 F20406 jp data_key 0588 FE12 function_key: cpi 12h 058A C29305 jnz function1 058D CD3706 call buzzer 0590 F24B0A jp increment 0593 FE15 function1: cpi 15h 0595 C29E05 jnz function2 0598 CD3706 call buzzer 059B F25E0A jp decrement 059E FE10 function2: cpi 10h 05A0 C2A905 jnz function3 05A3 CD3706 call buzzer 05A6 F2E709 jp address_mode 05A9 FE11 function3: cpi 11h 05AB C2B405 jnz function4 05AE CD3706 call buzzer 05B1 F2F409 jp data_mode 05B4 FE13 function4: cpi 13h 05B6 C2C005 jnz function5 05B9 CD3706 call buzzer 05BC F28109 jp go 05BF C9 ret 05C0 FE14 function5: cpi 14h 05C2 C2CB05 jnz function6 05C5 CD3706 call buzzer 05C8 F2FF09 jp function_2nd 05CB FE16 function6: cpi 16h 05CD C2D605 jnz function7 05D0 CD3706 call buzzer 05D3 F2A509 jp single_step 05D6 FE17 function7: cpi 17h 05D8 C2E105 jnz function8 05DB CD3706 call buzzer 05DE F26709 jp home 05E1 FE18 function8: cpi 18h 05E3 C2EC05 jnz function9 05E6 CD3706 call buzzer 05E9 F2230A jp modify_register 05EC C9 function9: ret ; test running onboard led 05ED 3E01 test_led: mvi a,1 05EF D300 test_led1: out gpio 05F1 115010 lxi d,1050h 05F4 CDFB05 call delay 05F7 07 rlc

A8085.LST 29/3/2558 15:27

Page 14 of 63

Page 68: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140

05F8 C3EF05 jmp test_led1 ; delay subroutine ; entry: D= outer loop E=inner loop (should be 0 for long delay) ; exit: none 05FB 1D delay: dcr e 05FC C2FB05 jnz delay 05FF 15 dcr d 0600 C2FB05 jnz delay 0603 C9 ret 0604 3A25F0 data_key: lda entry_mode 0607 FE00 cpi 0 0609 C20F06 jnz data_key1 060C F2C306 jp enter_data 060F FE01 data_key1: cpi 1 0611 C21706 jnz data_key2 0614 F2FD06 jp enter_address 0617 FE02 data_key2: cpi 2 0619 C21F06 jnz data_key3 061C F23707 jp select_register 061F FE03 data_key3: cpi 3 0621 C22706 jnz data_key4 0624 F26306 jp enter_register 0627 data_key4: 0627 C9 ret 0628 3E7F test_buzzer: mvi a,7fh 062A D312 out system_port_c 062C 110010 lxi d,1000h 062F CDFB05 call delay 0632 3EFF mvi a,0ffh 0634 D312 out system_port_c 0636 C9 ret ; produce beep output at system port c.7 ; click when key pressed 0637 0E01 buzzer: mvi c,1 0639 3E7F buzzer1: mvi a,7fh 063B D312 out system_port_c ;nop ;out system_port_c 063D CD4D06 call delay_us 0640 3EFF mvi a,0ffh 0642 D312 out system_port_c ;nop ;out system_port_c 0644 0D dcr c 0645 C23906 jnz buzzer1 0648 3EFF mvi a,0ffh 064A D312 out system_port_c 064C C9 ret 064D 06B0 delay_us: mvi b,0b0h 064F 05 delay_us1: dcr b 0650 C24F06 jnz delay_us1 0653 C9 ret ;----- turn display off while key has been pressing ------------------ ; useful for no function accepted 0654 21851D display_off: lxi h,off_display 0657 CD940C off_display1: call scan 065A 3A21F0 lda key

A8085.LST 29/3/2558 15:27

Page 15 of 63

Page 69: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216

065D FEFF cpi 0ffh 065F C25706 jnz off_display1 ; loop if key still pressed 0662 C9 ret ;************* modify current displayed register ********************** ; entry: current user register displayed ; 0663 enter_register: 0663 2A37F0 lhld current_register 0666 4E mov c,m 0667 23 inx h 0668 46 mov b,m 0669 210000 lxi h,0 066C 09 dad b ; MOV HL,BC 066D 5A mov e,d ; save key code to E 066E shift_register: 066E 7D mov a,l 066F 07 rlc 0670 6F mov l,a 0671 7C mov a,h 0672 17 ral 0673 67 mov h,a 0674 7D mov a,l 0675 07 rlc 0676 6F mov l,a 0677 7C mov a,h 0678 17 ral 0679 67 mov h,a 067A 7D mov a,l 067B 07 rlc 067C 6F mov l,a 067D 7C mov a,h 067E 17 ral 067F 67 mov h,a 0680 7D mov a,l 0681 07 rlc 0682 6F mov l,a 0683 7C mov a,h 0684 17 ral 0685 67 mov h,a 0686 7D mov a,l 0687 E6F0 ani 0f0h 0689 82 add d 068A 6F mov l,a 068B 44 mov b,h 068C 4D mov c,l 068D 2A37F0 lhld current_register 0690 71 mov m,c 0691 23 inx h 0692 70 mov m,b 0693 2A37F0 lhld current_register 0696 4E mov c,m 0697 23 inx h 0698 46 mov b,m 0699 210000 lxi h,0 069C 09 dad b ; MOV HL,BC 069D CD790A call read_register

A8085.LST 29/3/2558 15:27

Page 16 of 63

Page 70: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292

06A0 F5 push psw 06A1 3A13F0 lda buffer+3 06A4 F680 ori 80h 06A6 3213F0 sta buffer+3 06A9 3A12F0 lda buffer+2 06AC F680 ori 80h 06AE 3212F0 sta buffer+2 06B1 3A11F0 lda buffer+1 06B4 F680 ori 80h 06B6 3211F0 sta buffer+1 06B9 3A10F0 lda buffer 06BC F680 ori 80h 06BE 3210F0 sta buffer 06C1 F1 pop psw 06C2 C9 ret ; enter nibble into current location 06C3 2A29F0 enter_data: lhld user_PC 06C6 5A mov e,d ; save key code to E 06C7 3A26F0 lda counter1 06CA FE00 cpi 0 06CC C2D606 jnz shift_data 06CF 3C inr a 06D0 3226F0 sta counter1 06D3 3E00 mvi a,0 06D5 77 mov m,a 06D6 7E shift_data: mov a,m 06D7 07 rlc 06D8 07 rlc 06D9 07 rlc 06DA 07 rlc 06DB E6F0 ani 0f0h ; make low nibble to 0 before insert 06DD 83 add e ; insert low nibble to A 06DE 77 mov m,a 06DF 57 mov d,a 06E0 7E mov a,m ; check if the space is ram or rom 06E1 BA cmp d 06E2 CAF906 jz it_is_ram ; if it was rom them turn of led while key has been pressed 06E5 21851D lxi h,off_display 06E8 CD940C enter_data1: call scan 06EB 3A21F0 lda key 06EE FEFF cpi 0ffh 06F0 C2E806 jnz enter_data1 ; loop if key still pressed 06F3 CD8D0C call debounce ; debounce after key was released 06F6 2110F0 lxi h,buffer ; back to show display again 06F9 it_is_ram: 06F9 CDA40A call read_memory 06FC C9 ret ; enter nibble into current pointer 06FD 2A29F0 enter_address: lhld user_PC 0700 5A mov e,d ; save key code to E 0701 3A27F0 lda counter2

A8085.LST 29/3/2558 15:27

Page 17 of 63

Page 71: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368

0704 FE00 cpi 0 0706 C21307 jnz shift_address 0709 3C inr a 070A 3227F0 sta counter2 070D 210000 lxi h,0 0710 2229F0 shld user_PC 0713 shift_address: 0713 7D mov a,l 0714 07 rlc 0715 6F mov l,a 0716 7C mov a,h 0717 17 ral 0718 67 mov h,a 0719 7D mov a,l 071A 07 rlc 071B 6F mov l,a 071C 7C mov a,h 071D 17 ral 071E 67 mov h,a 071F 7D mov a,l 0720 07 rlc 0721 6F mov l,a 0722 7C mov a,h 0723 17 ral 0724 67 mov h,a 0725 7D mov a,l 0726 07 rlc 0727 6F mov l,a 0728 7C mov a,h 0729 17 ral 072A 67 mov h,a 072B 7D mov a,l 072C E6F0 ani 0f0h 072E 82 add d 072F 6F mov l,a 0730 2229F0 shld user_PC ; store new pointer 0733 CDA40A call read_memory 0736 C9 ret ;****************** ALT register display ****************************** 0737 5A select_register: mov e,d ; save key for selecting user register 0738 7A mov a,d 0739 FE00 cpi 0 073B C25507 jnz register1 073E 3E77 mvi a,77h ; AF register pair 0740 3214F0 sta buffer+4 0743 3E71 mvi a,71h 0745 3215F0 sta buffer+5 0748 212BF0 lxi h,user_AF 074B 2237F0 shld current_register 074E 2A2BF0 lhld user_AF 0751 CD790A call read_register 0754 C9 ret 0755 register1: 0755 FE01 cpi 1 0757 C27107 jnz register2 075A 3E7C mvi a,7ch ; BC register pair 075C 3214F0 sta buffer+4

A8085.LST 29/3/2558 15:27

Page 18 of 63

Page 72: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444

075F 3E39 mvi a,39h 0761 3215F0 sta buffer+5 0764 212DF0 lxi h,user_BC 0767 2237F0 shld current_register 076A 2A2DF0 lhld user_BC 076D CD790A call read_register 0770 C9 ret 0771 register2: 0771 FE02 cpi 2 0773 C28D07 jnz register3 0776 3E5E mvi a,5eh ; DE register pair 0778 3214F0 sta buffer+4 077B 3E79 mvi a,79h 077D 3215F0 sta buffer+5 0780 212FF0 lxi h,user_DE 0783 2237F0 shld current_register 0786 2A2FF0 lhld user_DE 0789 CD790A call read_register 078C C9 ret 078D register3: 078D FE03 cpi 3 078F C2A907 jnz register4 0792 3E76 mvi a,76h ; HL register pair 0794 3214F0 sta buffer+4 0797 3E38 mvi a,38h 0799 3215F0 sta buffer+5 079C 2131F0 lxi h,user_HL 079F 2237F0 shld current_register 07A2 2A31F0 lhld user_HL 07A5 CD790A call read_register 07A8 C9 ret 07A9 register4: 07A9 FE04 cpi 4 07AB C2C507 jnz register5 07AE 3E6D mvi a,6dh ; user SP 07B0 3214F0 sta buffer+4 07B3 3E73 mvi a,73h 07B5 3215F0 sta buffer+5 07B8 2133F0 lxi h,user_SP 07BB 2237F0 shld current_register 07BE 2A33F0 lhld user_SP 07C1 CD790A call read_register 07C4 C9 ret 07C5 register5: 07C5 FE05 cpi 5 07C7 C2EC07 jnz register6 07CA 3E73 mvi a,73h ; user PC 07CC 3214F0 sta buffer+4 07CF 3E39 mvi a,39h 07D1 3215F0 sta buffer+5 07D4 2129F0 lxi h,user_PC 07D7 2237F0 shld current_register 07DA 2A29F0 lhld user_PC 07DD CD790A call read_register

A8085.LST 29/3/2558 15:27

Page 19 of 63

Page 73: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520

07E0 C9 ret ;---- display carry flag ------------------------------------------------- 07E1 C2E907 put_flag: jnz put_high1 07E4 3E3F mvi a,3fh 07E6 C3EB07 jmp skip_put_high1 07E9 3E06 put_high1: mvi a,06h 07EB skip_put_high1: 07EB C9 ret 07EC register6: 07EC FE06 cpi 6 07EE C21408 jnz register7 07F1 3E39 mvi a,39h ; carry flag 07F3 3210F0 sta buffer 07F6 3E6E mvi a,6eh 07F8 3211F0 sta buffer+1 07FB 3E48 mvi a,48h 07FD 3212F0 sta buffer+2 0800 2A2BF0 lhld user_AF 0803 7D mov a,l 0804 E601 ani 1 0806 CDE107 call put_flag 0809 3213F0 sta buffer+3 080C AF xra a 080D 3214F0 sta buffer+4 0810 3215F0 sta buffer+5 0813 C9 ret 0814 register7: 0814 FE07 cpi 7 0816 C23F08 jnz register8 0819 3E49 mvi a,49h ; zero flag 081B 3210F0 sta buffer 081E 3E79 mvi a,79h 0820 3211F0 sta buffer+1 0823 3E50 mvi a,50h 0825 3212F0 sta buffer+2 0828 3E5C mvi a,5ch 082A 3213F0 sta buffer+3 082D 3E48 mvi a,48h 082F 3214F0 sta buffer+4 0832 2A2BF0 lhld user_AF 0835 7D mov a,l 0836 E640 ani 40h 0838 CDE107 call put_flag 083B 3215F0 sta buffer+5 083E C9 ret 083F register8: 083F FE08 cpi 8 0841 C27008 jnz register9 0844 3E6D mvi a,6dh ; sign flag 0846 3210F0 sta buffer 0849 3E11 mvi a,11h 084B 3211F0 sta buffer+1 084E 3E6F mvi a,6fh 0850 3212F0 sta buffer+2 0853 3E54 mvi a,54h 0855 3213F0 sta buffer+3 0858 3E48 mvi a,48h

A8085.LST 29/3/2558 15:27

Page 20 of 63

Page 74: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596

085A 3214F0 sta buffer+4 085D 2A2BF0 lhld user_AF 0860 7D mov a,l 0861 17 ral 0862 DA6A08 jc put_high2 0865 3E3F mvi a,3fh 0867 C36C08 jmp skip_put_high2 086A 3E06 put_high2: mvi a,06h 086C skip_put_high2: 086C 3215F0 sta buffer+5 086F C9 ret 0870 register9: 0870 FE09 cpi 9 0872 C29808 jnz register10 0875 3E77 mvi a,77h ; AC flag 0877 3210F0 sta buffer 087A 3E39 mvi a,39h 087C 3211F0 sta buffer+1 087F 3E48 mvi a,48h 0881 3212F0 sta buffer+2 0884 2A2BF0 lhld user_AF 0887 7D mov a,l 0888 E610 ani 10h 088A CDE107 call put_flag 088D 3213F0 sta buffer+3 0890 AF xra a 0891 3214F0 sta buffer+4 0894 3215F0 sta buffer+5 0897 C9 ret 0898 register10: 0898 FE0A cpi 10 089A C2BE08 jnz break 089D 3E73 mvi a,73h ; Parity flag 089F 3210F0 sta buffer 08A2 3E48 mvi a,48h 08A4 3211F0 sta buffer+1 08A7 2A2BF0 lhld user_AF 08AA 7D mov a,l 08AB E604 ani 4 08AD CDE107 call put_flag 08B0 3212F0 sta buffer+2 08B3 AF xra a 08B4 3213F0 sta buffer+3 08B7 3214F0 sta buffer+4 08BA 3215F0 sta buffer+5 08BD C9 ret ; ------------------ ALT B SET BREAK POINT --------------------------- 08BE FE0B break: cpi 11 08C0 C2F808 jnz clear_break 08C3 2A29F0 lhld user_PC ; save user PC 08C6 223DF0 shld break_address 08C9 7E mov a,m ; get user code 08CA 323FF0 sta break_opcode ; save it 08CD E5 push h 08CE CDA40A call read_memory 08D1 E1 pop h

A8085.LST 29/3/2558 15:27

Page 21 of 63

Page 75: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672

08D2 3EFF mvi a,0FFh ; RST 7 opcode 08D4 77 mov m,a ; replace user code with RST 7 08D5 F5 push psw 08D6 3A10F0 lda buffer 08D9 F680 ori 80h 08DB 3210F0 sta buffer 08DE 3A11F0 lda buffer+1 08E1 F680 ori 80h 08E3 3211F0 sta buffer+1 08E6 3A12F0 lda buffer+2 08E9 F680 ori 80h 08EB 3212F0 sta buffer+2 08EE 3A13F0 lda buffer+3 08F1 F680 ori 80h 08F3 3213F0 sta buffer+3 08F6 F1 pop psw 08F7 C9 ret ;----------------- ALT C CLEAR BREAK POINT --------------------------- 08F8 FE0C clear_break: cpi 12 08FA C21309 jnz insert_byte 08FD 213FF0 lxi h,break_opcode ; restore user code 0900 7E mov a,m 0901 2A3DF0 lhld break_address 0904 77 mov m,a 0905 2229F0 shld user_PC 0908 CDA40A call read_memory 090B AF xra a 090C 3225F0 sta entry_mode 090F CDE80A call mode_indicator 0912 C9 ret ;--------------- ALT E insert byte --------------------------------- ; insert byte within 512 bytes from current location 0913 FE0E insert_byte: cpi 14 ; test with key E 0915 C23E09 jnz delete_byte 0918 2A29F0 lhld user_PC 091B E5 push h ; save PC to stack 091C 110002 lxi d,512 091F 19 dad d 0920 E5 push h 0921 C1 pop b ; copy HL to BC 0922 0B dcx b 0923 110002 lxi d,512 ; load counter with 512 bytes 0926 insert_byte1: 0926 0A ldax b 0927 77 mov m,a 0928 2B dcx h 0929 0B dcx b 092A 1B dcx d 092B 7B mov a,e 092C B2 ora d ; check DE ==0 092D C22609 jnz insert_byte1 0930 E1 pop h ; restore user PC 0931 AF xra a 0932 77 mov m,a ; store 00 at insert byte 0933 CDA40A call read_memory 0936 AF xra a 0937 3225F0 sta entry_mode 093A CDE80A call mode_indicator

A8085.LST 29/3/2558 15:27

Page 22 of 63

Page 76: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748

093D C9 ret ;--------------- ALT D delete byte --------------------------------- ; delete byte within 512 bytes 093E FE0D delete_byte: cpi 13 0940 C26309 jnz option1 0943 2A29F0 lhld user_PC 0946 E5 push h 0947 E5 push h 0948 C1 pop b 0949 03 inx b 094A 110002 lxi d,512 094D delete_byte1: 094D 0A ldax b 094E 77 mov m,a 094F 23 inx h 0950 03 inx b 0951 1B dcx d 0952 7B mov a,e 0953 B2 ora d ; check if DE ==0 0954 C24D09 jnz delete_byte1 0957 E1 pop h 0958 CDA40A call read_memory 095B AF xra a 095C 3225F0 sta entry_mode 095F CDE80A call mode_indicator 0962 C9 ret 0963 option1: 0963 CD5406 call display_off ; no service key 0966 C9 ret 0967 210081 home: lxi h,home_address 096A 2229F0 shld user_PC 096D 2110F0 lxi h,buffer 0970 CDA40A call read_memory 0973 AF xra a 0974 3225F0 sta entry_mode 0977 CDE80A call mode_indicator 097A C9 ret 097B 3E2A debug: mvi a,"*" 097D CD1612 call cout 0980 C9 ret ; go function, jump from monitor program to user program ; save system stack and load user stack ; load CPU registers with user registers before jump 0981 go: 0981 210000 lxi h,0 0984 39 dad sp ; save system stack 0985 2256F0 shld save_stack 0988 2A33F0 lhld user_SP ; get user stack 098B F9 sphl ; load user stack 098C 2A29F0 lhld user_PC 098F E5 push h

A8085.LST 29/3/2558 15:27

Page 23 of 63

Page 77: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824

0990 2A2BF0 lhld user_AF 0993 E5 push h 0994 2A2DF0 lhld user_BC 0997 E5 push h 0998 2A2FF0 lhld user_DE 099B E5 push h 099C 2A31F0 lhld user_HL 099F E5 push h 09A0 E1 pop h 09A1 D1 pop d 09A2 C1 pop b 09A3 F1 pop psw 09A4 C9 ret ; jump to user program ; single step ; load CPU registers with user registers, enable trap signal then jump to user ; program ; disassemble line to be executed 09A5 single_step: 09A5 210000 lxi h,0 09A8 39 dad sp ; save system stack 09A9 2256F0 shld save_stack 09AC 2A33F0 lhld user_SP 09AF F9 sphl ; load user stack 09B0 2A29F0 lhld user_PC ; get address to be executed 09B3 E5 push h ; save to stack 09B4 3A24F0 lda uart_found 09B7 FE00 cpi 0 09B9 CAC509 jz skip2 ; if no uart, skip disassemble 09BC CDC112 call new_line 09BF CDD212 call send_tab 09C2 CD3503 call disassemble 09C5 skip2: 09C5 E1 pop h 09C6 2229F0 shld user_PC 09C9 2A29F0 lhld user_PC 09CC E5 push h 09CD 2A2BF0 lhld user_AF 09D0 E5 push h 09D1 2A2DF0 lhld user_BC 09D4 E5 push h 09D5 2A2FF0 lhld user_DE 09D8 E5 push h 09D9 2A31F0 lhld user_HL 09DC E5 push h 09DD E1 pop h 09DE D1 pop d 09DF C1 pop b 09E0 3EBF mvi a,0bfh ; make port_c.6 low to enable trap 09E2 D312 out system_port_c ; ; now the shift register 74LS164 is running ; within 8 ALE, trap will be high, trap will be recorgnized after instruction ; followed RET was executed 09E4 00 nop ; 1 cycles 09E5 F1 pop psw ; 5 cycles 09E6 C9 ret ; 3 cycles ; set mode to 1

A8085.LST 29/3/2558 15:27

Page 24 of 63

Page 78: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900

09E7 3E01 address_mode: mvi a,1 09E9 3225F0 sta entry_mode 09EC CDA40A call read_memory 09EF AF xra a 09F0 3227F0 sta counter2 09F3 C9 ret 09F4 AF data_mode: xra a 09F5 3225F0 sta entry_mode 09F8 3226F0 sta counter1 09FB CDA40A call read_memory 09FE C9 ret 09FF 3E02 function_2nd: mvi a,2 0A01 3225F0 sta entry_mode 0A04 3E77 mvi a,77h 0A06 3210F0 sta buffer 0A09 3E38 mvi a,38h 0A0B 3211F0 sta buffer+1 0A0E 3E78 mvi a,78h 0A10 3212F0 sta buffer+2 0A13 3E00 mvi a,0 0A15 3213F0 sta buffer+3 0A18 3E00 mvi a,0 0A1A 3214F0 sta buffer+4 0A1D 3E00 mvi a,0 0A1F 3215F0 sta buffer+5 0A22 C9 ret ; set entry mode to 3 ; hex data will be used for register modifying 0A23 modify_register: 0A23 F5 push psw 0A24 3E03 mvi a,3 0A26 3225F0 sta entry_mode 0A29 3A13F0 lda buffer+3 0A2C F680 ori 80h 0A2E 3213F0 sta buffer+3 0A31 3A12F0 lda buffer+2 0A34 F680 ori 80h 0A36 3212F0 sta buffer+2 0A39 3A11F0 lda buffer+1 0A3C F680 ori 80h 0A3E 3211F0 sta buffer+1 0A41 3A10F0 lda buffer 0A44 F680 ori 80h 0A46 3210F0 sta buffer 0A49 F1 pop psw 0A4A C9 ret ; increment key works with mode0 or mode1 display 0A4B 3E00 increment: mvi a,0 0A4D 3225F0 sta entry_mode ; switch to data mode 0A50 3226F0 sta counter1 ; clear event counter1 0A53 2A29F0 lhld user_PC 0A56 23 inx h

A8085.LST 29/3/2558 15:27

Page 25 of 63

Page 79: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976

0A57 2229F0 shld user_PC 0A5A CDA40A call read_memory 0A5D C9 ret ; decrement key works with mode0 or mode1 display 0A5E 3E00 decrement: mvi a,0 0A60 3225F0 sta entry_mode ; switch to data mode 0A63 2A29F0 lhld user_PC 0A66 2B dcx h 0A67 2229F0 shld user_PC 0A6A CDA40A call read_memory 0A6D C9 ret ; convert nibble 0-F to 8-bit seven segment code ; entry: A ; exit: A 0A6E to_seven_segment: 0A6E E60F ani 0fh ; get only low nibble as the index 0A70 21751D lxi h,convert 0A73 5F mov e,a 0A74 1600 mvi d,0 0A76 19 dad d 0A77 7E mov a,m ; get code 0A78 C9 ret ; convert [HL] to display buffer 0-3 ; for register display ; entry: HL 0A79 read_register: 0A79 E5 push h 0A7A 7C mov a,h 0A7B F5 push psw 0A7C 0F rrc 0A7D 0F rrc 0A7E 0F rrc 0A7F 0F rrc 0A80 CD6E0A call to_seven_segment 0A83 3210F0 sta buffer 0A86 F1 pop psw 0A87 CD6E0A call to_seven_segment 0A8A 3211F0 sta buffer+1 0A8D E1 pop h 0A8E E5 push h 0A8F 7D mov a,l 0A90 F5 push psw 0A91 0F rrc 0A92 0F rrc 0A93 0F rrc 0A94 0F rrc 0A95 CD6E0A call to_seven_segment 0A98 3212F0 sta buffer+2 0A9B F1 pop psw 0A9C CD6E0A call to_seven_segment 0A9F 3213F0 sta buffer+3 0AA2 E1 pop h 0AA3 C9 ret ; convert current address and data to display buffer ; 0AA4 2A29F0 read_memory: lhld user_PC 0AA7 E5 push h 0AA8 7C mov a,h 0AA9 F5 push psw

A8085.LST 29/3/2558 15:27

Page 26 of 63

Page 80: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

1977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052

0AAA 0F rrc 0AAB 0F rrc 0AAC 0F rrc 0AAD 0F rrc 0AAE CD6E0A call to_seven_segment 0AB1 3210F0 sta buffer 0AB4 F1 pop psw 0AB5 CD6E0A call to_seven_segment 0AB8 3211F0 sta buffer+1 0ABB E1 pop h 0ABC E5 push h 0ABD 7D mov a,l 0ABE F5 push psw 0ABF 0F rrc 0AC0 0F rrc 0AC1 0F rrc 0AC2 0F rrc 0AC3 CD6E0A call to_seven_segment 0AC6 3212F0 sta buffer+2 0AC9 F1 pop psw 0ACA CD6E0A call to_seven_segment 0ACD 3213F0 sta buffer+3 0AD0 E1 pop h 0AD1 7E mov a,m ; read from memory 0AD2 F5 push psw 0AD3 0F rrc 0AD4 0F rrc 0AD5 0F rrc 0AD6 0F rrc 0AD7 CD6E0A call to_seven_segment 0ADA 3214F0 sta buffer+4 0ADD F1 pop psw 0ADE CD6E0A call to_seven_segment 0AE1 3215F0 sta buffer+5 0AE4 CDE80A call mode_indicator 0AE7 C9 ret 0AE8 mode_indicator: 0AE8 F5 push psw 0AE9 3A25F0 lda entry_mode 0AEC FE00 cpi 0 0AEE C2230B jnz mode1 0AF1 3A15F0 lda buffer+5 ; mode 0 indicator 0AF4 F680 ori 80h 0AF6 3215F0 sta buffer+5 0AF9 3A14F0 lda buffer+4 0AFC F680 ori 80h 0AFE 3214F0 sta buffer+4 0B01 3A13F0 lda buffer+3 0B04 E67F ani 7fh 0B06 3213F0 sta buffer+3 0B09 3A12F0 lda buffer+2 0B0C E67F ani 7fh 0B0E 3212F0 sta buffer+2 0B11 3A11F0 lda buffer+1 0B14 E67F ani 7fh 0B16 3211F0 sta buffer+1

A8085.LST 29/3/2558 15:27

Page 27 of 63

Page 81: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128

0B19 3A10F0 lda buffer 0B1C E67F ani 7fh 0B1E 3210F0 sta buffer 0B21 F1 pop psw 0B22 C9 ret 0B23 FE01 mode1: cpi 1 0B25 C25A0B jnz mode2 0B28 3A15F0 lda buffer+5 ; mode 1 indicator 0B2B E67F ani 7fh 0B2D 3215F0 sta buffer+5 0B30 3A14F0 lda buffer+4 0B33 E67F ani 7fh 0B35 3214F0 sta buffer+4 0B38 3A13F0 lda buffer+3 0B3B F680 ori 80h 0B3D 3213F0 sta buffer+3 0B40 3A12F0 lda buffer+2 0B43 F680 ori 80h 0B45 3212F0 sta buffer+2 0B48 3A11F0 lda buffer+1 0B4B F680 ori 80h 0B4D 3211F0 sta buffer+1 0B50 3A10F0 lda buffer 0B53 F680 ori 80h 0B55 3210F0 sta buffer 0B58 F1 pop psw 0B59 C9 ret 0B5A F1 mode2: pop psw 0B5B C9 ret 0B5C 0E07 cold_boot: mvi c,7 0B5E 217A0B lxi h,title 0B61 1605 cold2: mvi d,5 0B63 CD940C cold1: call scan 0B66 15 dcr d 0B67 C2630B jnz cold1 0B6A 23 inx h 0B6B 0D dcr c 0B6C C2610B jnz cold2 0B6F 2B dcx h 0B70 0E50 mvi c,80 0B72 CD940C cold3: call scan 0B75 0D dcr c 0B76 C2720B jnz cold3 0B79 C9 ret 0B7A 0000000000title: dfb 0,0,0,0,0,0,7fh,3fh,7fh,6dh,0,0 ; display data read from memory pointed to by HL on LED ; entry: HL ;

A8085.LST 29/3/2558 15:27

Page 28 of 63

Page 82: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204

0B86 1605 demo: mvi d,5 0B88 CD940C demo1_2: call scan 0B8B 15 dcr d 0B8C C2880B jnz demo1_2 0B8F 23 inx h 0B90 C9 ret ; convert position key to internal key code 0-F for data entry and 10-19H for ; function keys ; entry: A = scan code ; exit: A = internal code 0B91 FE02 get_key_code: cpi 2 0B93 C2990B jnz code1 0B96 3E00 mvi a,0 0B98 C9 ret 0B99 FE0A code1: cpi 0ah 0B9B C2A10B jnz code2 0B9E 3E01 mvi a,1 0BA0 C9 ret 0BA1 FE12 code2: cpi 12h 0BA3 C2A90B jnz code3 0BA6 3E02 mvi a,2 0BA8 C9 ret 0BA9 FE1A code3: cpi 1ah 0BAB C2B10B jnz code4 0BAE 3E03 mvi a,3 0BB0 C9 ret 0BB1 FE03 code4: cpi 3 0BB3 C2B90B jnz code5 0BB6 3E04 mvi a,4 0BB8 C9 ret 0BB9 FE0B code5: cpi 0bh 0BBB C2C10B jnz code6 0BBE 3E05 mvi a,5 0BC0 C9 ret 0BC1 FE13 code6: cpi 13h 0BC3 C2C90B jnz code7 0BC6 3E06 mvi a,6 0BC8 C9 ret 0BC9 FE1B code7: cpi 1bh 0BCB C2D10B jnz code8 0BCE 3E07 mvi a,7 0BD0 C9 ret 0BD1 FE04 code8: cpi 4 0BD3 C2D90B jnz code9 0BD6 3E08 mvi a,8 0BD8 C9 ret 0BD9 FE0C code9: cpi 0ch 0BDB C2E10B jnz code10 0BDE 3E09 mvi a,9 0BE0 C9 ret 0BE1 FE14 code10: cpi 14h 0BE3 C2E90B jnz code11 0BE6 3E0A mvi a,0ah 0BE8 C9 ret 0BE9 FE1C code11: cpi 1ch 0BEB C2F10B jnz code12 0BEE 3E0B mvi a,0bh 0BF0 C9 ret 0BF1 FE05 code12: cpi 5 0BF3 C2F90B jnz code13

A8085.LST 29/3/2558 15:27

Page 29 of 63

Page 83: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280

0BF6 3E0C mvi a,0ch 0BF8 C9 ret 0BF9 FE0D code13: cpi 0dh 0BFB C2010C jnz code14 0BFE 3E0D mvi a,0dh 0C00 C9 ret 0C01 FE15 code14: cpi 15h 0C03 C2090C jnz code15 0C06 3E0E mvi a,0eh 0C08 C9 ret 0C09 FE1D code15: cpi 1dh 0C0B C2110C jnz code16 0C0E 3E0F mvi a,0fh 0C10 C9 ret 0C11 FE10 code16: cpi 10h 0C13 C2190C jnz code17 0C16 3E10 mvi a,10h 0C18 C9 ret 0C19 FE18 code17: cpi 18h 0C1B C2210C jnz code18 0C1E 3E11 mvi a,11h 0C20 C9 ret 0C21 FE01 code18: cpi 1 0C23 C2290C jnz code19 0C26 3E12 mvi a,12h 0C28 C9 ret 0C29 FE00 code19: cpi 0 0C2B C2310C jnz code20 0C2E 3E13 mvi a,13h 0C30 C9 ret 0C31 FE08 code20: cpi 8 0C33 C2390C jnz code21 0C36 3E14 mvi a,14h 0C38 C9 ret 0C39 FE09 code21: cpi 9 0C3B C2410C jnz code22 0C3E 3E15 mvi a,15h 0C40 C9 ret 0C41 FE11 code22: cpi 11h 0C43 C2490C jnz code23 0C46 3E16 mvi a,16h 0C48 C9 ret 0C49 FE19 code23: cpi 19h 0C4B C2510C jnz code24 0C4E 3E17 mvi a,17h 0C50 C9 ret 0C51 FE2E code24: cpi 2eh 0C53 C2590C jnz code25 0C56 3E18 mvi a,18h 0C58 C9 ret 0C59 FE2F code25: cpi 2fh 0C5B C2610C jnz code26 0C5E 3E19 mvi a,19h 0C60 C9 ret 0C61 3EFF code26: mvi a,0ffh 0C63 C9 ret ; scan display and keyboard unitl key was pressed 0C64 scan_key: ; mvi d,25 ; number of loop for timeout if key still pressed 0C64 scan_key4: ;push d ; save d

A8085.LST 29/3/2558 15:27

Page 30 of 63

Page 84: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356

0C64 2110F0 lxi h,buffer 0C67 CD940C call scan 0C6A 3A21F0 lda key 0C6D FEFF cpi 0ffh 0C6F C2640C jnz scan_key4 ; loop if key still pressed ;pop d 0C72 F2750C jp scan_key3 0C75 scan_key2: ;pop d ;dcr d ;jp scan_key4 ; no repeat function ; repeat if still pressed when timeout 0C75 CD8D0C scan_key3: call debounce ; debounce after released 0C78 2110F0 lxi h,buffer 0C7B CD940C scan_key1: call scan 0C7E 3A21F0 lda key 0C81 FEFF cpi 0ffh 0C83 CA7B0C jz scan_key1 ; loop until key will be pressed 0C86 CD8D0C call debounce 0C89 CD910B call get_key_code ; call out2x 0C8C C9 ret 0C8D 060A debounce: mvi b,10 0C8F 05 debounce1: dcr b 0C90 C28F0C jnz debounce1 0C93 C9 ret ; subroutine scan keyboard and display ; input: hl pointer to buffer ; exit: key = scan code ; -1 no key pressed ; 0C94 E5 scan: push h 0C95 C5 push b 0C96 D5 push d 0C97 0E06 mvi c,6 ; for 6-digit LED 0C99 1E00 mvi e,0 ; digit scan code appears at 4-to-10 decoder 0C9B 1600 mvi d,0 ; key position 0C9D 3EFF mvi a,0ffh ; put -1 to key 0C9F 3221F0 sta key ; key = -1 0CA2 7B scan1: mov a,e 0CA3 F6F0 ori 0f0h ; high nibble must be 1111 0CA5 D312 out system_port_c ; active digit first 0CA7 7E mov a,m ; load a with [hl] 0CA8 D311 out system_port_b ; then turn segment on 0CAA 0600 mvi b,0 ; delay for transition process 0CAC 05 wait1: dcr b 0CAD C2AC0C jnz wait1 0CB0 DB10 in system_port_a ; read input port 0CB2 0608 mvi b,8 ; check all 8-row 0CB4 1F shift_key: rar ; rotate right through carry 0CB5 DABE0C jc next_key ; if carry = 1 then no key pressed 0CB8 F5 push psw 0CB9 7A mov a,d

A8085.LST 29/3/2558 15:27

Page 31 of 63

Page 85: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432

0CBA 3221F0 sta key ; save key position 0CBD F1 pop psw 0CBE next_key: 0CBE 14 inr d ; next key position 0CBF 05 dcr b ; until 8-bit was shifted 0CC0 C2B40C jnz shift_key 0CC3 3E00 mvi a,0 ; clear a 0CC5 D311 out system_port_b ; turn off led 0CC7 1C inr e ; next digit scan code 0CC8 23 inx h ; next location 0CC9 0D dcr c ; next column 0CCA C2A20C jnz scan1 0CCD CDD40C call serial_command 0CD0 D1 pop d 0CD1 C1 pop b 0CD2 E1 pop h 0CD3 C9 ret ;----------- serial commands with 9600 8n1 terminal -------------------- ; check if serial buffer has command ; 0CD4 serial_command: 0CD4 3A24F0 lda uart_found 0CD7 FE00 cpi 0 0CD9 CA180D jz skip_serial 0CDC CD2C12 call get_command 0CDF CD370D call download 0CE2 CD190D call prompting 0CE5 CDD812 call hex_dump 0CE8 CDD511 call help 0CEB CDAE11 call quick_home 0CEE CDC311 call io_address 0CF1 CD9111 call new_location 0CF4 CD0E11 call edit_location 0CF7 CDC410 call jump_to_user_pgm 0CFA CDAB10 call monitor_function 0CFD CD590D call ascii_print 0D00 CD6710 call fill_memory 0D03 CD330F call register_display 0D06 CDF30E call stack_display 0D09 CD0E03 call disassemble1 0D0C CDE70E call single_step_ 0D0F CDD80E call print_watch 0D12 CDBD0E call clear_watch 0D15 CD8B0D call set_user_register 0D18 skip_serial: 0D18 C9 ret 0D19 3A22F0 prompting: lda command 0D1C FE0D cpi cr 0D1E C2360D jnz exit_prompting 0D21 send_prompt: 0D21 CDC112 call new_line 0D24 2A3BF0 lhld pointer ; user_PC 0D27 7C mov a,h 0D28 CDB212 call out2x 0D2B 7D mov a,l 0D2C CDB212 call out2x 0D2F 21CB1D lxi h,prompt_text

A8085.LST 29/3/2558 15:27

Page 32 of 63

Page 86: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508

0D32 CD3F12 call put_str 0D35 C9 ret 0D36 C9 exit_prompting: ret ; command execute ; get command from serial port 0D37 3A22F0 download: lda command 0D3A FE6C cpi "l" 0D3C C2580D jnz exit_download 0D3F CDBC14 call clear_bcd1 ; reset bcd counter1 0D42 3E01 mvi a,1 0D44 3239F0 sta temp 0D47 AF xra a 0D48 3220F0 sta bcs ; clear byte chekc sum error 0D4B 21B41D lxi h,download_text 0D4E CD3F12 call put_str 0D51 CDEA13 call get_record 0D54 CD210D call send_prompt 0D57 C9 ret 0D58 C9 exit_download ret ; display printable ASCII code, 20H-7FH 0D59 3A22F0 ascii_print: lda command 0D5C FE61 cpi "a" 0D5E C28A0D jnz exit_ascii_print 0D61 21451E lxi h, ascii_text 0D64 CD3F12 call put_str 0D67 CDC112 call new_line 0D6A CDC112 call new_line 0D6D 2E20 mvi l,20h 0D6F 0E60 mvi c,96 0D71 ascii_print1: 0D71 7D mov a,l 0D72 CD1612 call cout 0D75 3E3D mvi a,"=" 0D77 CD1612 call cout 0D7A 7D mov a,l 0D7B CDB212 call out2x 0D7E CDCC12 call space 0D81 2C inr l 0D82 0D dcr c 0D83 C2710D jnz ascii_print1 0D86 CD210D call send_prompt 0D89 C9 ret 0D8A exit_ascii_print: 0D8A C9 ret ;------------------- set value to user registers --------------------- ; set value to user register AF, BC, DE, HL, SP, PC 0D8B set_user_register: 0D8B 3A22F0 lda command 0D8E FE73 cpi "s" 0D90 C29F0E jnz exit_set_user 0D93 21F31E lxi h, set_register_text

A8085.LST 29/3/2558 15:27

Page 33 of 63

Page 87: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584

0D96 CD3F12 call put_str 0D99 CD2212 call cin 0D9C FE61 cpi "a" 0D9E C2C70D jnz set_user1 0DA1 CDC112 call new_line 0DA4 21971E lxi h,af_text 0DA7 CD3F12 call put_str 0DAA 2A2BF0 lhld user_AF 0DAD 7C mov a,h 0DAE CDB212 call out2x 0DB1 7D mov a,l 0DB2 CDB212 call out2x 0DB5 CDD212 call send_tab 0DB8 CD8513 call get_hex2 0DBB 67 mov h,a 0DBC CD8513 call get_hex2 0DBF 6F mov l,a 0DC0 222BF0 shld user_AF 0DC3 CD210D call send_prompt 0DC6 C9 ret 0DC7 set_user1: 0DC7 FE62 cpi "b" 0DC9 C2F20D jnz set_user2 0DCC CDC112 call new_line 0DCF 219B1E lxi h,bc_text 0DD2 CD3F12 call put_str 0DD5 2A2DF0 lhld user_BC 0DD8 7C mov a,h 0DD9 CDB212 call out2x 0DDC 7D mov a,l 0DDD CDB212 call out2x 0DE0 CDD212 call send_tab 0DE3 CD8513 call get_hex2 0DE6 67 mov h,a 0DE7 CD8513 call get_hex2 0DEA 6F mov l,a 0DEB 222DF0 shld user_BC 0DEE CD210D call send_prompt 0DF1 C9 ret 0DF2 set_user2: 0DF2 FE64 cpi "d" 0DF4 C21D0E jnz set_user3 0DF7 CDC112 call new_line 0DFA 219F1E lxi h,de_text 0DFD CD3F12 call put_str 0E00 2A2FF0 lhld user_DE 0E03 7C mov a,h 0E04 CDB212 call out2x 0E07 7D mov a,l 0E08 CDB212 call out2x 0E0B CDD212 call send_tab 0E0E CD8513 call get_hex2 0E11 67 mov h,a 0E12 CD8513 call get_hex2 0E15 6F mov l,a 0E16 222FF0 shld user_DE 0E19 CD210D call send_prompt 0E1C C9 ret 0E1D set_user3: 0E1D FE68 cpi "h" 0E1F C2480E jnz set_user4 0E22 CDC112 call new_line 0E25 21A31E lxi h,hl_text 0E28 CD3F12 call put_str 0E2B 2A31F0 lhld user_HL

A8085.LST 29/3/2558 15:27

Page 34 of 63

Page 88: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660

0E2E 7C mov a,h 0E2F CDB212 call out2x 0E32 7D mov a,l 0E33 CDB212 call out2x 0E36 CDD212 call send_tab 0E39 CD8513 call get_hex2 0E3C 67 mov h,a 0E3D CD8513 call get_hex2 0E40 6F mov l,a 0E41 2231F0 shld user_HL 0E44 CD210D call send_prompt 0E47 C9 ret 0E48 set_user4: 0E48 FE73 cpi "s" 0E4A C2730E jnz set_user5 0E4D CDC112 call new_line 0E50 21A71E lxi h,sp_text 0E53 CD3F12 call put_str 0E56 2A33F0 lhld user_SP 0E59 7C mov a,h 0E5A CDB212 call out2x 0E5D 7D mov a,l 0E5E CDB212 call out2x 0E61 CDD212 call send_tab 0E64 CD8513 call get_hex2 0E67 67 mov h,a 0E68 CD8513 call get_hex2 0E6B 6F mov l,a 0E6C 2233F0 shld user_SP 0E6F CD210D call send_prompt 0E72 C9 ret 0E73 set_user5: 0E73 FE70 cpi "p" 0E75 C29E0E jnz set_user6 0E78 CDC112 call new_line 0E7B 21B01E lxi h,pc_text 0E7E CD3F12 call put_str 0E81 2A29F0 lhld user_PC 0E84 7C mov a,h 0E85 CDB212 call out2x 0E88 7D mov a,l 0E89 CDB212 call out2x 0E8C CDD212 call send_tab 0E8F CD8513 call get_hex2 0E92 67 mov h,a 0E93 CD8513 call get_hex2 0E96 6F mov l,a 0E97 2229F0 shld user_PC 0E9A CD210D call send_prompt 0E9D C9 ret 0E9E C9 set_user6: ret 0E9F exit_set_user: 0E9F C9 ret 0EA0 print_watch_ram: 0EA0 CDC112 call new_line

A8085.LST 29/3/2558 15:27

Page 35 of 63

Page 89: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736

0EA3 2100F0 lxi h, watch_ram 0EA6 0E10 mvi c,16 0EA8 7C mov a,h 0EA9 CDB212 call out2x 0EAC 7D mov a,l 0EAD CDB212 call out2x 0EB0 watch1: 0EB0 CDCC12 call space 0EB3 7E mov a,m 0EB4 CDB212 call out2x 0EB7 23 inx h 0EB8 0D dcr c 0EB9 C2B00E jnz watch1 0EBC C9 ret ;----------- clear watch variables------------------------------------ 0EBD 3A22F0 clear_watch: lda command 0EC0 FE63 cpi "c" 0EC2 C2D70E jnz exit_clear_watch 0EC5 2100F0 lxi h, watch_ram 0EC8 0E10 mvi c,16 0ECA AF clear1: xra a 0ECB 77 mov m,a 0ECC 23 inx h 0ECD 0D dcr c 0ECE C2CA0E jnz clear1 0ED1 CDA00E call print_watch_ram 0ED4 CD210D call send_prompt 0ED7 C9 exit_clear_watch: ret ;----------- print watch variables ------------------------------------ 0ED8 print_watch: 0ED8 3A22F0 lda command 0EDB FE77 cpi "w" 0EDD C2E60E jnz exit_watch 0EE0 CDA00E call print_watch_ram 0EE3 CD210D call send_prompt 0EE6 C9 exit_watch: ret ;---------- single step running with key space ----------------------- 0EE7 single_step_: 0EE7 3A22F0 lda command 0EEA FE20 cpi " " 0EEC C2F20E jnz exit_step 0EEF CDA509 call single_step 0EF2 exit_step: 0EF2 C9 ret ;------- display stack area from top of stack to initial ------------- 0EF3 stack_display: 0EF3 3A22F0 lda command 0EF6 FE6B cpi "k" 0EF8 C2320F jnz exit_stack ; lxi h,stack_text ; call put_str

A8085.LST 29/3/2558 15:27

Page 36 of 63

Page 90: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812

0EFB 21201E lxi h,edit_text2 0EFE CD3F12 call put_str 0F01 CDC112 call new_line 0F04 2A33F0 lhld user_SP 0F07 stack_display1: 0F07 7C mov a,h 0F08 CDB212 call out2x 0F0B 7D mov a,l 0F0C CDB212 call out2x 0F0F CDCC12 call space 0F12 CDCC12 call space 0F15 3E5B mvi a,"[" 0F17 CD1612 call cout 0F1A 7E mov a,m 0F1B CDB212 call out2x 0F1E 3E5D mvi a,"]" 0F20 CD1612 call cout 0F23 CDC112 call new_line 0F26 23 inx h 0F27 1199F0 lxi d, user_stack+32+1 ; load base of user stack 0F2A 7D mov a,l 0F2B AB xra e 0F2C C2070F jnz stack_display1 0F2F CD210D call send_prompt 0F32 exit_stack: 0F32 C9 ret ;---------------- registers display ---------------------------------- 0F33 register_display: 0F33 3A22F0 lda command 0F36 FE72 cpi "r" 0F38 C25810 jnz exit_register 0F3B register_display1: ; lda uart_found ; cpi 0 ; jz exit_register ; exit of no uart 0F3B CDC112 call new_line 0F3E register_display2: 0F3E CDC112 call new_line 0F41 21971E lxi h,af_text 0F44 CD3F12 call put_str 0F47 2A2BF0 lhld user_AF 0F4A 7C mov a,h 0F4B CDB212 call out2x 0F4E 7D mov a,l 0F4F CDB212 call out2x 0F52 CDCC12 call space 0F55 219B1E lxi h,bc_text 0F58 CD3F12 call put_str 0F5B 2A2DF0 lhld user_BC 0F5E 7C mov a,h 0F5F CDB212 call out2x 0F62 7D mov a,l

A8085.LST 29/3/2558 15:27

Page 37 of 63

Page 91: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888

0F63 CDB212 call out2x 0F66 CDCC12 call space 0F69 219F1E lxi h,de_text 0F6C CD3F12 call put_str 0F6F 2A2FF0 lhld user_DE 0F72 7C mov a,h 0F73 CDB212 call out2x 0F76 7D mov a,l 0F77 CDB212 call out2x 0F7A CDCC12 call space 0F7D 21A31E lxi h,hl_text 0F80 CD3F12 call put_str 0F83 2A31F0 lhld user_HL 0F86 7C mov a,h 0F87 CDB212 call out2x 0F8A 7D mov a,l 0F8B CDB212 call out2x 0F8E CDCC12 call space 0F91 21A71E lxi h,sp_text 0F94 CD3F12 call put_str 0F97 2A33F0 lhld user_SP 0F9A 7C mov a,h 0F9B CDB212 call out2x 0F9E 7D mov a,l 0F9F CDB212 call out2x 0FA2 CDCC12 call space ; lxi h,tos_text ; call put_str ; lhld tos ; mov a,h ; call out2x ; mov a,l ; call out2x ; call space 0FA5 21B01E lxi h,pc_text 0FA8 CD3F12 call put_str 0FAB 2A29F0 lhld user_PC 0FAE 7C mov a,h 0FAF CDB212 call out2x 0FB2 7D mov a,l 0FB3 CDB212 call out2x 0FB6 CDCC12 call space 0FB9 21CA1E lxi h,sign_text 0FBC CD3F12 call put_str 0FBF 2A2BF0 lhld user_AF 0FC2 7D mov a,l 0FC3 E680 ani 80h 0FC5 C2D00F jnz register_flag1 0FC8 3E30 mvi a,"0" 0FCA CD1612 call cout 0FCD C3D50F jmp register_flag2 0FD0 register_flag1: 0FD0 3E31 mvi a,"1" 0FD2 CD1612 call cout 0FD5 register_flag2: 0FD5 CDCC12 call space 0FD8 215910 lxi h,zero_text 0FDB CD3F12 call put_str 0FDE 2A2BF0 lhld user_AF 0FE1 7D mov a,l 0FE2 E640 ani 40h 0FE4 C2EF0F jnz register_flag3 0FE7 3E30 mvi a,"0"

A8085.LST 29/3/2558 15:27

Page 38 of 63

Page 92: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964

0FE9 CD1612 call cout 0FEC C3F40F jmp register_flag4 0FEF register_flag3: 0FEF 3E31 mvi a,"1" 0FF1 CD1612 call cout 0FF4 register_flag4: 0FF4 CDCC12 call space 0FF7 215C10 lxi h,AC_text 0FFA CD3F12 call put_str 0FFD 2A2BF0 lhld user_AF 1000 7D mov a,l 1001 E610 ani 10h 1003 C20E10 jnz register_flag5 1006 3E30 mvi a,"0" 1008 CD1612 call cout 100B C31310 jmp register_flag6 100E register_flag5: 100E 3E31 mvi a,"1" 1010 CD1612 call cout 1013 register_flag6: 1013 CDCC12 call space 1016 216010 lxi h,P_text 1019 CD3F12 call put_str 101C 2A2BF0 lhld user_AF 101F 7D mov a,l 1020 E604 ani 4 1022 C22D10 jnz register_flag7 1025 3E30 mvi a,"0" 1027 CD1612 call cout 102A C33210 jmp register_flag8 102D register_flag7: 102D 3E31 mvi a,"1" 102F CD1612 call cout 1032 register_flag8: 1032 CDCC12 call space 1035 216310 lxi h,CY_text 1038 CD3F12 call put_str 103B 2A2BF0 lhld user_AF 103E 7D mov a,l 103F E601 ani 1 1041 C24C10 jnz register_flag9 1044 3E30 mvi a,"0" 1046 CD1612 call cout 1049 C35110 jmp register_flag10 104C register_flag9: 104C 3E31 mvi a,"1" 104E CD1612 call cout 1051 register_flag10: 1051 CDCC12 call space 1054 CD210D call send_prompt 1057 C9 ret 1058 exit_register: 1058 C9 ret 1059 5A3D00 zero_text dfb "Z=",0 105C 41433D00 AC_text dfb "AC=",0 1060 503D00 P_text dfb "P=",0 1063 43593D00 CY_text dfb "CY=",0 ;----------------- fill constant to memory --------------------------- 1067 fill_memory:

A8085.LST 29/3/2558 15:27

Page 39 of 63

Page 93: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

2965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040

1067 3A22F0 lda command 106A FE66 cpi "f" 106C C2AA10 jnz exit_fill 106F 21561E lxi h,fill_text1 1072 CD3F12 call put_str 1075 CD6C13 call get_hex1 1078 67 mov h,a 1079 CD6C13 call get_hex1 107C 6F mov l,a 107D E5 push h ; save begin address to stack 107E 21671E lxi h,fill_text2 1081 CD3F12 call put_str 1084 CD6C13 call get_hex1 1087 67 mov h,a 1088 CD6C13 call get_hex1 108B 6F mov l,a 108C E5 push h ; save end address to stack 108D 21771E lxi h,fill_text3 1090 CD3F12 call put_str 1093 CD6C13 call get_hex1 1096 47 mov b,a ; byte save to B 1097 D1 pop d ; end address in DE 1098 E1 pop h ; begin address in HL 1099 fill_memory1: 1099 78 mov a,b 109A 77 mov m,a 109B 23 inx h 109C 7D mov a,l 109D BB cmp e 109E C29910 jnz fill_memory1 10A1 7C mov a,h 10A2 BA cmp d 10A3 C29910 jnz fill_memory1 10A6 CD210D call send_prompt 10A9 C9 ret 10AA exit_fill: 10AA C9 ret ;---------------- monitor function list ------------------------------- 10AB monitor_function: 10AB 3A22F0 lda command 10AE FE6D cpi "m" 10B0 C2C310 jnz exit_monitor 10B3 CDC112 call new_line 10B6 215322 lxi h,monitor_text 10B9 CD3F12 call put_str 10BC CDC112 call new_line 10BF CD210D call send_prompt 10C2 C9 ret 10C3 exit_monitor: 10C3 C9 ret ;----------------------- jump to user program --------------------

A8085.LST 29/3/2558 15:27

Page 40 of 63

Page 94: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116

10C4 3A22F0 jump_to_user_pgm: lda command 10C7 FE6A cpi "j" 10C9 C20D11 jnz exit_jump 10CC 212E1E lxi h, jump_text1 10CF CD3F12 call put_str 10D2 2A29F0 lhld user_PC 10D5 7C mov a,h 10D6 CDB212 call out2x 10D9 7D mov a,l 10DA CDB212 call out2x 10DD 21401E lxi h,jump_text2 10E0 CD3F12 call put_str 10E3 CD8513 call get_hex2 10E6 F5 push psw 10E7 3A23F0 lda flag1 10EA E601 ani 1 10EC C2FE10 jnz skip_load_PC 10EF F1 pop psw 10F0 67 mov h,a 10F1 CD8513 call get_hex2 10F4 6F mov l,a 10F5 2229F0 shld user_PC 10F8 CDC112 call new_line 10FB C38109 jmp go 10FE skip_load_PC: 10FE F1 pop psw 10FF 3A23F0 lda flag1 1102 E6FE ani 0feh 1104 3223F0 sta flag1 1107 CDC112 call new_line 110A C38109 jmp go 110D C9 exit_jump: ret ;------------ edit memory ----------------------------------------- 110E 3A22F0 edit_location: lda command 1111 FE65 cpi "e" 1113 C29011 jnz exit_edit 1116 21DD1D lxi h, edit_text 1119 CD3F12 call put_str 111C CD6C13 call get_hex1 111F 67 mov h,a 1120 CD6C13 call get_hex1 1123 6F mov l,a 1124 223BF0 shld pointer ;user_PC 1127 21F51D lxi h, edit_text1 112A CD3F12 call put_str 112D 21201E lxi h, edit_text2 1130 CD3F12 call put_str 1133 CDC112 edit1: call new_line 1136 2A3BF0 lhld pointer ;user_PC 1139 7C mov a,h 113A CDB212 call out2x 113D 7D mov a,l 113E CDB212 call out2x 1141 CDCC12 call space 1144 CDCC12 call space 1147 3E5B mvi a,"[" 1149 CD1612 call cout

A8085.LST 29/3/2558 15:27

Page 41 of 63

Page 95: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192

114C 7E mov a,m 114D CDB212 call out2x 1150 3E5D mvi a,"]" 1152 CD1612 call cout 1155 CDCC12 call space 1158 CD8513 call get_hex2 115B F5 push psw 115C 3A23F0 lda flag1 115F E601 ani 1 1161 C28111 jnz exit_edit1 ; Enter key? 1164 3A23F0 lda flag1 1167 E602 ani 2 1169 C27111 jnz skip_edit1 ; SPACE key? 116C F1 pop psw 116D 77 mov m,a 116E C37A11 jmp skip_edit2 1171 F1 skip_edit1: pop psw 1172 3A23F0 lda flag1 1175 E6FD ani 0fdh 1177 3223F0 sta flag1 117A skip_edit2: 117A 23 inx h 117B 223BF0 shld pointer ;user_PC 117E C33311 jmp edit1 1181 F1 exit_edit1: pop psw 1182 3A23F0 lda flag1 1185 E6FE ani 0feh 1187 3223F0 sta flag1 118A CDC112 call new_line 118D CD210D call send_prompt 1190 C9 exit_edit: ret 1191 3A22F0 new_location: lda command 1194 FE6E cpi "n" 1196 C2AD11 jnz exit_new_location 1199 21CD1D lxi h,new_text 119C CD3F12 call put_str 119F CD6C13 call get_hex1 11A2 67 mov h,a 11A3 CD6C13 call get_hex1 11A6 6F mov l,a 11A7 223BF0 shld pointer ; user_PC 11AA CD210D call send_prompt 11AD exit_new_location: 11AD C9 ret 11AE quick_home: 11AE 3A22F0 lda command 11B1 FE71 cpi "q" 11B3 C2C211 jnz exit_quick_home 11B6 210081 lxi h,home_address 11B9 2229F0 shld user_PC 11BC 223BF0 shld pointer 11BF CD210D call send_prompt

A8085.LST 29/3/2558 15:27

Page 42 of 63

Page 96: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268

11C2 exit_quick_home: 11C2 C9 ret ; i/o address map 11C3 3A22F0 io_address: lda command 11C6 FE69 cpi "i" 11C8 C2D411 jnz exit_io 11CB 21EA20 lxi h,io_text 11CE CD3F12 call put_str 11D1 CD210D call send_prompt 11D4 C9 exit_io: ret ; help listing 11D5 3A22F0 help: lda command 11D8 FE3F cpi "?" 11DA C2EC11 jnz exit_help 11DD 215612 lxi h,prompt3 11E0 CD4D12 call alt_put_str 11E3 21551F lxi h,help_text1 11E6 CD3F12 call put_str 11E9 CD210D call send_prompt 11EC C9 exit_help: ret ; initialize 16C550 uart to 9600 8n1 with 2MHz clock ; 2MHz/13 = 153846Hz 11ED init_uart: 11ED 3E83 mvi a,83h 11EF D343 out uart_lcr ; set DLAB bit to access divider 11F1 3E0D mvi a,13 11F3 D340 out uart_divisor_lsb 11F5 3E00 mvi a,0 11F7 D341 out uart_divisor_msb ; 2MHz/13 = 153846 Hz ; 153846Hz/16 = 9615Hz 11F9 3E07 mvi a,7 11FB D342 out uart_fifo ; init fifo and clear all buffers 11FD 3E03 mvi a,03h 11FF D343 out uart_lcr ; clar DLAB ; check uart line status, if the byte is FF then no uart ; ; 1201 AF xra a 1202 D347 out uart_scr ; check if there is uart 1204 DB47 in uart_scr 1206 FE00 cpi 0 1208 CA1012 jz found 120B AF xra a 120C 3224F0 sta uart_found 120F C9 ret 1210 3E01 found mvi a,1 1212 3224F0 sta uart_found 1215 C9 ret 1216 47 cout: mov b,a ; save a 1217 DB45 cout1: in uart_line_status 1219 E620 ani 20h ; transmitter ready? 121B CA1712 jz cout1 121E 78 mov a,b ; restore a 121F D340 out uart_buffer 1221 C9 ret 1222 DB45 cin: in uart_line_status

A8085.LST 29/3/2558 15:27

Page 43 of 63

Page 97: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344

1224 E601 ani 1 ; data available? 1226 CA2212 jz cin 1229 DB40 in uart_buffer 122B C9 ret 122C DB45 get_command: in uart_line_status 122E E601 ani 1 1230 CA3912 jz no_data 1233 DB40 in uart_buffer 1235 3222F0 sta command ; command = ASCII code 1238 C9 ret 1239 3EFF no_data: mvi a,0ffh ; command == -1 123B 3222F0 sta command 123E C9 ret ; print string terminated by 0 ; input: HL 123F 7E put_str: mov a,m ; get A from [HL] 1240 FE00 cpi 0 1242 C24612 jnz put_str1 1245 C9 ret 1246 CD1612 put_str1: call cout 1249 23 inx h 124A F23F12 jp put_str 124D 7E alt_put_str: mov a,m ; get A from [HL] 124E EEAA xri 0aah 1250 FE00 cpi 0 1252 C28C12 jnz put_str2 1255 C9 ret 1256 A7A0A0E7FEprompt3: dfb 0A7h,0A0h,0A0h,0E7h,0FEh,0E1h,087h,092h,09Fh,08Ah,092h,09Ah,092h,09Fh,08Ah,0E7h, 1266 E3E9F8E5FA dfb 0E3h,0E9h,0F8h,0E5h,0FAh,0F8h,0E5h,0E9h,0EFh,0F9h,0F9h,0E5h,0F8h,08Ah,0FEh,0F8h, 1276 EBE3E4E3E4 dfb 0EBh,0E3h,0E4h,0E3h,0E4h,0EDh,08Ah,0E1h,0E3h,0FEh,08Ah,082h,095h,08Ah,0E2h,0EFh, 1286 E6FA83A7A0 dfb 0E6h,0FAh,083h,0A7h,0a0h,0aah 128C CD1612 put_str2: call cout 128F 23 inx h 1290 F24D12 jp alt_put_str 1293 213F1D send_prompt1: lxi h,prompt1 1296 CD3F12 call put_str 1299 C9 ret 129A 215612 send_prompt3: lxi h,prompt3 129D CD4D12 call alt_put_str 12A0 C9 ret 12A1 F5 out1x: push psw 12A2 E60F ani 0fh 12A4 C630 adi "0" 12A6 FE3A cpi 3Ah 12A8 DAAD12 jc out1x1 12AB C607 adi 7 12AD CD1612 out1x1: call cout 12B0 F1 pop psw 12B1 C9 ret 12B2 out2x: 12B2 0F rrc 12B3 0F rrc 12B4 0F rrc 12B5 0F rrc 12B6 CDA112 call out1x 12B9 07 rlc 12BA 07 rlc

A8085.LST 29/3/2558 15:27

Page 44 of 63

Page 98: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420

12BB 07 rlc 12BC 07 rlc 12BD CDA112 call out1x 12C0 C9 ret ; new_line 12C1 3E0D new_line: mvi a,cr 12C3 CD1612 call cout 12C6 3E0A mvi a,lf 12C8 CD1612 call cout 12CB C9 ret 12CC 3E20 space: mvi a," " 12CE CD1612 call cout 12D1 C9 ret 12D2 3E09 send_tab: mvi a,9 12D4 CD1612 call cout 12D7 C9 ret 12D8 3A22F0 hex_dump: lda command 12DB FE68 cpi "h" 12DD C23713 jnz exit_hex_dump 12E0 CDC112 call new_line 12E3 0E08 mvi c,8 ; 8 lines 12E5 C5 hex_dump2: push b 12E6 CDC112 call new_line 12E9 2A3BF0 lhld pointer ;user_PC 12EC 7C mov a,h 12ED CDB212 call out2x 12F0 7D mov a,l 12F1 CDB212 call out2x 12F4 CDCC12 call space 12F7 0E10 mvi c,16 12F9 CDCC12 hex_dump1: call space 12FC 7E mov a,m 12FD CDB212 call out2x 1300 23 inx h 1301 0D dcr c 1302 C2F912 jnz hex_dump1 1305 CDCC12 call space 1308 CDCC12 call space 130B CDCC12 call space ; print ASCII representation 20H-7FH ; outside such range, print . instead 130E 11F0FF lxi d,0FFF0h ; load DE with -16 1311 19 dad d ; ADD HL,DE 1312 0E10 mvi c,16 1314 7E hex_dump5: mov a,m 1315 FE20 cpi 20h ; <20H? 1317 DA1F13 jc hex_dump3 131A FE80 cpi 80h 131C DA2113 jc hex_dump4 131F 3E2E hex_dump3: mvi a,"." 1321 CD1612 hex_dump4: call cout 1324 23 inx h 1325 0D dcr c 1326 C21413 jnz hex_dump5 1329 223BF0 shld pointer ;user_PC

A8085.LST 29/3/2558 15:27

Page 45 of 63

Page 99: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496

132C C1 pop b 132D 0D dcr c 132E C2E512 jnz hex_dump2 1331 CDC112 call new_line 1334 CD210D call send_prompt 1337 C9 exit_hex_dump: ret 1338 210081 dump_memory: lxi h,8100h 133B 0E64 mvi c,100 ; 100 bytes display 133D CDC112 call new_line 1340 7E dump1: mov a,m 1341 CDB212 call out2x 1344 CDCC12 call space 1347 23 inx h 1348 0D dcr c 1349 C24013 jnz dump1 134C C9 ret ; convert ASCII letter to one nibble 0-F ; 0-9 -> al-30 ; A-F -> al-7 ; entry: A ; exit: A 134D D630 to_hex: sui "0" 134F FE0A cpi 10 1351 DA5813 jc zero_nine 1354 E6DF ani 11011111b 1356 D607 sui 7 ; convert to A-F 1358 zero_nine: 1358 C9 ret ; read two ASCII bytes and convert them to one bye 8-bit data ; exit: A ; used: A, E 1359 CD2212 get_hex: call cin 135C CD4D13 call to_hex 135F 0F rrc 1360 0F rrc 1361 0F rrc 1362 0F rrc 1363 5F mov e,a 1364 CD2212 call cin 1367 CD4D13 call to_hex 136A 83 add e 136B C9 ret ; read two ASCII bytes echo to screen and convert them to one bye 8-bit data ; exit: A 136C CD2212 get_hex1: call cin 136F CD1612 call cout 1372 CD4D13 call to_hex 1375 0F rrc 1376 0F rrc 1377 0F rrc 1378 0F rrc 1379 5F mov e,a 137A CD2212 call cin 137D CD1612 call cout 1380 CD4D13 call to_hex 1383 83 add e 1384 C9 ret ; read two ASCII bytes echo to screen and convert them to one bye 8-bit data ; exit: A 1385 3A23F0 get_hex2: lda flag1 1388 E6FC ani 0fch ; clear flag1.1 and flag1.0 138A 3223F0 sta flag1

A8085.LST 29/3/2558 15:27

Page 46 of 63

Page 100: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572

138D CD2212 call cin 1390 FE0D cpi cr 1392 CAD813 jz exit_get_hex2 1395 FE20 cpi " " 1397 CAE113 jz exit_get_hex3 139A FE30 cpi 30h ; hex must be 0-9 and A-F 139C DA8513 jc get_hex2 139F FE40 cpi 40h 13A1 DAAE13 jc ascii_0_9 13A4 FE61 cpi 97 ; < 97? 13A6 DA8513 jc get_hex2 13A9 FE67 cpi 103 ; >= 103? 13AB D28513 jnc get_hex2 13AE ascii_0_9: 13AE CD1612 call cout 13B1 CD4D13 call to_hex 13B4 0F rrc 13B5 0F rrc 13B6 0F rrc 13B7 0F rrc 13B8 5F mov e,a 13B9 get_2nd_hex: 13B9 CD2212 call cin 13BC FE30 cpi 30h ; hex must be 0-9 and A-F 13BE DAB913 jc get_2nd_hex 13C1 FE40 cpi 40h 13C3 DAD013 jc ok_0_9 13C6 FE61 cpi 97 ; < 97? 13C8 DAB913 jc get_2nd_hex 13CB FE67 cpi 103 ; >= 103? 13CD D2B913 jnc get_2nd_hex 13D0 ok_0_9: 13D0 CD1612 call cout 13D3 CD4D13 call to_hex 13D6 83 add e 13D7 C9 ret 13D8 exit_get_hex2: 13D8 3A23F0 lda flag1 13DB F601 ori 1 13DD 3223F0 sta flag1 ; Q key has been pressed 13E0 C9 ret 13E1 exit_get_hex3: 13E1 3A23F0 lda flag1 13E4 F602 ori 2 13E6 3223F0 sta flag1 ; SPACE key has been pressed 13E9 C9 ret ; add check sum ; get record, write to SRAM and jump to 8000h ; entry: A= byte received, B= byte check sum add_bcs: macro ; add accumulator with byte check sum stored in B push psw add b

A8085.LST 29/3/2558 15:27

Page 47 of 63

Page 101: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648

mov b,a pop psw endm 001B = esc equ 1bh 13EA CD2212 get_record: call cin 13ED FE1B cpi 27 13EF CA4114 jz esc_quit 13F2 FE3A cpi ":" 13F4 C2EA13 jnz get_record ; wait until begin of record found 13F7 0600 mvi b,0 ; byte check sum 13F9 CD5913 call get_hex ; get number of byte 13FC 4F mov c,a ; put to c 13FD add_bcs 13FD F5 push psw 13FE 80 add b 13FF 47 mov b,a 1400 F1 pop psw 1401 endm 1401 CD5913 call get_hex ; get destination address, put to bx register 1404 67 mov h,a ; save high byte 1405 add_bcs 1405 F5 push psw 1406 80 add b 1407 47 mov b,a 1408 F1 pop psw 1409 endm 1409 CD5913 call get_hex 140C 6F mov l,a ; and low byte 140D add_bcs 140D F5 push psw 140E 80 add b 140F 47 mov b,a 1410 F1 pop psw 1411 endm 1411 CD5913 call get_hex 1414 add_bcs 1414 F5 push psw 1415 80 add b 1416 47 mov b,a 1417 F1 pop psw 1418 endm 1418 FE01 cpi 1 ; end of record type is 01 ? 141A C24214 jnz data_record ; jump if not 01 141D CD2212 wait_cr: call cin 1420 FE0D cpi cr 1422 C21D14 jnz wait_cr ; until end of record sending! with cr detection 1425 3EFF mvi a, 0ffh ; turn speaker off 1427 D312 out system_port_c 1429 AF xra a 142A D300 out 0 ; turn off GPIO 142C CDA014 call print_bcd1 142F CDCC12 call space 1432 3A20F0 lda bcs 1435 CDC401 call pint8u 1438 21801E lxi h,error_text 143B CD3F12 call put_str 143E CDC112 call new_line 1441 C9 esc_quit: ret

A8085.LST 29/3/2558 15:27

Page 48 of 63

Page 102: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724

1442 CD5913 data_record: call get_hex ; get data byte 1445 77 mov m,a ; save to SRAM at [HL] 1446 add_bcs 1446 F5 push psw 1447 80 add b 1448 47 mov b,a 1449 F1 pop psw 144A endm 144A CD7014 call inc_bcd1 ; ori 7fh ; out system_port_c ; make buzzer sound 144D 23 inx h ; next location 144E 0D dcr c 144F C24214 jnz data_record ; until c = 0 1452 78 mov a,b 1453 2F cma 1454 47 mov b,a 1455 04 inr b ; compute two's complement 1456 CD5913 call get_hex ; get check sum 1459 B8 cmp b 145A CA6414 jz skip_error 145D 3A20F0 lda bcs 1460 3C inr a 1461 3220F0 sta bcs 1464 skip_error: 1464 3A39F0 lda temp ; then shift into temp8 1467 07 rlc 1468 3239F0 sta temp 146B D300 out 0 ; send to GPIO 146D C3EA13 jmp get_record ; back to next record ;---------------- increment BCD counter1 ------------------------- 1470 E5 inc_bcd1: push h 1471 2140F0 lxi h,bcd_counter1 1474 AF xra a 1475 7E mov a,m 1476 C601 adi 1 1478 27 daa 1479 77 mov m,a 147A 23 inx h 147B 7E mov a,m 147C CE00 aci 0 147E 27 daa 147F 77 mov m,a 1480 23 inx h 1481 7E mov a,m 1482 CE00 aci 0 1484 27 daa 1485 77 mov m,a 1486 E1 pop h 1487 C9 ret 1488 E5 inc_bcd2: push h 1489 2143F0 lxi h,bcd_counter2 148C AF xra a

A8085.LST 29/3/2558 15:27

Page 49 of 63

Page 103: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800

148D 7E mov a,m 148E C601 adi 1 1490 27 daa 1491 77 mov m,a 1492 23 inx h 1493 7E mov a,m 1494 CE00 aci 0 1496 27 daa 1497 77 mov m,a 1498 23 inx h 1499 7E mov a,m 149A CE00 aci 0 149C 27 daa 149D 77 mov m,a 149E E1 pop h 149F C9 ret 14A0 print_bcd1: 14A0 2142F0 lxi h,bcd_counter1+2 14A3 7E mov a,m 14A4 CDB212 call out2x 14A7 2141F0 lxi h,bcd_counter1+1 14AA 7E mov a,m 14AB CDB212 call out2x 14AE 2140F0 lxi h,bcd_counter1 14B1 7E mov a,m 14B2 CDB212 call out2x 14B5 21CD1E lxi h,byte_text 14B8 CD3F12 call put_str 14BB C9 ret 14BC 210000 clear_bcd1: lxi h,0 14BF 2240F0 shld bcd_counter1 14C2 2241F0 shld bcd_counter1+1 14C5 2242F0 shld bcd_counter1+2 14C8 C9 ret 14C9 print_bcd2: 14C9 2145F0 lxi h,bcd_counter2+2 14CC 7E mov a,m 14CD CDB212 call out2x 14D0 2144F0 lxi h,bcd_counter2+1 14D3 7E mov a,m 14D4 CDB212 call out2x 14D7 2143F0 lxi h,bcd_counter2 14DA 7E mov a,m 14DB CDB212 call out2x 14DE 21CD1E lxi h,byte_text 14E1 CD3F12 call put_str 14E4 C9 ret 14E5 210000 clear_bcd2: lxi h,0 14E8 2243F0 shld bcd_counter2 14EB 2244F0 shld bcd_counter2+1 14EE 2245F0 shld bcd_counter2+2 14F1 C9 ret ; constants 14F2 INS_TABLE: 14F2 F216 DWL C0 ; "NOP",TAB,RS ; 00 14F4 F716 DWL C1 ; "LXI",TAB,"B,",RS ; 01 14F6 FE16 DWL C2 ; "STAX",TAB,"B",RS ; 02 14F8 0517 DWL C3 ; "INX",TAB,"B",RS ; 03 14FA 0B17 DWL C4 ; "INR",TAB,"B",RS ; 04 14FC 1117 DWL C5 ; "DCR",TAB,"B",RS ; 05 14FE 1717 DWL C6 ; "MVI",TAB,"B,",RS ; 06 1500 1E17 DWL C7 ; "RLC",TAB,RS ; 07 1502 2317 DWL C8 ; "DFB",TAB,RS ; 08 1504 2817 DWL C9 ; "DAD",TAB,"B",RS ; 09

A8085.LST 29/3/2558 15:27

Page 50 of 63

Page 104: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876

1506 2E17 DWL CA ; "LDAX",TAB,"B",RS ; 0A 1508 3517 DWL CB ; "DCX",TAB,"B",RS ; 0B 150A 3B17 DWL CC ; "INR",TAB,"C",RS ; 0C 150C 4117 DWL CD ; "DCR",TAB,"C",RS ; 0D 150E 4717 DWL CE ; "MVI",TAB,"C,",RS ; 0E 1510 4E17 DWL CF ; "RRC",TAB,RS ; 0F 1512 5317 DWL C10 ; "DFB",TAB,RS ; 10 1514 5817 DWL C11 ; "LXI",TAB,"D,",RS ; 11 1516 5F17 DWL C12 ; "STAX",TAB,"D",RS ; 12 1518 6617 DWL C13 ; "INX",TAB,"D",RS ; 13 151A 6C17 DWL C14 ; "INR",TAB,"D",RS ; 14 151C 7217 DWL C15 ; "DCR",TAB,"D",RS ; 15 151E 7817 DWL C16 ; "MVI",TAB,"D,",RS ; 16 1520 7F17 DWL C17 ; "RAL",TAB,RS ; 17 1522 8417 DWL C18 ; "DFB",TAB,RS ; 18 1524 8917 DWL C19 ; "DAD",TAB,"D",RS ; 19 1526 8F17 DWL C1A ; "LDAX",TAB,"D",RS ; 1A 1528 9617 DWL C1B ; "DCX",TAB,"D",RS ; 1B 152A 9C17 DWL C1C ; "INR",TAB,"E",RS ; 1C 152C A217 DWL C1D ; "DCR",TAB,"E",RS ; 1D 152E A817 DWL C1E ; "MVI",TAB,"E,",RS ; 1E 1530 AF17 DWL C1F ; "RAR",TAB,RS ; 1F 1532 B417 DWL C20 ; "RIM",TAB,RS ; 20 1534 B917 DWL C21 ; "LXI",TAB,"H,",RS ; 21 1536 C017 DWL C22 ; "SHLD",TAB,RS ; 22 1538 C617 DWL C23 ; "INX",TAB,"H",RS ; 23 153A CC17 DWL C24 ; "INR",TAB,"H",RS ; 24 153C D217 DWL C25 ; "DCR",TAB,"H",RS ; 25 153E D817 DWL C26 ; "MVI",TAB,"H,",RS ; 26 1540 DF17 DWL C27 ; "DAA",TAB,RS ; 27 1542 E417 DWL C28 ; "DFB",TAB,RS ; 28 1544 E917 DWL C29 ; "DAD",TAB,"H",RS ; 29 1546 EF17 DWL C2A ; "LHLD",TAB,RS ; 2A 1548 F517 DWL C2B ; "DCX",TAB,"H",RS ; 2B 154A FB17 DWL C2C ; "INR",TAB,"L",RS ; 2C 154C 0118 DWL C2D ; "DCR",TAB,"L",RS ; 2D 154E 0718 DWL C2E ; "MVI",TAB,"L,",RS ; 2E 1550 0E18 DWL C2F ; "CMA",TAB,RS ; 2F 1552 1318 DWL C30 ; "SIM",TAB,RS ; 30 1554 1818 DWL C31 ; "LXI",TAB,"SP,",RS ; 31 1556 2018 DWL C32 ; "STA",TAB,RS ; 32 1558 2518 DWL C33 ; "INX",TAB,"SP",RS ; 33 155A 2C18 DWL C34 ; "INR",TAB,"M",RS ; 34 155C 3218 DWL C35 ; "DCR",TAB,"M",RS ; 35 155E 3818 DWL C36 ; "MVI",TAB,"M,",RS ; 36 1560 3F18 DWL C37 ; "STC",TAB,RS ; 37 1562 4418 DWL C38 ; "DFB",TAB,RS ; 38 1564 4918 DWL C39 ; "DAD",TAB,"SP",RS ; 39 1566 5018 DWL C3A ; "LDA",TAB,RS ; 3A 1568 5518 DWL C3B ; "DCX",TAB,"SP",RS ; 3B 156A 5C18 DWL C3C ; "INR",TAB,"A",RS ; 3C 156C 6218 DWL C3D ; "DCR",TAB,"A",RS ; 3D 156E 6818 DWL C3E ; "MVI",TAB,"A,",RS ; 3E 1570 6F18 DWL C3F ; "CMC",TAB,RS ; 3F 1572 7418 DWL C40 ; "MOV",TAB,"B,B",RS ; 40 1574 7C18 DWL C41 ; "MOV",TAB,"B,C",RS ; 41 1576 8418 DWL C42 ; "MOV",TAB,"B,D",RS ; 42 1578 8C18 DWL C43 ; "MOV",TAB,"B,E",RS ; 43 157A 9418 DWL C44 ; "MOV",TAB,"B,H",RS ; 44 157C 9C18 DWL C45 ; "MOV",TAB,"B,L",RS ; 45 157E A418 DWL C46 ; "MOV",TAB,"B,M",RS ; 46 1580 AC18 DWL C47 ; "MOV",TAB,"B,A",RS ; 47 1582 B418 DWL C48 ; "MOV",TAB,"C,B",RS ; 48 1584 BC18 DWL C49 ; "MOV",TAB,"C,C",RS ; 49 1586 C418 DWL C4A ; "MOV",TAB,"C,D",RS ; 4A 1588 CC18 DWL C4B ; "MOV",TAB,"C,E",RS ; 4B 158A D418 DWL C4C ; "MOV",TAB,"C,H",RS ; 4C 158C DC18 DWL C4D ; "MOV",TAB,"C,L",RS ; 4D 158E E418 DWL C4E ; "MOV",TAB,"C,M",RS ; 4E 1590 EC18 DWL C4F ; "MOV",TAB,"C,A",RS ; 4F 1592 F418 DWL C50 ; "MOV",TAB,"D,B",RS ; 50 1594 FC18 DWL C51 ; "MOV",TAB,"D,C",RS ; 51 1596 0419 DWL C52 ; "MOV",TAB,"D,D",RS ; 52 1598 0C19 DWL C53 ; "MOV",TAB,"D,E",RS ; 53 159A 1419 DWL C54 ; "MOV",TAB,"D,H",RS ; 54 159C 1C19 DWL C55 ; "MOV",TAB,"D,L",RS ; 55

A8085.LST 29/3/2558 15:27

Page 51 of 63

Page 105: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952

159E 2419 DWL C56 ; "MOV",TAB,"D,M",RS ; 56 15A0 2C19 DWL C57 ; "MOV",TAB,"D,A",RS ; 57 15A2 3419 DWL C58 ; "MOV",TAB,"E,B",RS ; 58 15A4 3C19 DWL C59 ; "MOV",TAB,"E,C",RS ; 59 15A6 4419 DWL C5A ; "MOV",TAB,"E,D",RS ; 5A 15A8 4C19 DWL C5B ; "MOV",TAB,"E,E",RS ; 5B 15AA 5419 DWL C5C ; "MOV",TAB,"E,H",RS ; 5C 15AC 5C19 DWL C5D ; "MOV",TAB,"E,L",RS ; 5D 15AE 6419 DWL C5E ; "MOV",TAB,"E,M",RS ; 5E 15B0 6C19 DWL C5F ; "MOV",TAB,"E,A",RS ; 5F 15B2 7419 DWL C60 ; "MOV",TAB,"H,B",RS ; 60 15B4 7C19 DWL C61 ; "MOV",TAB,"H,C",RS ; 61 15B6 8419 DWL C62 ; "MOV",TAB,"H,D",RS ; 62 15B8 8C19 DWL C63 ; "MOV",TAB,"H,E",RS ; 63 15BA 9419 DWL C64 ; "MOV",TAB,"H,H",RS ; 64 15BC 9C19 DWL C65 ; "MOV",TAB,"H,L",RS ; 65 15BE A419 DWL C66 ; "MOV",TAB,"H,M",RS ; 66 15C0 AC19 DWL C67 ; "MOV",TAB,"H,A",RS ; 67 15C2 B419 DWL C68 ; "MOV",TAB,"L,B",RS ; 68 15C4 BC19 DWL C69 ; "MOV",TAB,"L,C",RS ; 69 15C6 C419 DWL C6A ; "MOV",TAB,"L,D",RS ; 6A 15C8 CC19 DWL C6B ; "MOV",TAB,"L,E",RS ; 6B 15CA D419 DWL C6C ; "MOV",TAB,"L,H",RS ; 6C 15CC DC19 DWL C6D ; "MOV",TAB,"L,L",RS ; 6D 15CE E419 DWL C6E ; "MOV",TAB,"L,M",RS ; 6E 15D0 EC19 DWL C6F ; "MOV",TAB,"L,A",RS ; 6F 15D2 F419 DWL C70 ; "MOV",TAB,"M,B",RS ; 70 15D4 FC19 DWL C71 ; "MOV",TAB,"M,C",RS ; 71 15D6 041A DWL C72 ; "MOV",TAB,"M,D",RS ; 72 15D8 0C1A DWL C73 ; "MOV",TAB,"M,E",RS ; 73 15DA 141A DWL C74 ; "MOV",TAB,"M,H",RS ; 74 15DC 1C1A DWL C75 ; "MOV",TAB,"M,L",RS ; 75 15DE 241A DWL C76 ; "HLT",TAB,RS ; 76 15E0 291A DWL C77 ; "MOV",TAB,"M,A",RS ; 77 15E2 311A DWL C78 ; "MOV",TAB,"A,B",RS ; 78 15E4 391A DWL C79 ; "MOV",TAB,"A,C",RS ; 79 15E6 411A DWL C7A ; "MOV",TAB,"A,D",RS ; 7A 15E8 491A DWL C7B ; "MOV",TAB,"A,E",RS ; 7B 15EA 511A DWL C7C ; "MOV",TAB,"A,H",RS ; 7C 15EC 591A DWL C7D ; "MOV",TAB,"A,L",RS ; 7D 15EE 611A DWL C7E ; "MOV",TAB,"A,M",RS ; 7E 15F0 691A DWL C7F ; "MOV",TAB,"A,A",RS ; 7F 15F2 711A DWL C80 ; "ADD",TAB,"B",RS ; 80 15F4 771A DWL C81 ; "ADD",TAB,"C",RS ; 81 15F6 7D1A DWL C82 ; "ADD",TAB,"D",RS ; 82 15F8 831A DWL C83 ; "ADD",TAB,"E",RS ; 83 15FA 891A DWL C84 ; "ADD",TAB,"H",RS ; 84 15FC 8F1A DWL C85 ; "ADD",TAB,"L",RS ; 85 15FE 951A DWL C86 ; "ADD",TAB,"M",RS ; 86 1600 9B1A DWL C87 ; "ADD",TAB,"A",RS ; 87 1602 A11A DWL C88 ; "ADC",TAB,"B",RS ; 88 1604 A71A DWL C89 ; "ADC",TAB,"C",RS ; 89 1606 AD1A DWL C8A ; "ADC",TAB,"D",RS ; 8A 1608 B31A DWL C8B ; "ADC",TAB,"E",RS ; 8B 160A B91A DWL C8C ; "ADC",TAB,"H",RS ; 8C 160C BF1A DWL C8D ; "ADC",TAB,"L",RS ; 8D 160E C51A DWL C8E ; "ADC",TAB,"M",RS ; 8E 1610 CB1A DWL C8F ; "ADC",TAB,"A",RS ; 8F 1612 D11A DWL C90 ; "SUB",TAB,"B",RS ; 90 1614 D71A DWL C91 ; "SUB",TAB,"C",RS ; 91 1616 DD1A DWL C92 ; "SUB",TAB,"D",RS ; 92 1618 E31A DWL C93 ; "SUB",TAB,"E",RS ; 93 161A E91A DWL C94 ; "SUB",TAB,"H",RS ; 94 161C EF1A DWL C95 ; "SUB",TAB,"L",RS ; 95 161E F51A DWL C96 ; "SUB",TAB,"M",RS ; 96 1620 FB1A DWL C97 ; "SUB",TAB,"A",RS ; 97 1622 011B DWL C98 ; "SBB",TAB,"B",RS ; 98 1624 071B DWL C99 ; "SBB",TAB,"C",RS ; 99 1626 0D1B DWL C9A ; "SBB",TAB,"D",RS ; 9A 1628 131B DWL C9B ; "SBB",TAB,"E",RS ; 9B 162A 191B DWL C9C ; "SBB",TAB,"H",RS ; 9C 162C 1F1B DWL C9D ; "SBB",TAB,"L",RS ; 9D 162E 251B DWL C9E ; "SBB",TAB,"M",RS ; 9E 1630 2B1B DWL C9F ; "SBB",TAB,"A",RS ; 9F 1632 311B DWL CA0 ; "ANA",TAB,"B",RS ; A0 1634 371B DWL CA1 ; "ANA",TAB,"C",RS ; A1

A8085.LST 29/3/2558 15:27

Page 52 of 63

Page 106: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

3953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028

1636 3D1B DWL CA2 ; "ANA",TAB,"D",RS ; A2 1638 431B DWL CA3 ; "ANA",TAB,"E",RS ; A3 163A 491B DWL CA4 ; "ANA",TAB,"H",RS ; A4 163C 4F1B DWL CA5 ; "ANA",TAB,"L",RS ; A5 163E 551B DWL CA6 ; "ANA",TAB,"M",RS ; A6 1640 5B1B DWL CA7 ; "ANA",TAB,"A",RS ; A7 1642 611B DWL CA8 ; "XRA",TAB,"B",RS ; A8 1644 671B DWL CA9 ; "XRA",TAB,"C",RS ; A9 1646 6D1B DWL CAA ; "XRA",TAB,"D",RS ; AA 1648 731B DWL CAB ; "XRA",TAB,"E",RS ; AB 164A 791B DWL CAC ; "XRA",TAB,"H",RS ; AC 164C 7F1B DWL CAD ; "XRA",TAB,"L",RS ; AD 164E 851B DWL CAE ; "XRA",TAB,"M",RS ; AE 1650 8B1B DWL CAF ; "XRA",TAB,"A",RS ; AF 1652 911B DWL CB0 ; "ORA",TAB,"B",RS ; B0 1654 971B DWL CB1 ; "ORA",TAB,"C",RS ; B1 1656 9D1B DWL CB2 ; "ORA",TAB,"D",RS ; B2 1658 A31B DWL CB3 ; "ORA",TAB,"E",RS ; B3 165A A91B DWL CB4 ; "ORA",TAB,"H",RS ; B4 165C AF1B DWL CB5 ; "ORA",TAB,"L",RS ; B5 165E B51B DWL CB6 ; "ORA",TAB,"M",RS ; B6 1660 BB1B DWL CB7 ; "ORA",TAB,"A",RS ; B7 1662 C11B DWL CB8 ; "CMP",TAB,"B",RS ; B8 1664 C71B DWL CB9 ; "CMP",TAB,"C",RS ; B9 1666 CD1B DWL CBA ; "CMP",TAB,"D",RS ; BA 1668 D31B DWL CBB ; "CMP",TAB,"E",RS ; BB 166A D91B DWL CBC ; "CMP",TAB,"H",RS ; BC 166C DF1B DWL CBD ; "CMP",TAB,"L",RS ; BD 166E E51B DWL CBE ; "CMP",TAB,"M",RS ; BE 1670 EB1B DWL CBF ; "CMP",TAB,"A",RS ; BF 1672 F11B DWL CC0 ; "RNZ",TAB,RS ; C0 1674 F61B DWL CC1 ; "POP",TAB,"B",RS ; C1 1676 FC1B DWL CC2 ; "JNZ",TAB,RS ; C2 1678 011C DWL CC3 ; "JMP",TAB,RS ; C3 167A 061C DWL CC4 ; "CNZ",TAB,RS ; C4 167C 0B1C DWL CC5 ; "PUSH",TAB,"B",RS ; C5 167E 121C DWL CC6 ; "ADI",TAB,RS ; C6 1680 171C DWL CC7 ; "RST",TAB,"0",RS ; C7 1682 1D1C DWL CC8 ; "RZ",TAB,RS ; C8 1684 211C DWL CC9 ; "RET",TAB,RS ; C9 1686 261C DWL CCA ; "JZ",TAB,RS ; CA 1688 2A1C DWL CCB ; "DFB",TAB,RS ; CB 168A 2F1C DWL CCC ; "CZ",TAB,RS ; CC 168C 331C DWL CCD ; "CALL",TAB,RS ; CD 168E 391C DWL CCE ; "ACI",TAB,RS ; CE 1690 3E1C DWL CCF ; "RST",TAB,"1",RS ; CF 1692 441C DWL CD0 ; "RNC",TAB,RS ; D0 1694 491C DWL CD1 ; "POP",TAB,"D",RS ; D1 1696 4F1C DWL CD2 ; "JNC",TAB,RS ; D2 1698 541C DWL CD3 ; "OUT",TAB,RS ; D3 169A 591C DWL CD4 ; "CNC",TAB,RS ; D4 169C 5E1C DWL CD5 ; "PUSH",TAB,"D",RS ; D5 169E 651C DWL CD6 ; "SUI",TAB,RS ; D6 16A0 6A1C DWL CD7 ; "RST",TAB,"2",RS ; D7 16A2 701C DWL CD8 ; "RC",TAB,RS ; D8 16A4 741C DWL CD9 ; "DFB",TAB,RS ; D9 16A6 791C DWL CDA ; "JC",TAB,RS ; DA 16A8 7D1C DWL CDB ; "IN",TAB,RS ; DFB 16AA 811C DWL CDC ; "CC",TAB,RS ; DC 16AC 851C DWL CDD ; "DFB",TAB,RS ; DD 16AE 8A1C DWL CDE ; "SBI",TAB,RS ; DE 16B0 8F1C DWL CDF ; "RST",TAB,"3",RS ; DF 16B2 951C DWL CE0 ; "RPO",TAB,RS ; E0 16B4 9A1C DWL CE1 ; "POP",TAB,"H",RS ; E1 16B6 A01C DWL CE2 ; "JPO",TAB,RS ; E2 16B8 A51C DWL CE3 ; "XTHL",TAB,RS ; E3 16BA AB1C DWL CE4 ; "CPO",TAB,RS ; E4 16BC B01C DWL CE5 ; "PUSH",TAB,"H",RS ; E5 16BE B71C DWL CE6 ; "ANI",TAB,RS ; E6 16C0 BC1C DWL CE7 ; "RST",TAB,"4",RS ; E7 16C2 C21C DWL CE8 ; "RPE",TAB,RS ; E8 16C4 C71C DWL CE9 ; "PCHL",TAB,RS ; E9 16C6 CD1C DWL CEA ; "JPE",TAB,RS ; EA 16C8 D21C DWL CEB ; "XCHG",TAB,RS ; EB 16CA D81C DWL CEC ; "CPE",TAB,RS ; EC 16CC DD1C DWL CED ; "DFB",TAB,RS ; ED

A8085.LST 29/3/2558 15:27

Page 53 of 63

Page 107: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104

16CE E21C DWL CEE ; "XRI",TAB,RS ; EE 16D0 E71C DWL CEF ; "RST",TAB,"5",RS ; EF 16D2 ED1C DWL CF0 ; "RP",TAB,RS ; F0 16D4 F11C DWL CF1 ; "POP",TAB,"PSW",RS ; F1 16D6 F91C DWL CF2 ; "JP",TAB,RS ; F2 16D8 FD1C DWL CF3 ; "DI",TAB,RS ; F3 16DA 011D DWL CF4 ; "CP",TAB,RS ; F4 16DC 051D DWL CF5 ; "PUSH",TAB,"PSW",RS ; F5 16DE 0E1D DWL CF6 ; "ORI",TAB,RS ; F6 16E0 131D DWL CF7 ; "RST",TAB,"6",RS ; F7 16E2 191D DWL CF8 ; "RM",TAB,RS ; F8 16E4 1D1D DWL CF9 ; "SPHL",TAB,RS ; F9 16E6 231D DWL CFA ; "JM",TAB,RS ; FA 16E8 271D DWL CFB ; "EI",TAB,RS ; FB 16EA 2B1D DWL CFC ; "CM",TAB,RS ; FC 16EC 2F1D DWL CFD ; "DFB",TAB,RS ; FD 16EE 341D DWL CFE ; "CPI",TAB,RS ; FE 16F0 391D DWL CFF ; "RST",TAB,"7",RS, ; FF ; --------- mnemonic table --------------------------------------- 16F2 MNEM 16F2 4E4F500900C0 DFB "NOP",TAB,RS ; 00 16F7 4C58490942C1 DFB "LXI",TAB,"B,",RS ; 01 16FE 5354415809C2 DFB "STAX",TAB,"B",RS ; 02 1705 494E580942C3 DFB "INX",TAB,"B",RS ; 03 170B 494E520942C4 DFB "INR",TAB,"B",RS ; 04 1711 4443520942C5 DFB "DCR",TAB,"B",RS ; 05 1717 4D56490942C6 DFB "MVI",TAB,"B,",RS ; 06 171E 524C430900C7 DFB "RLC",TAB,RS ; 07 1723 4446420900C8 DFB "DFB",TAB,RS ; 08 1728 4441440942C9 DFB "DAD",TAB,"B",RS ; 09 172E 4C44415809CA DFB "LDAX",TAB,"B",RS ; 0A 1735 4443580942CB DFB "DCX",TAB,"B",RS ; 0B 173B 494E520943CC DFB "INR",TAB,"C",RS ; 0C 1741 4443520943CD DFB "DCR",TAB,"C",RS ; 0D 1747 4D56490943CE DFB "MVI",TAB,"C,",RS ; 0E 174E 5252430900CF DFB "RRC",TAB,RS ; 0F 1753 4446420900C10 DFB "DFB",TAB,RS ; 10 1758 4C58490944C11 DFB "LXI",TAB,"D,",RS ; 11 175F 5354415809C12 DFB "STAX",TAB,"D",RS ; 12 1766 494E580944C13 DFB "INX",TAB,"D",RS ; 13 176C 494E520944C14 DFB "INR",TAB,"D",RS ; 14 1772 4443520944C15 DFB "DCR",TAB,"D",RS ; 15 1778 4D56490944C16 DFB "MVI",TAB,"D,",RS ; 16 177F 52414C0900C17 DFB "RAL",TAB,RS ; 17 1784 4446420900C18 DFB "DFB",TAB,RS ; 18 1789 4441440944C19 DFB "DAD",TAB,"D",RS ; 19 178F 4C44415809C1A DFB "LDAX",TAB,"D",RS ; 1A 1796 4443580944C1B DFB "DCX",TAB,"D",RS ; 1B 179C 494E520945C1C DFB "INR",TAB,"E",RS ; 1C 17A2 4443520945C1D DFB "DCR",TAB,"E",RS ; 1D 17A8 4D56490945C1E DFB "MVI",TAB,"E,",RS ; 1E 17AF 5241520900C1F DFB "RAR",TAB,RS ; 1F 17B4 52494D0900C20 DFB "RIM",TAB,RS ; 20 17B9 4C58490948C21 DFB "LXI",TAB,"H,",RS ; 21 17C0 53484C4409C22 DFB "SHLD",TAB,RS ; 22 17C6 494E580948C23 DFB "INX",TAB,"H",RS ; 23 17CC 494E520948C24 DFB "INR",TAB,"H",RS ; 24 17D2 4443520948C25 DFB "DCR",TAB,"H",RS ; 25 17D8 4D56490948C26 DFB "MVI",TAB,"H,",RS ; 26 17DF 4441410900C27 DFB "DAA",TAB,RS ; 27 17E4 4446420900C28 DFB "DFB",TAB,RS ; 28 17E9 4441440948C29 DFB "DAD",TAB,"H",RS ; 29 17EF 4C484C4409C2A DFB "LHLD",TAB,RS ; 2A 17F5 4443580948C2B DFB "DCX",TAB,"H",RS ; 2B 17FB 494E52094CC2C DFB "INR",TAB,"L",RS ; 2C 1801 444352094CC2D DFB "DCR",TAB,"L",RS ; 2D 1807 4D5649094CC2E DFB "MVI",TAB,"L,",RS ; 2E 180E 434D410900C2F DFB "CMA",TAB,RS ; 2F 1813 53494D0900C30 DFB "SIM",TAB,RS ; 30 1818 4C58490953C31 DFB "LXI",TAB,"SP,",RS ; 31 1820 5354410900C32 DFB "STA",TAB,RS ; 32 1825 494E580953C33 DFB "INX",TAB,"SP",RS ; 33 182C 494E52094DC34 DFB "INR",TAB,"M",RS ; 34

A8085.LST 29/3/2558 15:27

Page 54 of 63

Page 108: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180

1832 444352094DC35 DFB "DCR",TAB,"M",RS ; 35 1838 4D5649094DC36 DFB "MVI",TAB,"M,",RS ; 36 183F 5354430900C37 DFB "STC",TAB,RS ; 37 1844 4446420900C38 DFB "DFB",TAB,RS ; 38 1849 4441440953C39 DFB "DAD",TAB,"SP",RS ; 39 1850 4C44410900C3A DFB "LDA",TAB,RS ; 3A 1855 4443580953C3B DFB "DCX",TAB,"SP",RS ; 3B 185C 494E520941C3C DFB "INR",TAB,"A",RS ; 3C 1862 4443520941C3D DFB "DCR",TAB,"A",RS ; 3D 1868 4D56490941C3E DFB "MVI",TAB,"A,",RS ; 3E 186F 434D430900C3F DFB "CMC",TAB,RS ; 3F 1874 4D4F560942C40 DFB "MOV",TAB,"B,B",RS ; 40 187C 4D4F560942C41 DFB "MOV",TAB,"B,C",RS ; 41 1884 4D4F560942C42 DFB "MOV",TAB,"B,D",RS ; 42 188C 4D4F560942C43 DFB "MOV",TAB,"B,E",RS ; 43 1894 4D4F560942C44 DFB "MOV",TAB,"B,H",RS ; 44 189C 4D4F560942C45 DFB "MOV",TAB,"B,L",RS ; 45 18A4 4D4F560942C46 DFB "MOV",TAB,"B,M",RS ; 46 18AC 4D4F560942C47 DFB "MOV",TAB,"B,A",RS ; 47 18B4 4D4F560943C48 DFB "MOV",TAB,"C,B",RS ; 48 18BC 4D4F560943C49 DFB "MOV",TAB,"C,C",RS ; 49 18C4 4D4F560943C4A DFB "MOV",TAB,"C,D",RS ; 4A 18CC 4D4F560943C4B DFB "MOV",TAB,"C,E",RS ; 4B 18D4 4D4F560943C4C DFB "MOV",TAB,"C,H",RS ; 4C 18DC 4D4F560943C4D DFB "MOV",TAB,"C,L",RS ; 4D 18E4 4D4F560943C4E DFB "MOV",TAB,"C,M",RS ; 4E 18EC 4D4F560943C4F DFB "MOV",TAB,"C,A",RS ; 4F 18F4 4D4F560944C50 DFB "MOV",TAB,"D,B",RS ; 50 18FC 4D4F560944C51 DFB "MOV",TAB,"D,C",RS ; 51 1904 4D4F560944C52 DFB "MOV",TAB,"D,D",RS ; 52 190C 4D4F560944C53 DFB "MOV",TAB,"D,E",RS ; 53 1914 4D4F560944C54 DFB "MOV",TAB,"D,H",RS ; 54 191C 4D4F560944C55 DFB "MOV",TAB,"D,L",RS ; 55 1924 4D4F560944C56 DFB "MOV",TAB,"D,M",RS ; 56 192C 4D4F560944C57 DFB "MOV",TAB,"D,A",RS ; 57 1934 4D4F560945C58 DFB "MOV",TAB,"E,B",RS ; 58 193C 4D4F560945C59 DFB "MOV",TAB,"E,C",RS ; 59 1944 4D4F560945C5A DFB "MOV",TAB,"E,D",RS ; 5A 194C 4D4F560945C5B DFB "MOV",TAB,"E,E",RS ; 5B 1954 4D4F560945C5C DFB "MOV",TAB,"E,H",RS ; 5C 195C 4D4F560945C5D DFB "MOV",TAB,"E,L",RS ; 5D 1964 4D4F560945C5E DFB "MOV",TAB,"E,M",RS ; 5E 196C 4D4F560945C5F DFB "MOV",TAB,"E,A",RS ; 5F 1974 4D4F560948C60 DFB "MOV",TAB,"H,B",RS ; 60 197C 4D4F560948C61 DFB "MOV",TAB,"H,C",RS ; 61 1984 4D4F560948C62 DFB "MOV",TAB,"H,D",RS ; 62 198C 4D4F560948C63 DFB "MOV",TAB,"H,E",RS ; 63 1994 4D4F560948C64 DFB "MOV",TAB,"H,H",RS ; 64 199C 4D4F560948C65 DFB "MOV",TAB,"H,L",RS ; 65 19A4 4D4F560948C66 DFB "MOV",TAB,"H,M",RS ; 66 19AC 4D4F560948C67 DFB "MOV",TAB,"H,A",RS ; 67 19B4 4D4F56094CC68 DFB "MOV",TAB,"L,B",RS ; 68 19BC 4D4F56094CC69 DFB "MOV",TAB,"L,C",RS ; 69 19C4 4D4F56094CC6A DFB "MOV",TAB,"L,D",RS ; 6A 19CC 4D4F56094CC6B DFB "MOV",TAB,"L,E",RS ; 6B 19D4 4D4F56094CC6C DFB "MOV",TAB,"L,H",RS ; 6C 19DC 4D4F56094CC6D DFB "MOV",TAB,"L,L",RS ; 6D 19E4 4D4F56094CC6E DFB "MOV",TAB,"L,M",RS ; 6E 19EC 4D4F56094CC6F DFB "MOV",TAB,"L,A",RS ; 6F 19F4 4D4F56094DC70 DFB "MOV",TAB,"M,B",RS ; 70 19FC 4D4F56094DC71 DFB "MOV",TAB,"M,C",RS ; 71 1A04 4D4F56094DC72 DFB "MOV",TAB,"M,D",RS ; 72 1A0C 4D4F56094DC73 DFB "MOV",TAB,"M,E",RS ; 73 1A14 4D4F56094DC74 DFB "MOV",TAB,"M,H",RS ; 74 1A1C 4D4F56094DC75 DFB "MOV",TAB,"M,L",RS ; 75 1A24 484C540900C76 DFB "HLT",TAB,RS ; 76 1A29 4D4F56094DC77 DFB "MOV",TAB,"M,A",RS ; 77 1A31 4D4F560941C78 DFB "MOV",TAB,"A,B",RS ; 78 1A39 4D4F560941C79 DFB "MOV",TAB,"A,C",RS ; 79 1A41 4D4F560941C7A DFB "MOV",TAB,"A,D",RS ; 7A 1A49 4D4F560941C7B DFB "MOV",TAB,"A,E",RS ; 7B 1A51 4D4F560941C7C DFB "MOV",TAB,"A,H",RS ; 7C 1A59 4D4F560941C7D DFB "MOV",TAB,"A,L",RS ; 7D 1A61 4D4F560941C7E DFB "MOV",TAB,"A,M",RS ; 7E 1A69 4D4F560941C7F DFB "MOV",TAB,"A,A",RS ; 7F 1A71 4144440942C80 DFB "ADD",TAB,"B",RS ; 80

A8085.LST 29/3/2558 15:27

Page 55 of 63

Page 109: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256

1A77 4144440943C81 DFB "ADD",TAB,"C",RS ; 81 1A7D 4144440944C82 DFB "ADD",TAB,"D",RS ; 82 1A83 4144440945C83 DFB "ADD",TAB,"E",RS ; 83 1A89 4144440948C84 DFB "ADD",TAB,"H",RS ; 84 1A8F 414444094CC85 DFB "ADD",TAB,"L",RS ; 85 1A95 414444094DC86 DFB "ADD",TAB,"M",RS ; 86 1A9B 4144440941C87 DFB "ADD",TAB,"A",RS ; 87 1AA1 4144430942C88 DFB "ADC",TAB,"B",RS ; 88 1AA7 4144430943C89 DFB "ADC",TAB,"C",RS ; 89 1AAD 4144430944C8A DFB "ADC",TAB,"D",RS ; 8A 1AB3 4144430945C8B DFB "ADC",TAB,"E",RS ; 8B 1AB9 4144430948C8C DFB "ADC",TAB,"H",RS ; 8C 1ABF 414443094CC8D DFB "ADC",TAB,"L",RS ; 8D 1AC5 414443094DC8E DFB "ADC",TAB,"M",RS ; 8E 1ACB 4144430941C8F DFB "ADC",TAB,"A",RS ; 8F 1AD1 5355420942C90 DFB "SUB",TAB,"B",RS ; 90 1AD7 5355420943C91 DFB "SUB",TAB,"C",RS ; 91 1ADD 5355420944C92 DFB "SUB",TAB,"D",RS ; 92 1AE3 5355420945C93 DFB "SUB",TAB,"E",RS ; 93 1AE9 5355420948C94 DFB "SUB",TAB,"H",RS ; 94 1AEF 535542094CC95 DFB "SUB",TAB,"L",RS ; 95 1AF5 535542094DC96 DFB "SUB",TAB,"M",RS ; 96 1AFB 5355420941C97 DFB "SUB",TAB,"A",RS ; 97 1B01 5342420942C98 DFB "SBB",TAB,"B",RS ; 98 1B07 5342420943C99 DFB "SBB",TAB,"C",RS ; 99 1B0D 5342420944C9A DFB "SBB",TAB,"D",RS ; 9A 1B13 5342420945C9B DFB "SBB",TAB,"E",RS ; 9B 1B19 5342420948C9C DFB "SBB",TAB,"H",RS ; 9C 1B1F 534242094CC9D DFB "SBB",TAB,"L",RS ; 9D 1B25 534242094DC9E DFB "SBB",TAB,"M",RS ; 9E 1B2B 5342420941C9F DFB "SBB",TAB,"A",RS ; 9F 1B31 414E410942CA0 DFB "ANA",TAB,"B",RS ; A0 1B37 414E410943CA1 DFB "ANA",TAB,"C",RS ; A1 1B3D 414E410944CA2 DFB "ANA",TAB,"D",RS ; A2 1B43 414E410945CA3 DFB "ANA",TAB,"E",RS ; A3 1B49 414E410948CA4 DFB "ANA",TAB,"H",RS ; A4 1B4F 414E41094CCA5 DFB "ANA",TAB,"L",RS ; A5 1B55 414E41094DCA6 DFB "ANA",TAB,"M",RS ; A6 1B5B 414E410941CA7 DFB "ANA",TAB,"A",RS ; A7 1B61 5852410942CA8 DFB "XRA",TAB,"B",RS ; A8 1B67 5852410943CA9 DFB "XRA",TAB,"C",RS ; A9 1B6D 5852410944CAA DFB "XRA",TAB,"D",RS ; AA 1B73 5852410945CAB DFB "XRA",TAB,"E",RS ; AB 1B79 5852410948CAC DFB "XRA",TAB,"H",RS ; AC 1B7F 585241094CCAD DFB "XRA",TAB,"L",RS ; AD 1B85 585241094DCAE DFB "XRA",TAB,"M",RS ; AE 1B8B 5852410941CAF DFB "XRA",TAB,"A",RS ; AF 1B91 4F52410942CB0 DFB "ORA",TAB,"B",RS ; B0 1B97 4F52410943CB1 DFB "ORA",TAB,"C",RS ; B1 1B9D 4F52410944CB2 DFB "ORA",TAB,"D",RS ; B2 1BA3 4F52410945CB3 DFB "ORA",TAB,"E",RS ; B3 1BA9 4F52410948CB4 DFB "ORA",TAB,"H",RS ; B4 1BAF 4F5241094CCB5 DFB "ORA",TAB,"L",RS ; B5 1BB5 4F5241094DCB6 DFB "ORA",TAB,"M",RS ; B6 1BBB 4F52410941CB7 DFB "ORA",TAB,"A",RS ; B7 1BC1 434D500942CB8 DFB "CMP",TAB,"B",RS ; B8 1BC7 434D500943CB9 DFB "CMP",TAB,"C",RS ; B9 1BCD 434D500944CBA DFB "CMP",TAB,"D",RS ; BA 1BD3 434D500945CBB DFB "CMP",TAB,"E",RS ; BB 1BD9 434D500948CBC DFB "CMP",TAB,"H",RS ; BC 1BDF 434D50094CCBD DFB "CMP",TAB,"L",RS ; BD 1BE5 434D50094DCBE DFB "CMP",TAB,"M",RS ; BE 1BEB 434D500941CBF DFB "CMP",TAB,"A",RS ; BF 1BF1 524E5A0900CC0 DFB "RNZ",TAB,RS ; C0 1BF6 504F500942CC1 DFB "POP",TAB,"B",RS ; C1 1BFC 4A4E5A0900CC2 DFB "JNZ",TAB,RS ; C2 1C01 4A4D500900CC3 DFB "JMP",TAB,RS ; C3 1C06 434E5A0900CC4 DFB "CNZ",TAB,RS ; C4 1C0B 5055534809CC5 DFB "PUSH",TAB,"B",RS ; C5 1C12 4144490900CC6 DFB "ADI",TAB,RS ; C6 1C17 5253540930CC7 DFB "RST",TAB,"0",RS ; C7 1C1D 525A0900 CC8 DFB "RZ",TAB,RS ; C8 1C21 5245540900CC9 DFB "RET",TAB,RS ; C9 1C26 4A5A0900 CCA DFB "JZ",TAB,RS ; CA 1C2A 4446420900CCB DFB "DFB",TAB,RS ; CB 1C2F 435A0900 CCC DFB "CZ",TAB,RS ; CC

A8085.LST 29/3/2558 15:27

Page 56 of 63

Page 110: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332

1C33 43414C4C09CCD DFB "CALL",TAB,RS ; CD 1C39 4143490900CCE DFB "ACI",TAB,RS ; CE 1C3E 5253540931CCF DFB "RST",TAB,"1",RS ; CF 1C44 524E430900CD0 DFB "RNC",TAB,RS ; D0 1C49 504F500944CD1 DFB "POP",TAB,"D",RS ; D1 1C4F 4A4E430900CD2 DFB "JNC",TAB,RS ; D2 1C54 4F55540900CD3 DFB "OUT",TAB,RS ; D3 1C59 434E430900CD4 DFB "CNC",TAB,RS ; D4 1C5E 5055534809CD5 DFB "PUSH",TAB,"D",RS ; D5 1C65 5355490900CD6 DFB "SUI",TAB,RS ; D6 1C6A 5253540932CD7 DFB "RST",TAB,"2",RS ; D7 1C70 52430900 CD8 DFB "RC",TAB,RS ; D8 1C74 4446420900CD9 DFB "DFB",TAB,RS ; D9 1C79 4A430900 CDA DFB "JC",TAB,RS ; DA 1C7D 494E0900 CDB DFB "IN",TAB,RS ; DFB 1C81 43430900 CDC DFB "CC",TAB,RS ; DC 1C85 4446420900CDD DFB "DFB",TAB,RS ; DD 1C8A 5342490900CDE DFB "SBI",TAB,RS ; DE 1C8F 5253540933CDF DFB "RST",TAB,"3",RS ; DF 1C95 52504F0900CE0 DFB "RPO",TAB,RS ; E0 1C9A 504F500948CE1 DFB "POP",TAB,"H",RS ; E1 1CA0 4A504F0900CE2 DFB "JPO",TAB,RS ; E2 1CA5 5854484C09CE3 DFB "XTHL",TAB,RS ; E3 1CAB 43504F0900CE4 DFB "CPO",TAB,RS ; E4 1CB0 5055534809CE5 DFB "PUSH",TAB,"H",RS ; E5 1CB7 414E490900CE6 DFB "ANI",TAB,RS ; E6 1CBC 5253540934CE7 DFB "RST",TAB,"4",RS ; E7 1CC2 5250450900CE8 DFB "RPE",TAB,RS ; E8 1CC7 5043484C09CE9 DFB "PCHL",TAB,RS ; E9 1CCD 4A50450900CEA DFB "JPE",TAB,RS ; EA 1CD2 5843484709CEB DFB "XCHG",TAB,RS ; EB 1CD8 4350450900CEC DFB "CPE",TAB,RS ; EC 1CDD 4446420900CED DFB "DFB",TAB,RS ; ED 1CE2 5852490900CEE DFB "XRI",TAB,RS ; EE 1CE7 5253540935CEF DFB "RST",TAB,"5",RS ; EF 1CED 52500900 CF0 DFB "RP",TAB,RS ; F0 1CF1 504F500950CF1 DFB "POP",TAB,"PSW",RS ; F1 1CF9 4A500900 CF2 DFB "JP",TAB,RS ; F2 1CFD 44490900 CF3 DFB "DI",TAB,RS ; F3 1D01 43500900 CF4 DFB "CP",TAB,RS ; F4 1D05 5055534809CF5 DFB "PUSH",TAB,"PSW",RS ; F5 1D0E 4F52490900CF6 DFB "ORI",TAB,RS ; F6 1D13 5253540936CF7 DFB "RST",TAB,"6",RS ; F7 1D19 524D0900 CF8 DFB "RM",TAB,RS ; F8 1D1D 5350484C09CF9 DFB "SPHL",TAB,RS ; F9 1D23 4A4D0900 CFA DFB "JM",TAB,RS ; FA 1D27 45490900 CFB DFB "EI",TAB,RS ; FB 1D2B 434D0900 CFC DFB "CM",TAB,RS ; FC 1D2F 4446420900CFD DFB "DFB",TAB,RS ; FD 1D34 4350490900CFE DFB "CPI",TAB,RS ; FE 1D39 5253540937CFF DFB "RST",TAB,"7",RS, ; FF 1D3F 0D0A0A4D54prompt1: dfb cr,lf,lf,"MTK-85 8085 MICROPROCESSOR TRAINING KIT (? HELP)",CR,LF,0 1D75 3F065B4F66convert dfb 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h 1D85 0000000000off_display: dfb 0,0,0,0,0,0 ; lcd message |--- 20 letters ---| 1D8B 4D544B2D38prompt2: dfb "MTK-85 8085 MICROPRO",0 1DA0 434553534Ftext3: dfb "CESSOR TRAINING KIT",0 1DB4 6C6F616420download_text: dfb "load Intel hex file...",0 1DCB 3E00 prompt_text: dfb ">",0 1DCD 6E6577206Cnew_text: dfb "new location = ",0 1DDD 6564697420edit_text: dfb "edit memory location = ",0 1DF5 0D0A456E74edit_text1: dfb cr,lf,"Enter to quit, SPACE key to view content",0 1E20 0D0A0A4144edit_text2: dfb cr,lf,lf,"ADDR DATA",0 1E2E 6A756D7020jump_text1: dfb "jump to address [",0 1E40 5D203D2000jump_text2: dfb "] = ",0 1E45 7072696E74ascii_text: dfb "print ASCII code",0

A8085.LST 29/3/2558 15:27

Page 57 of 63

Page 111: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408

1E56 426567696Efill_text1: dfb "Begin address = ",0 1E67 20456E6420fill_text2: dfb " End address = ",0 1E77 2044617461fill_text3: dfb " Data = ",0 1E80 206572726Ferror_text: dfb " errors",0 1E88 6469736173disassemble_text: dfb "disassemble...",0 0000 = eos equ 0 1E97 41463D00 af_text: dfb "AF=",eos 1E9B 42433D00 bc_text: dfb "BC=",eos 1E9F 44453D00 de_text: dfb "DE=",eos 1EA3 484C3D00 hl_text: dfb "HL=",eos 1EA7 53503D00 sp_text: dfb "SP=",eos 1EAB 544F533D00tos_text: dfb "TOS=",eos 1EB0 50433D00 pc_text: dfb "PC=",eos 1EB4 5B53205A20flag_text: dfb "[S Z - AC - P - CY]=",eos 1ECA 533D00 sign_text: dfb "S=",0 1ECD 2062797465byte_text: dfb " bytes loaded",0 1EDB 535441434Bstack_text: dfb "STACK Memory Contents..",0 1EF3 7365742076set_register_text: dfb "set value to user register (enter A for AF) ? ",0 1F22 0D0A0A4D54help_text: dfb cr,lf,lf,"MTK-85 8085 MICROPROCESSOR TRAINING KIT (? HELP)" 1F55 0D0A41202Dhelp_text1: dfb cr,lf, "A - ASCII code" 1F65 0D0A43202D dfb cr,lf, "C - clear watch variables" 1F80 0D0A44202D dfb cr,lf, "D - disassemble" 1F91 0D0A45202D dfb cr,lf, "E - edit memory" 1FA2 0D0A46202D dfb cr,lf, "F - fill constant" 1FB5 0D0A48202D dfb cr,lf, "H - hex dump" 1FC3 0D0A49202D dfb cr,lf, "I - i/o address map" 1FD8 0D0A4A202D dfb cr,lf, "J - jump to user program" 1FF2 0D0A4B202D dfb cr,lf, "K - display user STACK" 200A 0D0A4C202D dfb cr,lf, "L - load Intel hex file" 2023 0D0A4D202D dfb cr,lf, "M - monitor call number" 203C 0D0A4E202D dfb cr,lf, "N - new location pointer" 2056 0D0A51202D dfb cr,lf, "Q - quick home location" 206F 0D0A52202D dfb cr,lf, "R - user register display" 208A 0D0A53202D dfb cr,lf, "S - set value to user register" 20AA 0D0A57202D dfb cr,lf, "W - watch variables" 20BF 0D0A535041 dfb cr,lf, "SPACE BAR - single step" 20D8 0D0A3F202D dfb cr,lf, "? - help menu",cr,lf,0 20EA 0D0A303048io_text dfb cr,lf,"00H-0FH onboard 4-bit GPIO, D0-D3=output port" 2119 0D0A202020 dfb cr,lf," D4-D7=input port" 2133 0D0A dfb cr,lf 2135 0D0A313048 dfb cr,lf,"10H-13H 8255 system PPI, 10H=PORTA, 11H=PORTB, 12H=PORTC, 13H=CONTROL" 217C 0D0A dfb cr,lf 217E 0D0A323048 dfb cr,lf,"20H-23H 8254 programmable counter, 20H=counter0, 21H= counter1" 21BE 0D0A202020 dfb cr,lf," 22H=counter2, 23H control register" 21EA 0D0A dfb cr,lf 21EC 0D0A333048 dfb cr,lf,"30H-33H 8255 user PPI, 30H=PORTA, 31H=PORTB, 32H=PORTC, 33H=CONTROL" 2231 0D0A dfb cr,lf 2233 0D0A343048 dfb cr,lf,"40H-47H C16550 UART registers",0 2253 monitor_text: 2253 7365652069 dfb "see input parameters in user manual",cr,lf 2278 0D0A31456E dfb cr,lf,"1Enn MVI E,function_number" 2294 0D0A434620 dfb cr,lf,"CF RST 1" 22A0 0D0A dfb cr,lf 22A2 0D0A303020 dfb cr,lf,"00 - demo" ; #0 running LED with HL pointer 22AD 0D0A303120 dfb cr,lf,"01 - delay" ; #1 simple delay routine 22B9 0D0A303220 dfb cr,lf,"02 - cold_boot" ; #2 show 8085 running 22C9 0D0A303320 dfb cr,lf,"03 - scan" ; #3 scan display one cycle 22D4 0D0A303420 dfb cr,lf,"04 - cin" ; #4 get byte from console 22DE 0D0A303520 dfb cr,lf,"05 - cout" ; #5 print byte to console 22E9 0D0A303620 dfb cr,lf,"06 - put_str" ; #6 print string with 0 terminator to console

A8085.LST 29/3/2558 15:27

Page 58 of 63

Page 112: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044704470447044704470447044704470447044704470447044704470

22F7 0D0A303720 dfb cr,lf,"07 - init_lcd" ; #7 initialize lcd 2306 0D0A303820 dfb cr,lf,"08 - lcd_ready" ; #8 wait until lcd is ready 2316 0D0A303920 dfb cr,lf,"09 - clear_lcd" ; #9 clear lcd display 2326 0D0A304120 dfb cr,lf,"0A - goto_xy" ; #10 set lcd cursor position 2334 0D0A304220 dfb cr,lf,"0B - put_str_lcd" ; #11 print ASCII string on lcd 2346 0D0A304320 dfb cr,lf,"0C - put_ch_lcd" ; #12 print ASCII letter on lcd 2357 0D0A304420 dfb cr,lf,"0D - demo2",0 ; #13 run GPIO LED 2364 0D0A304520 dfb cr,lf,"0E - pint16u",0 ;#14 print 16-bit unsigned ; data segment F000 org system_ram F000 watch_ram dfs 16 ; watch variable F000-F00F F010 buffer dfs 16 ; buffer display F020 bcs dfs 1 ; byte checksum F021 key dfs 1 ; key position F022 command dfs 1 ; serial command F023 flag1 dfs 1 ; user flag ; flag.0 Space key was pressed ; flag.1 Enter key was pressed F024 uart_found dfs 1 ; 0 = no uart, 1 uart found F025 entry_mode dfs 1 ; 0 for data mode ; 1 for address mode ; 2 register display F026 counter1 dfs 1 ; event counter1 for data entry F027 counter2 dfs 1 ; event counter2 for address entry F028 warm_code dfs 1 ; warm boot code F029 user_PC dfs 2 ; user PC F02B user_AF dfs 2 ; user AF F02D user_BC dfs 2 ; user BC F02F user_DE dfs 2 ; user DE F031 user_HL dfs 2 ; user HL F033 user_SP dfs 2 ; user SP F035 tos dfs 2 ; Top of STACK F037 current_register dfs 2 ; stores current displayed register F039 temp dfs 2 ; temporary 16-bit storage F03B pointer dfs 2 ; for hex dump F03D break_address dfs 2 ; break address F03F break_opcode dfs 1 ; opcode that saved F040 bcd_counter1 dfs 3 ; 6-digit BCD counter1 F043 bcd_counter2 dfs 3 ; 6-digit BCD counter2 F046 line_buffer dfs 16 ; reserved for terminal printing F056 save_stack dfs 2 ; for saving system stack F058 system_stack dfs 32 F078 user_stack dfs 32 0000 END

A8085.LST 29/3/2558 15:27

Page 59 of 63

Page 113: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545

105C AC_TEXT 09E7 ADDRESS_MODE 1E97 AF_TEXT 124D ALT_PUT_STR 13AE ASCII_0_9 0D59 ASCII_PRINT 0D71 ASCII_PRINT1 1E45 ASCII_TEXT F040 BCD_COUNTER1 F043 BCD_COUNTER2 F020 BCS 1E9B BC_TEXT 0196 BIN1 01A1 BIN2 0194 BIN2ASCII 01AB BIN3 01B6 BIN4 08BE BREAK F03D BREAK_ADDRESS F03F BREAK_OPCODE F010 BUFFER 0080 BUSY 0637 BUZZER 0639 BUZZER1 1ECD BYTE_TEXT 16F2 C0 16F7 C1 1753 C10 1758 C11 175F C12 1766 C13 176C C14 1772 C15 1778 C16 177F C17 1784 C18 1789 C19 178F C1A 1796 C1B 179C C1C 17A2 C1D 17A8 C1E 17AF C1F 16FE C2 17B4 C20 17B9 C21 17C0 C22 17C6 C23 17CC C24 17D2 C25 17D8 C26 17DF C27 17E4 C28 17E9 C29 17EF C2A 17F5 C2B 17FB C2C 1801 C2D 1807 C2E 180E C2F 1705 C3 1813 C30 1818 C31 1820 C32 1825 C33 182C C34 1832 C35 1838 C36 183F C37 1844 C38 1849 C39 1850 C3A 1855 C3B 185C C3C 1862 C3D 1868 C3E 186F C3F 170B C4 1874 C40 187C C41 1884 C42 188C C43 1894 C44 189C C45 18A4 C46 18AC C47 18B4 C48 18BC C49 18C4 C4A 18CC C4B 18D4 C4C 18DC C4D 18E4 C4E 18EC C4F 1711 C5 18F4 C50 18FC C51 1904 C52 190C C53 1914 C54 191C C55 1924 C56 192C C57 1934 C58 193C C59 1944 C5A 194C C5B 1954 C5C 195C C5D 1964 C5E 196C C5F 1717 C6 1974 C60 197C C61 1984 C62 198C C63 1994 C64 199C C65 19A4 C66 19AC C67 19B4 C68 19BC C69 19C4 C6A 19CC C6B 19D4 C6C 19DC C6D 19E4 C6E 19EC C6F 171E C7 19F4 C70 19FC C71 1A04 C72 1A0C C73 1A14 C74 1A1C C75 1A24 C76 1A29 C77 1A31 C78 1A39 C79 1A41 C7A 1A49 C7B 1A51 C7C 1A59 C7D 1A61 C7E 1A69 C7F 1723 C8 1A71 C80 1A77 C81 1A7D C82 1A83 C83 1A89 C84 1A8F C85 1A95 C86 1A9B C87 1AA1 C88 1AA7 C89 1AAD C8A 1AB3 C8B 1AB9 C8C 1ABF C8D 1AC5 C8E 1ACB C8F 1728 C9 1AD1 C90 1AD7 C91 1ADD C92 1AE3 C93 1AE9 C94 1AEF C95 1AF5 C96 1AFB C97 1B01 C98 1B07 C99 1B0D C9A 1B13 C9B 1B19 C9C 1B1F C9D 1B25 C9E 1B2B C9F 172E CA 1B31 CA0 1B37 CA1 1B3D CA2 1B43 CA3 1B49 CA4 1B4F CA5 1B55 CA6 1B5B CA7 1B61 CA8 1B67 CA9 1B6D CAA 1B73 CAB 1B79 CAC 1B7F CAD 1B85 CAE 1B8B CAF 1735 CB 1B91 CB0 1B97 CB1 1B9D CB2 1BA3 CB3 1BA9 CB4 1BAF CB5 1BB5 CB6 1BBB CB7 1BC1 CB8 1BC7 CB9 1BCD CBA 1BD3 CBB 1BD9 CBC 1BDF CBD 1BE5 CBE 1BEB CBF 173B CC 1BF1 CC0 1BF6 CC1 1BFC CC2 1C01 CC3 1C06 CC4 1C0B CC5 1C12 CC6 1C17 CC7 1C1D CC8 1C21 CC9 1C26 CCA 1C2A CCB 1C2F CCC 1C33 CCD

A8085.LST 29/3/2558 15:27

Page 60 of 63

Page 114: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621

1C39 CCE 1C3E CCF 1741 CD 1C44 CD0 1C49 CD1 1C4F CD2 1C54 CD3 1C59 CD4 1C5E CD5 1C65 CD6 1C6A CD7 1C70 CD8 1C74 CD9 1C79 CDA 1C7D CDB 1C81 CDC 1C85 CDD 1C8A CDE 1C8F CDF 1747 CE 1C95 CE0 1C9A CE1 1CA0 CE2 1CA5 CE3 1CAB CE4 1CB0 CE5 1CB7 CE6 1CBC CE7 1CC2 CE8 1CC7 CE9 1CCD CEA 1CD2 CEB 1CD8 CEC 1CDD CED 1CE2 CEE 1CE7 CEF 174E CF 1CED CF0 1CF1 CF1 1CF9 CF2 1CFD CF3 1D01 CF4 1D05 CF5 1D0E CF6 1D13 CF7 1D19 CF8 1D1D CF9 1D23 CFA 1D27 CFB 1D2B CFC 1D2F CFD 1D34 CFE 1D39 CFF 1222 CIN 0ECA CLEAR1 14BC CLEAR_BCD1 14E5 CLEAR_BCD2 08F8 CLEAR_BREAK 01FB CLEAR_LCD 0EBD CLEAR_WATCH 0B99 CODE1 0BE1 CODE10 0BE9 CODE11 0BF1 CODE12 0BF9 CODE13 0C01 CODE14 0C09 CODE15 0C11 CODE16 0C19 CODE17 0C21 CODE18 0C29 CODE19 0BA1 CODE2 0C31 CODE20 0C39 CODE21 0C41 CODE22 0C49 CODE23 0C51 CODE24 0C59 CODE25 0C61 CODE26 0BA9 CODE3 0BB1 CODE4 0BB9 CODE5 0BC1 CODE6 0BC9 CODE7 0BD1 CODE8 0BD9 CODE9 0B63 COLD1 0B61 COLD2 0B72 COLD3 0B5C COLD_BOOT F022 COMMAND 0052 COMMAND_READ 0050 COMMAND_WRITE 0023 CONTROL_8254 0034 CONTROL_WORD_8254 1D75 CONVERT 0020 COUNTER0_8254 F026 COUNTER1 0021 COUNTER1_8254 F027 COUNTER2 0022 COUNTER2_8254 1216 COUT 1217 COUT1 000D CR F037 CURRENT_REGISTER 1063 CY_TEXT 0604 DATA_KEY 060F DATA_KEY1 0617 DATA_KEY2 061F DATA_KEY3 0627 DATA_KEY4 09F4 DATA_MODE 0053 DATA_READ 1442 DATA_RECORD 0051 DATA_WRITE 0C8D DEBOUNCE 0C8F DEBOUNCE1 097B DEBUG 0A5E DECREMENT 05FB DELAY 064D DELAY_US 064F DELAY_US1 093E DELETE_BYTE 094D DELETE_BYTE1 0B86 DEMO 0B88 DEMO1_2 1E9F DE_TEXT 0321 DIS2 038B DISASSEM1 039A DISASSEM2 0349 DISASSEM3 0335 DISASSEMBLE 030E DISASSEMBLE1 1E88 DISASSEMBLE_TEXT 0654 DISPLAY_OFF 0D37 DOWNLOAD 1DB4 DOWNLOAD_TEXT 1340 DUMP1 1338 DUMP_MEMORY 0401 D_DISASSEM1 0410 D_DISASSEM2 03BF D_DISASSEM3 03AB D_DISASSEMBLE 03D7 D_ONE_TAB 1133 EDIT1 110E EDIT_LOCATION 1DDD EDIT_TEXT 1DF5 EDIT_TEXT1 1E20 EDIT_TEXT2 06FD ENTER_ADDRESS 06C3 ENTER_DATA 06E8 ENTER_DATA1 0663 ENTER_REGISTER F025 ENTRY_MODE 0000 EOS 1E80 ERROR_TEXT 001B ESC 1441 ESC_QUIT 0D8A EXIT_ASCII_PRINT 0202 EXIT_CLEAR 0ED7 EXIT_CLEAR_WATCH 0334 EXIT_DISASSEMBLE 0D58 EXIT_DOWNLOAD 1190 EXIT_EDIT 1181 EXIT_EDIT1 10AA EXIT_FILL 13D8 EXIT_GET_HEX2 13E1 EXIT_GET_HEX3 11EC EXIT_HELP 1337 EXIT_HEX_DUMP 11D4 EXIT_IO 110D EXIT_JUMP 10C3 EXIT_MONITOR 11AD EXIT_NEW_LOCATION 0D36 EXIT_PROMPTING 11C2 EXIT_QUICK_HOME 1058 EXIT_REGISTER 0E9F EXIT_SET_USER 0F32 EXIT_STACK 0EF2 EXIT_STEP 0EE6 EXIT_WATCH 1067 FILL_MEMORY 1099 FILL_MEMORY1 1E56 FILL_TEXT1 1E67 FILL_TEXT2 1E77 FILL_TEXT3 F023 FLAG1 1EB4 FLAG_TEXT 1210 FOUND 0593 FUNCTION1 059E FUNCTION2 05A9 FUNCTION3 05B4 FUNCTION4 05C0 FUNCTION5 05CB FUNCTION6 05D6 FUNCTION7 05E1 FUNCTION8 05EC FUNCTION9 09FF FUNCTION_2ND 0588 FUNCTION_KEY 13B9 GET_2ND_HEX 122C GET_COMMAND 1359 GET_HEX 136C GET_HEX1 1385 GET_HEX2 0B91 GET_KEY_CODE 0421 GET_NUMBER_OF_BYTE 13EA GET_RECORD 0981 GO 0225 GOTO_XY 0234 GOTO_XY1 023F GOTO_XY2 024A GOTO_XY3 0255 GOTO_XY4 0000 GPIO 11D5 HELP 1F22 HELP_TEXT 1F55 HELP_TEXT1 12D8 HEX_DUMP 12F9 HEX_DUMP1 12E5 HEX_DUMP2 131F HEX_DUMP3 1321 HEX_DUMP4 1314 HEX_DUMP5 1EA3 HL_TEXT 0967 HOME 8100 HOME_ADDRESS 0A4B INCREMENT

A8085.LST 29/3/2558 15:27

Page 61 of 63

Page 115: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697

1470 INC_BCD1 1488 INC_BCD2 018A INIT_8254 0203 INIT_LCD 11ED INIT_UART 0913 INSERT_BYTE 0926 INSERT_BYTE1 14F2 INS_TABLE 11C3 IO_ADDRESS 20EA IO_TEXT 06F9 IT_IS_RAM 1E2E JUMP_TEXT1 1E40 JUMP_TEXT2 10C4 JUMP_TO_USER_PGM F021 KEY 057C KEY_EXECUTE 01F1 LCD_READY 01F2 LCD_READY1 000A LF F046 LINE_BUFFER 0181 MAIN 16F2 MNEM 0B23 MODE1 0B5A MODE2 0AE8 MODE_INDICATOR 0A23 MODIFY_REGISTER 025C MONITOR_CALL 10AB MONITOR_FUNCTION 2253 MONITOR_TEXT 8000 MY_ROM 12C1 NEW_LINE 1191 NEW_LOCATION 1DCD NEW_TEXT 0CBE NEXT_KEY 1239 NO_DATA 0429 NUMBER1 0471 NUMBER10 0479 NUMBER11 0481 NUMBER12 0489 NUMBER13 0491 NUMBER14 0499 NUMBER15 04A1 NUMBER16 04A9 NUMBER17 04B1 NUMBER18 04B9 NUMBER19 0431 NUMBER2 04C1 NUMBER20 04C9 NUMBER21 04D1 NUMBER22 04D9 NUMBER23 04E1 NUMBER24 04E9 NUMBER25 04F1 NUMBER26 04F9 NUMBER27 0501 NUMBER28 0509 NUMBER29 0439 NUMBER3 0511 NUMBER30 0519 NUMBER31 0521 NUMBER32 0529 NUMBER33 0531 NUMBER34 0539 NUMBER35 0541 NUMBER36 0549 NUMBER37 0551 NUMBER38 0559 NUMBER39 0441 NUMBER4 0561 NUMBER40 0569 NUMBER41 0571 NUMBER42 0579 NUMBER43 0449 NUMBER5 0451 NUMBER6 0459 NUMBER7 0461 NUMBER8 0469 NUMBER9 1D85 OFF_DISPLAY 0657 OFF_DISPLAY1 13D0 OK_0_9 0361 ONE_TAB 0963 OPTION1 12A1 OUT1X 12AD OUT1X1 12B2 OUT2X 1EB0 PC_TEXT 01DF PINT1 01EA PINT2 01C4 PINT8U F03B POINTER 14A0 PRINT_BCD1 14C9 PRINT_BCD2 0ED8 PRINT_WATCH 0EA0 PRINT_WATCH_RAM 1D3F PROMPT1 1D8B PROMPT2 1256 PROMPT3 0D19 PROMPTING 1DCB PROMPT_TEXT 0256 PUT_CH_LCD 07E1 PUT_FLAG 07E9 PUT_HIGH1 086A PUT_HIGH2 123F PUT_STR 1246 PUT_STR1 128C PUT_STR2 0215 PUT_STR_LCD 021C PUT_STR_LCD1 1060 P_TEXT 11AE QUICK_HOME 0AA4 READ_MEMORY 0A79 READ_REGISTER 0755 REGISTER1 0898 REGISTER10 0771 REGISTER2 078D REGISTER3 07A9 REGISTER4 07C5 REGISTER5 07EC REGISTER6 0814 REGISTER7 083F REGISTER8 0870 REGISTER9 0F33 REGISTER_DISPLAY 0F3B REGISTER_DISPLAY1 0F3E REGISTER_DISPLAY2 0FD0 REGISTER_FLAG1 1051 REGISTER_FLAG10 0FD5 REGISTER_FLAG2 0FEF REGISTER_FLAG3 0FF4 REGISTER_FLAG4 100E REGISTER_FLAG5 1013 REGISTER_FLAG6 102D REGISTER_FLAG7 1032 REGISTER_FLAG8 104C REGISTER_FLAG9 0000 ROM 0000 RS F056 SAVE_STACK 0C94 SCAN 0CA2 SCAN1 0C64 SCAN_KEY 0C7B SCAN_KEY1 0C75 SCAN_KEY2 0C75 SCAN_KEY3 0C64 SCAN_KEY4 0737 SELECT_REGISTER 0D21 SEND_PROMPT 1293 SEND_PROMPT1 129A SEND_PROMPT3 12D2 SEND_TAB 0CD4 SERIAL_COMMAND 02B3 SERVICE_RST2 028E SERVICE_RST7 02D8 SERVICE_TRAP 1EF3 SET_REGISTER_TEXT 0DC7 SET_USER1 0DF2 SET_USER2 0E1D SET_USER3 0E48 SET_USER4 0E73 SET_USER5 0E9E SET_USER6 0D8B SET_USER_REGISTER 0713 SHIFT_ADDRESS 06D6 SHIFT_DATA 0CB4 SHIFT_KEY 066E SHIFT_REGISTER 1ECA SIGN_TEXT 09A5 SINGLE_STEP 0EE7 SINGLE_STEP_ 0309 SKIP1 09C5 SKIP2 0141 SKIP_BOOT 015F SKIP_COLD_BOOT 1171 SKIP_EDIT1 117A SKIP_EDIT2 1464 SKIP_ERROR 10FE SKIP_LOAD_PC 07EB SKIP_PUT_HIGH1 086C SKIP_PUT_HIGH2 0176 SKIP_SEND_PROMPT 0D18 SKIP_SERIAL 0020 SP 12CC SPACE 1EA7 SP_TEXT 0EF3 STACK_DISPLAY 0F07 STACK_DISPLAY1 1EDB STACK_TEXT 0100 START 0010 SYSTEM_PORT_A 0011 SYSTEM_PORT_B 0012 SYSTEM_PORT_C 0013 SYSTEM_PORT_CONTROL F000 SYSTEM_RAM F058 SYSTEM_STACK 0009 TAB F039 TEMP 0628 TEST_BUZZER 05ED TEST_LED 05EF TEST_LED1 1DA0 TEXT3 0B7A TITLE F035 TOS 1EAB TOS_TEXT 134D TO_HEX 0A6E TO_SEVEN_SEGMENT 0040 UART_BUFFER 0040 UART_DIVISOR_LSB 0041 UART_DIVISOR_MSB 0042 UART_FIFO F024 UART_FOUND 0043 UART_LCR 0045 UART_LINE_STATUS 0047 UART_SCR F02B USER_AF F02D USER_BC F02F USER_DE F031 USER_HL F029 USER_PC 0030 USER_PORT_A 0031 USER_PORT_B 0032 USER_PORT_C 0033 USER_PORT_CONTROL F033 USER_SP F078 USER_STACK 0270 VECTOR_TABLE 0CAC WAIT1 141D WAIT_CR

A8085.LST 29/3/2558 15:27

Page 62 of 63

Page 116: 8085 Microprocessor Training Kit User's Manual - · PDF fileOverview The MTK-85 is a low-cost single board computer designed for self-learning the popular 8085 Microprocessor. The

4698469947004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700470047004700

F028 WARM_CODE 0EB0 WATCH1 F000 WATCH_RAM 1358 ZERO_NINE 1059 ZERO_TEXT

A8085.LST 29/3/2558 15:27

Page 63 of 63