0% found this document useful (0 votes)
2 views53 pages

8085 - Microprocessor Lab File

The document is a lab activity report for a course on Microprocessor-Based System Design, specifically focusing on the 8085 microprocessor. It includes a list of experiments, each detailing specific programming tasks such as data storage, arithmetic operations, and memory management using assembly language. The report is submitted by a group of students to their instructor and outlines the structure and features of the 8085 microprocessor along with practical applications and programming examples.

Uploaded by

shardool0d
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views53 pages

8085 - Microprocessor Lab File

The document is a lab activity report for a course on Microprocessor-Based System Design, specifically focusing on the 8085 microprocessor. It includes a list of experiments, each detailing specific programming tasks such as data storage, arithmetic operations, and memory management using assembly language. The report is submitted by a group of students to their instructor and outlines the structure and features of the 8085 microprocessor along with practical applications and programming examples.

Uploaded by

shardool0d
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LAB ACTIVITY REPORT

UCS617
Microprocessor-Based System Design

Lab Assignment-1 (8085 Microprocessor)

Submitted By –
Jahanvi Varshney (102383040)
Yuvraj Mangla (102383073)
Yuvraj Singh (102383074)
Yugansh Garg (102383072)
Jeevetesh Bhanot (102383041)
Tanish Garg (102203710)

BE Third Year – COE

Submitted To –
Dr. Manju Khurana

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


THAPAR INSTITUTE OF ENGINEERING AND TECHNOLOGY
(A DEEMED TO BE UNIVERSITY)
PATIALA, PUNJAB INDIA
Jan - May 2024
UCS617 Microprocessors Based System Design

TABLE OF CONTENT

S. No Name Of Experiment Page No

1. Introduction of 8085-microprocessor kit and steps for execution on 3


the kit.

2. Familiarity with 8085-microprocessor kit. 8

i) Write a program to store 8-bit data into one register and then 8
copy that to all registers.

ii) Write a program for addition of two 8-bit numbers. 11

iii) Write a program to add 8-bit numbers using direct and indirect 12
addressing mode.
iv) Write a program to add 16-bit numbers using direct and indirect 14
addressing mode.
v) Write a program to 8-bit numbers using carry. (using JNC 18
instruction).
vi) Write a program to find 1’s complement and 2’s complement of 20
8-bit number.
3. Write a program for the sum of series of numbers. 24

4. Write a program for data transfer from memory block B1 to memory 26


block B2.
5. Write a program for multiply two 8-bit numbers. 31

6. Write a program to add ten 8-bit numbers. Assume the numbers are 33
stored in 8500-8509. Store the result in 850A and 850B memory
address.
7. Write a program to find the negative numbers in a block of data. 35

8. Write a program to count the number of one's in a number. 37

9. Write a program to arrange numbers in Ascending order. 39

10. Calculate the sum of series of even numbers. 42

11. Write an assembly language program to verify how many bytes are 44
present in a given set, which resembles 10101101 in 8085.
12. Write an assembly language program to find the numbers of even parity 46
in ten consecutive memory locations in 8085.
13. Write an assembly language program to convert a BCD number into its 48
equivalent binary in 8085.
14. Write an assembly language program for exchange the contents of 50
memory location.

15. Write a program to find the largest number in an array of 10 elements. 52

2
UCS617 Microprocessors Based System Design

EXPERIMENT-1
AIM: Introduction of 8085-microprocessor kit and steps for execution on the kit.

FIG 1: 8085 Microprocessor

FEATURES OF 8085 MICROPROCESSORS:


• 8085 is developed by INTEL 8-bit microprocessor: can accept 8 bit data
simultaneously.
• Operates on single +5V D.C. supply.
• Designed using NMOS technology.
• 6200 transistors on a single chip.
• It provides on chip clock generator; hence it does not require external clock generator.
• Operates on 3MHz clock frequency.
• 8bit multiplexed address/data bus, which reduce the number of pins.
• 16address lines, hence it can address 2^16 = 64 K bytes of memory
• It generates 8 bit I/O addresses; hence it can access 2^8 = 256 I/O ports.
• 5 hardware interrupts i.e. TRAP/RST4.5, RST 7.5, RST 6.5, RST 5.5, and INTR
• It provides DMA (Direct memory access).
• 40-pin I.C. package fabricated on a single LSI chip.
• Clock cycle is 320ns.
• 80 basic instructions and 246 opcodes.

3
UCS617 Microprocessors Based System Design

Introduction to 8085 Microprocessor


The 8085 microprocessor is an 8-bit microprocessor developed by Intel in 1976. It derives its
name from its compatibility with the 8-bit data format and its successor to the 8080
microprocessors. The 8085 is a versatile and efficient processor widely used in educational,
industrial, and embedded system applications. Let’s delve into its architecture, features, and
working.

Architecture of the 8085 Microprocessor


The 8085 microprocessor consists of several components working in unison to execute
instructions efficiently. Its architecture includes:
1. Arithmetic and Logic Unit (ALU): The ALU performs arithmetic operations (addition,
subtraction) and logical operations (AND, OR, XOR) on 8-bit data.
2. Registers: The processor has a set of registers for temporary data storage:
• Accumulator (A): A special-purpose register used for arithmetic and logical
operations.
• General-purpose registers (B, C, D, E, H, L): These six registers can be paired
(BC, DE, HL) for 16-bit operations.
• Program Counter (PC): Holds the memory address of the next instruction to be
executed.
• Stack Pointer (SP): Points to the address of the top of the stack.
• Temporary Register: Used internally during instruction execution.

3. Control Unit: The control unit synchronizes the operations of the microprocessor and
controls data flow between various components.
4. Instruction Register and Decoder: The instruction register holds the instruction being
executed, while the decoder interprets it and generates control signals.
5. Address and Data Buses:
• Address Bus: A 16-bit bus used to specify memory addresses, enabling access to
up to 64KB of memory.
• Data Bus: An 8-bit bidirectional bus used to transfer data between the processor
and memory or I/O devices.
6. Clock Generator: Provides timing signals to synchronize the processor’s operations. The
8085 operates at a clock frequency of 3 MHz.

4
UCS617 Microprocessors Based System Design

FIG 2: Microprocessor - 8085 Architecture

Working Principle
The 8085 microprocessor operates in a fetch-decode-execute cycle:
1. Fetch: The microprocessor fetches the instruction stored at the memory location
specified by the program counter.
2. Decode: The fetched instruction is decoded by the instruction decoder to determine the
operation to be performed.
3. Execute: The microprocessor executes the decoded instruction, interacting with
memory or I/O devices if necessary. The program counter is updated to point to the
next instruction.

Applications of the 8085 Microprocessor


The 8085 microprocessors have been used in various applications, including:
• Embedded Systems: Used in traffic light controllers, washing machines, and medical
devices.
• Educational Tools: Ideal for learning microprocessor programming and architecture.
• Industrial Control Systems: Employed in process automation and control systems.
• Communication Devices: Utilized in modems and interfacing equipment.

5
UCS617 Microprocessors Based System Design

Special Functions
1. RST (Reset)
• Purpose: Resets a specific register value to 0.
• Usage: Clears the register to its default state, often to prepare it for new operations
or to clear any residual data.
2. Prev (Previous)
• Purpose: Moves to the previous memory or address location.
• Usage: Useful for stepping backward through memory or instruction sequences
during debugging or review.
3. Next
• Purpose: Moves to the next memory or address location.
• Usage: Often used to iterate forward through instructions or memory locations.
4. Go
• Purpose: Acts like a "jump" statement in programming. After clicking Go, you
specify a starting address, and the execution begins from that address.
• Usage: Used to set the execution pointer to a specific location for testing or
debugging.
5. EXM Reg (Examine Register)
• Purpose: Views the current contents of a specified register.
• Usage: Allows the user to inspect register values, typically for debugging or
analysis.
6. EXM Mem (Examine Memory)
• Purpose: Views the contents of a specified memory location.
• Usage: Helps in inspecting the stored values or instructions at a particular memory
address.

6
UCS617 Microprocessors Based System Design

Steps to run/execute program on 8085 microprocessors


1. Press Reset
2. Press examine memory
3. Enter starting Address of the program
4. Press Next
5. Enter opcode by subsequently pressing next
6. Press reset (skip in case of registers)
7. Press Go
8. Enter starting address of the program
9. Press EXEC/FILL
10. Press Reset
11. Press Examine Register
12. Enter Output address/register
13. Press Next

VIKAS SIMULATOR

Fig 3: Vikas Simulator

7
UCS617 Microprocessors Based System Design

EXPERIMENT-2.1
AIM - Write a program to store 8-bit data into one register and then copy that to all registers.

Code Memory Location Opcode


MVI A, 48 8000, 8001 3E, 48
MOV B, A 8002 47
MOV C, A 8003 4F
MOV D, A 8004 57
MOV D, A 8005 5F
MOV D, A 8006 67
MOV D, A 8007 6F
RST 5 8008 EF

FLAG REGISTER WINDOW:

Fig. 2.1.1 Flag Register Window

OUTPUT:

Fig. 2.1.2 Output of Register A

8
UCS617 Microprocessors Based System Design

Fig. 2.1.2 Output of Register B

Fig. 2.1.2 Output of Register C

Fig. 2.1.2 Output of Register D

9
UCS617 Microprocessors Based System Design

Fig. 2.1.2 Output of Register H

Fig. 2.1.2 Output of Register L

10
UCS617 Microprocessors Based System Design

EXPERIMENT-2.2
AIM - Write a program for addition of two 8-bit numbers.

Code Memory Location Opcode


MVI A, 48 8000, 8001 3E, 48
MOV B, 48 8002, 8003 06, 48
ADD B 8004 80
STA 8500 8005, 8006, 8007 32, 00, 85
RST 5 8008 EF

FLAG REGISTER WINDOW:

Fig. 2.1.1 Flag Register


Window

OUTPUT:

Fig. 2.2.1 Output at memory location 8500

11
UCS617 Microprocessors Based System Design

EXPERIMENT-2.3

AIM - Write a program to add 8-bit numbers using direct and indirect addressing mode.

Direct Mode:

Code Memory Location Opcode


LDA 8500 8000, 8001, 8002 3A, 00, 85
MOV B, A 8003 47
LDA 8501 8004, 8005, 8006 3A, 01, 85
ADD B 8007 80
STA 8502 8008, 8009, 800A 32, 02, 85
RST 5 800B EF

FLAG REGISTER WINDOW:

Fig. 2.3.1 Flag Register Window (Direct Mode)

OUTPUT:

Fig. 2.3.1 Output at memory location 8502

12
UCS617 Microprocessors Based System Design

Indirect Mode:

Code Memory Location Opcode


LXI H, 8500 8000, 8001, 8002 21, 00, 85
MOV A, M 8003 7E
INX H 8004 23
ADD M 8005 86
INX H 8006 23
MOV M, A 8007 77
RST 5 8008 EF

FLAG REGISTER WINDOW:

Fig. 2.3.2 Flag Register Window (Indirect Mode)


OUTPUT:

Fig. 2.2.1 Output at memory location 8500

13
UCS617 Microprocessors Based System Design

EXPERIMENT - 2.4
AIM: Write a program to add 16-bit numbers using direct and indirect addressing mode.

Direct Mode:

Code Memory Location Opcode


LHLD 8500 8000, 8001, 8002 2A, 00, 85
XCHG 8003 EB
LHLD 8502 8004, 8005, 8006 2A, 02, 85
DAD D 8007 19
SHLD 8504 8008, 8009, 800A 22, 04, 85
RST 5 800B EF

FLAG REGISTER WINDOW:

Figure 2.4.1 - Flag Register Window (Direct)

14
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 2.4.2 – Output at memory location 8504

Figure 2.4.3 – Output at memory location 8505

15
UCS617 Microprocessors Based System Design

Indirect Mode:

Code Memory Location Opcode


LXI B, 8500 8000, 8001, 8002 01, 00, 85
LDAX B 8003 0A
MOV D, A 8004 57
INX B 8005 03
LDAX B 8006 0A
ADD D 8007 82
STA 8504 8008, 8009, 800A 32, 04, 85
INX B 800B 03
LDAX B 800C 0A
MOV D, A 800D 57
INX B 800E 03
LDAX B 800F 0A
ADC D 8010 8A
STA 8505 8011, 8012, 8013 32, 05, 85
RST 5 8014 EF

FLAG REGISTER WINDOW:

Figure 2.4.4 – Flag Register Window (Indirect)

16
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 2.4.5 – Output at memory location 8504

Figure 2.4.6 – Output at memory location 8505

17
UCS617 Microprocessors Based System Design

EXPERIMENT - 2.5
AIM: Write a program to add 8-bit numbers using carry. (using JNC instruction).

Code Memory Location Opcode


MVI C, 00 8000, 8001 0E, 00
LXI H, 8500 8002, 8003, 8004 21, 00, 85
MOV A, M 8005 7E
INX H 8006 23
ADD M 8007 86
JNC Next 8008, 8009, 800A D2, 0C, 80
INR C 800B 0C
INX H 800C 23
MOV M, A 800D 77
INX H 800E 23
MOV M, C 800F 71
RST 5 8010 EF

FLAG REGISTER WINDOW:

Figure 2.5.1 – Flag Register Window

18
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 2.5.2 – Output at memory location 8502

Figure 2.5.3 – Output at memory location 8503

19
UCS617 Microprocessors Based System Design

EXPERIMENT - 2.6
AIM: Write a program to find 1’s complement and 2’s complement of an 8-bit number.

1’s COMPLEMENT:

Code Memory Location Opcode


LDA 8500H 8000, 8001, 8002 3A, 00, 85
CMA 8003 2F
STA 8501H 8004, 8005, 8006 32, 01, 85
RST 5 8007 EF

FLAG REGISTER WINDOW:

Figure 2.6.1 – Flag Register Window (1’s Complement)

20
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 2.6.2 – Output at memory location 8501

21
UCS617 Microprocessors Based System Design

2’s COMPLEMENT:

Code Memory Location Opcode


LDA 8500H 8000, 8001, 8002 3A, 00, 85
CMA 8003 2F
INR A 8004 3C
STA 8501H 8005, 8006, 8007 32, 01, 85
RST 5 8008 EF

FLAG REGISTER WINDOW:

Figure 2.6.3 – Flag Register Window (2’s Complement)

22
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 2.6.4 – Output at memory location 8501

23
UCS617 Microprocessors Based System Design

EXPERIMENT - 3

AIM: Write a program for the sum of series of numbers.

Code Memory Location Opcode


LDA 8500H 8000, 8001, 8002 3A, 00, 85
MOV C, A 8003 4F
SUB A 8004 97
LXI H, 8501H 8005, 8006, 8007 21, 01, 85
ADD M 8008 86
INX H 8009 23
DCR C 800A 0D
JNZ Back 800B, 800C, 800D C2, 08, 80
STA 8600H 800E, 800F, 8010 32, 00, 86
RST 5 8011 EF

FLAG REGISTER WINDOW:

Figure 3.1 – Flag Register Window

24
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 3.2 – Output at memory location 8600

25
UCS617 Microprocessors Based System Design

EXPERIMENT – 4

AIM: Write a program for data transfer from memory block B1 to memory block B2.

Code Memory Location Opcode


MVI C, 0AH 8000, 8001 0E, 0A
LXI H, 8500H 8002, 8003, 8004 21, 00, 85
LXI D, 8600H 8005, 8006, 8007 11, 00, 86
Back: MOV A, M 8008 7E
STAX D 8009 12
INX H 800A 23
INX D 800B 13
DCR C 800C 0D
JNZ Back 800D, 800E, 800F C2, 08, 80
RST 5 8010 EF

FLAG REGISTER WINDOW:

Figure 4.1 – Flag Register Window

26
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 4.2 – Output at memory location 8600

Figure 4.3 – Output at memory location 8601

Figure 4.4 – Output at memory location 8602

27
UCS617 Microprocessors Based System Design

Figure 4.5– Output at memory location 8603

Figure 4.6– Output at memory location 8604

Figure 4.7– Output at memory location 8605

28
UCS617 Microprocessors Based System Design

Figure 4.8– Output at memory location 8606

Figure 4.9– Output at memory location 8607

Figure 4.10– Output at memory location 8608

29
UCS617 Microprocessors Based System Design

Figure 4.11– Output at memory location 8609

30
UCS617 Microprocessors Based System Design

EXPERIMENT – 5
AIM: Write a program for multiply two 8-bit numbers.

Code Memory Location Opcode


LDA 8500H 8000, 8001, 8002 3A, 00, 85
MOV E, A 8003 5F
MVI D, 00 8004, 8005 16, 00
LDA 8501H 8006, 8007, 8008 3A, 01, 85
MOV C, A 8009 4F
LXI H, 0000H 800A, 800B, 800C 21, 00, 00
Back: DAD D 800D 19
DCR C 800E 0D
JNZ Back 800F, 8010, 8011 C2, 0D. 80
SHLD 8600H 8012, 8013, 8014 22, 00, 86
RST 5 8015 EF

FLAG REGISTER WINDOW:

Figure 5.1 – Flag Register Window

OUTPUT

Figure 5.2– Output at memory location 8600

31
UCS617 Microprocessors Based System Design

Figure 5.3– Output at memory location 8601

32
UCS617 Microprocessors Based System Design

EXPERIMENT-6
Aim: Write a program to add ten 8-bit numbers. Assume the numbers are stored in
8500-8509. Store the result in 850A and 850B memory address.

CODE MEMORY LOCATION OPCODE


MVI C, 00 8000,8001 0E,00
MVI B,09 8002,8003 06,09
LXI H, 8500H 8004,8005,8006 21,00,85
MOV A, M 8007 7E
Back: INX H 8008 23
ADD M 8009 86
JNC Next 800A,800B,800C D2,0E,80
INR C 800D 0C
Next: DCR B 800E 05
JNZ Back 800F,8010,8011 C2,08,80
INX H 8012 23
MOV M, A 8013 77
INX H 8014 23
MOV M, C 8015 71
RST 5 8016 EF

FLAG REGISTER WINDOW:

Figure 6.1 – Flag Register Window

33
UCS617 Microprocessors Based System Design

OUTPUT

Figure 6.2 – Output at memory location 860A

Figure 6.3 – Output at memory location 860B

34
UCS617 Microprocessors Based System Design

EXPERIMENT-7
Aim: Write a program to find the negative numbers in a block of data.

CODE MEMORY LOCATION OPCODE

LDA 8500H 8000,8001,8002 3A,00,85


MOV C, A 8003 4F
MVI B, 00 8004,8005 06,00
LXI H, 8500H 8006,8007,8008 21,01,85
Back: MOV A, M 8009 7E

ANI 80H 800A,800B E6,80


JZ Skip 800C,800D,800E CA,10,80
INR B 800F 04
Skip: INX H 8010 23

DCR C 8011 0D
JNZ Back 8012,8013,8014 C2,09,80
MOV A, B 8015 78
STA 8600H 8016,8017,8018 32,00,86
RST 5 8019 EF

FLAG REGISTER WINDOW:

Figure 7.1 – Flag Register Window

35
UCS617 Microprocessors Based System Design

OUTPUT

Figure 7.2 – Output at memory location 8600

36
UCS617 Microprocessors Based System Design

EXPERIMENT-8
Aim: Write a program to count the number of one's in a number.

CODE MEMORY LOCATION OPCODE

LDA 8500H 8000,8001,8002 3A,00,85

MVI B, 08 8003,8004 06.08

MVI D, 00 8005,8006 16,00

Loop 1: RLC 8007 07

JNC Loop2 8008,8009,800A D2,0C,80

INR D 800B 14

Loop2: DCR B 800C 05

JNZ Loop 1 800D,800E,800F C2,07,80

MOV A, D 8010 7A

STA 8600H 8011,8012,8013 32,00,86

RST 5 8014 EF

FLAG REGISTER WINDOW:

Figure 8.1 – Flag Register Window

37
UCS617 Microprocessors Based System Design

OUTPUT

Figure 8.1 – Output at memory location 8600

38
UCS617 Microprocessors Based System Design

EXPERIMENT-9
Aim: Write a program to arrange numbers in Ascending order.

CODE MEMORY LOCATION OPCODE


LXI H, 8500H 8000,8001,8001 21,00,85
MOV C, M 8003 4E
DCR C 8004 0D
Repeat: MOV D, C 8005 51
LXI H, 8501H 8006,8007,8008 21,01,85
Loop: MOV A, M 8009 7E
INX H 800A 23
CMP M 800B BE
JC Skip 800C,800D,800E DA,14,80
MOV B, M 800F 46
MOV M, A 8010 77
DCX H 8011 2B
MOV M, B 8012 70
INX H 8013 23
Skip: DCR D 8014 15
JNZ Loop 8015,8016,8017 C2,09,80
DCR C 8018 0D
JNZ Repeat 8019,801A,801B C2,05,80
RST 5 801C EF

FLAG REGISTER WINDOW:

Figure 9.1 – Flag Register Window

39
UCS617 Microprocessors Based System Design

OUTPUT

Figure 9.2 – Output at memory location 8600

Figure 9.3 – Output at memory location 8601

Figure 9.4 – Output at memory location 8602


40
UCS617 Microprocessors Based System Design

Figure 9.5 – Output at memory location 8603

Figure 9.6 – Output at memory location 8604

Figure 9.7 – Output at memory location 8605

41
UCS617 Microprocessors Based System Design

EXPERIMENT-10
Aim: Calculate the sum of series of even numbers.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000, 8001, 8002 3A, 00 ,85
MOV C, A 8003 4F
MVI B, 00 8004, 8005 06, 00
LXI H, 8501H 8006, 8007, 8008 21, 01, 85
Back: MOV A, M 8009 7E
ANI 01 800A, 800B E6, 01
JNZ Skip 800C, 800D, 800E C2, 12, 80
MOV A, B 800F 78
ADD M 8010 86
MOV B, A 8011 47
Skip: INX H 8012 23
DCR C 8013 0D
JNZ Back 8014, 8015, 8016 C2, 09, 80
STA 8600H 8017, 8018, 8019 32, 00, 86
RST 5 801A EF

FLAG REGISTER WINDOW:

Figure 10.1 – Flag Register Window

42
UCS617 Microprocessors Based System Design

OUTPUT

Figure 10.2 – Output at memory location 8600

43
UCS617 Microprocessors Based System Design

EXPERIMENT-11
Aim: Write an assembly language program to verify how many bytes are present in a
given set, which resembles 10101101 in 8085.

CODE MEMORY LOCATION OPCODE


MVI B, 0A 8000,8001 06, 0A
MVI D, AD 8002,8003 16, AD
MVI C, 00 8004,8005 0E, 00
LXI H, 8500H 8006,8007,8008 21, 00, 85
Back: MOV A, M 8009 7E
CMP D 800A BA
JNZ Next 800B,800C,800D C2, 0F, 80
INR C 800E 0C
Next: INX H 800F 23
DCR B 8010 05
JNZ Back 8011,8012,8013 C2, 09, 80
MOV A, C 8014 79
STA 8600H 8015,8016,8017 32, 00, 86
RST 5 8018 EF

FLAG REGISTER WINDOW:

Figure 11.1 – Flag Register Window


44
UCS617 Microprocessors Based System Design

Figure 11.2 – Output at memory location 8600

45
UCS617 Microprocessors Based System Design

EXPERIMENT-12
Aim: Write an assembly language program to find the numbers of even parity in ten
consecutive memory locations in 8085.

CODE MEMORY LOCATION OPCODE


MVI B, 0A 8000,8001 06, 0A
MVI C, 00 8002,8003 0E, 00
LXI H, 8500H 8004,8005,8006 21, 00, 85
Back: MOV A, M 8007 7E
ANI FF 8008,8009 E6, FF
JPO Next 800A,800B,800C E2, 0E, 80
INR C 800D 0C
Next: INX H 800E 23
DCR B 800F 05
JNZ Back 8010,8011,8012 C2, 07, 80
MOV A, C 8013 79
STA 8600H 8014,8015,8016 32, 00, 86
RST 5 8017 EF

FLAG REGISTER WINDOW:

Figure 12.1 – Flag Register Window

46
UCS617 Microprocessors Based System Design

Figure 12.2 – Output at memory location 8600

47
UCS617 Microprocessors Based System Design

EXPERIMENT-13
Aim: Write an assembly language program to convert a BCD number into its
equivalent binary in 8085.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000,8001,8002 3A, 00,85
MOV B, A 8003 47
ANI 0F 8004,8005 E6, 0F
MOV C, A 8006 4F
MOV A, B 8007 78
ANI F0 8008,8009 E6, F0
RRC 800A 0F
RRC 800B 0F
RRC 800C 0F
RRC 800D 0F
MOV B, A 800E 47
XRA A 800F AF
MVI D, 0A 8010,8011 16, 0A
Sum: ADD D 8012 82
DCR B 8013 05
JNZ Sum 8014,8015,8016 C2, 12, 80
ADD C 8017 81
STA 8600H 8018,8019,801A 32, 00, 86
RST 5 801B EF

FLAG REGISTER WINDOW:

48
UCS617 Microprocessors Based System Design

Figure 13.1 – Flag Register Window

OUTPUT

Figure 13.2 – Output at memory location 8600

49
UCS617 Microprocessors Based System Design

EXPERIMENT – 14

AIM: Write an ALP for exchange of contents of memory locations.

TABLE:

Code Memory Location Opcode


LDA 8500H 8000, 8001, 8002 3A, 00, 85
MOV B, A 8003 47
LDA 8600H 8004, 8005, 8006 3A, 00, 86
STA 8500H 8007, 8008, 8009 32, 00, 85
MOV A, B 800A 78
STA 8600H 800B, 800C, 800D 32, 00, 86
RST 5 800E EF

FLAG REGISTER WINDOW:

Figure 14.1 – Flag Register Window

50
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 14.2 – Output at memory location 8500

Figure 14.3 – Output at memory location 8600

51
UCS617 Microprocessors Based System Design

EXPERIMENT – 15

AIM: Write a program for multiply two 8-bit numbers.

TABLE:

Code Memory Location Opcode


MVI B, 09 8000, 8001 06, 09
LXI H, 8500H 8002, 8003, 8004 21, 00, 85
MOV A, M 8005 7E
INX H 8006 23
Back: CMP M 8007 BE
JNC Next 8008, 8009, 800A D2, 0C, 80
MOV A, M 800B 7E
Next: INX H 800C 23
DCR B 800D 05
JNZ Back 800E, 800F, 8010 C2, 07. 80
STA 850AH 8011, 8012, 8013 32, 0A, 85
RST 5 8014 EF

FLAG REGISTER WINDOW:

Figure 15.1 – Flag Register Window

52
UCS617 Microprocessors Based System Design

OUTPUT:

Figure 15.2 – Output at memory location 850A

53

You might also like