SlideShare a Scribd company logo
1 of 39
INTRODUCTION TO 8085
INTEL 8085 is one of the most popular 8-bit microprocessor capable of addressing 64
KB of memory and its architecture is simple. The device has 40 pins, requires +5 V power
supply and can operate with 3MHz single phase clock.
8085 MICROPROCESSOR FUNCTIONAL BLOCK DIAGRAM
Architecture of 8085 Microprocessor
a) General purpose register
It is an 8 bit register i.e. B,C,D,E,H,L. The combination of 8 bit register is known as
register pair, which can hold 16 bit data. The HL pair is used to act as memory pointer is
accessible to program.
b) Accumulator
It is an 8 bit register which hold one of the data to be processed by ALU and stored
the result of the operation.
c) Program counter (PC)
It is a 16 bit pointer which maintain the address of a byte entered to line stack.
d) Stack pointer (Sp)
It is a 16 bit special purpose register which is used to hold line memory address for
line next instruction to be executed.
e) Arithmetic and logical unit
It carries out arithmetic and logical operation by 8 bit address it uses the accumulator
content as input the ALU result is stored back into accumulator.
f) Temporary register
It is an 8 bit register associated with ALU hold data, entering an operation, used by
the microprocessor and not accessible to programs.
g) Flags
Flag register is a group of fire, individual flip flops line content of line flag register
will change after execution of arithmetic and logic operation. The line states flags are
i) Carry flag (C)
ii) Parity flag (P)
iii) Zero flag (Z)
iv) Auxiliary carry flag (AC)
v) Sign flag (S)
Carry flag:
If an arithmetic operation results in a carry, the carry flag is set. The carry flag also
serves as a borrow flag for subtraction.
Parity flag:
After arithmetic – logic operation, if the result has an even number of 1’s the flag is
set. If it has odd number of 1’s it is reset.
Zero flag:
The zero flag is set if the ALU operation results in zero. This flag is modified by the
result in the accumulator as well as in other registers.
Auxiliary carry flag:
In an arithmetic operation when a carry is generated by digit D3 and passed on to D4,
the auxiliary flag is set.
Sign flag:
After the execution of the arithmetic - logic operation if the bit D7 of the result is 1,
the sign flag is set. This flag is used with signed numbers. If it is 1, it is a negative number
and if it is 0, it is a positive number.
h) Timing and control unit
Synchronous all microprocessor, operation with the clock and generator and control
signal from it necessary to communicate between controller and peripherals.
i) Instruction register and decoder
Instruction is fetched from line memory and stored in line instruction register decoder
the stored information.
j) Register Array
These are used to store 8 bit data during execution of some instruction.
PIN Description
Address Bus
1. The pins Ao – A15 denote the address bus.
2. They are used for most significant bit
Address / Data Bus
1. AD0 – AD7 constitutes the address / Data bus
2. These pins are used for least significant bit
ALE (Address Latch Enable)
1. The signal goes high during the first clock cycle and enables the lower order
address bits.
IO / M
1. This distinguishes whether the address is for memory or input.
2. When this pins go high, the address is for an I/O device.
S0 – S1
S0 and S1 are status signal which provides different status and functions.
RD
1. This is an active low signal
2. This signal is used to control READ operation of the microprocessor.
WR
1. WR is also an active low signal
2. Controls the write operation of the microprocessor.
HOLD
1. This indicates if any other device is requesting the use of address and data bus.
2. It indicates whether the hold signal is received or not.
HLDA
1. HLDA is the acknowledgement signal for HOLD
2. It indicates whether the hold signal is received or not.
INTR
1. INTE is an interrupt request signal
2. IT can be enabled or disabled by using software
INTA
1. Whenever the microprocessor receives interrupt signal
2. It has to be acknowledged.
RST 5.5, 6.5, 7.5
1. These are nothing but the restart interrupts
2. They insert an internal restart junction automatically.
8 BIT ADDITION
AIM:
To write a assembly language program for Addition two (8) bit numbers by
using-8085 micro processor kit.
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. keyboard
ALGORITHM (ADDITION)
Step1 : Start the microprocessor
Step2 : Initialize the carry as ‘Zero’
Step3 : Load the first 8 bit data into the accumulator
Step4 : Copy the contents of accumulator into the register ‘B’
Step5 : Load the second 8 bit data into the accumulator.
Step6 : Add the 2 - 8 bit datas and check for carry.
Step7 : Jump on if no carry
Step8 : Increment carry if there is
Step9 : Store the added request in accumulator
Step10 : More the carry value to accumulator
Step11 : Store the carry value in accumulator
Step12 : Stop the program execution.
Flow chart
NO
YES
Intialise the carry as zero
Load the 1st
8 bit number
Transfer the 1st
number to register ‘B’
Load the 2nd
8 bit number
Transfer and Add the contents of A and B
Increment carry by one
Store the added value in accumulator
Store the value of carry in accumulator
Move the contents of carry into accumulator
END
Check for
carry
START
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI C,00 0E,00 Clear the content of C Register.
4102 LDA 4300 3A,00,43
Load the content of the
accumulator in 4300
4105 MOV B, A 47
Move the content from
accumulator to B register
4106 LDA 4301 3A,01,43
Load the content of the
accumulator in 4301
4109 ADD B 80
Add the content from accumulator
to B register
410A JNC 410E ( LOOP 1) D2,0E,41
Jump on no carry to the label
(LOOP 1)
410D INR C 0C Increment the C register content
410E LOOP 1 STA 4302 32,02,43
Store the sum at accumulator at in
location 4300
4111 MOV A,C 79
Move the carry content from C
Register to accumulator
4112 STA 4303 32,03,43
Store carry content in
accumulator at the location 4303
4115 HLT 76 End the program
Input
Without carry
Input Address Value
4300 04
4301 02
Output
Output Address Value
4302 06
4303 00 (carry)
With carry
Input Address Value
4300 FF
4301 FF
Output Address Value
Output 4302 FE
4303 01 (carry)
Calculation 1111 1111 0000 0100
1111 1111 0000 0010
---------------
(1) 1111 1110 0000 0110
=========
F E
8 BIT SUBTRACTION
Aim:
To write a assembly language program for subtracting two (8) bit numbers by using-
8085 micro processor kit.
Apparatus required:
1. 8085 microprocessor kit
2. Keyboard
ALGORITHM
Step1 : Start the microprocessor
Step2 : Intialize the carry as ‘Zero’
Step3 : Load the first 8 bit data into the accumulator
Step4 : Copy the contents of accumulator into the register ‘B’
Step5 : Load the second 8 bit data into the accumulator.
Step6 : Add the 2 - 8 bit datas and check for carry.
Step7 : Jump on if no carry
Step8 : Increment carry if there is
Step9 : Store the added request in accumulator
Step10 : More the carry value to accumulator
Step11 : Store the carry value in accumulator
Step12 : Stop the program execution.
Flow chart
NO
YES
Intialise the carry as zero
Load the 1st
8 bit number
Transfer the 1st
number to register ‘B’
Load the 2nd
8 bit number
Subtract the two values
Increment carry by one
1’s compliment of 2nd
value
Add 1 to 1’s compliment for 2’s compliment
END
Check for
carry
START
Store the value of result in accumulator
Move the carry into the accumulator
Store the value of carry in accumulator
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI C,00 0E,00 Clear the content of C Register.
4102 LDA 4300 3A,00,43
Load the content of the accumulator in
4300
4105 MOV B, A 47
Move the content from accumulator to
B register
4106 LDA 4301 3A,01,43
Load the content of the accumulator in
4301
4109 SUB B 90
Sub the content from accumulator to B
register
410A JNC 410E ( LOOP 1) D2,0E,41 Jump on no carry to the label (LOOP 1)
410D INR C 0C Increment the C register content
410E LOOP 1 STA 4302 32,02,43
Store the content of accumulator at in
location 4302
4111 MOV A,C 79
Move the carry content from C Register
to accumulator
4112 STA 4303 32,03,43
Store carry content in accumulator at
the location 4303
4115 HLT 76 End the program
Input
Without borrow
Input Address Value
4300 05
4301 07
Output
Output Address Value
4302 02
4303 00 (borrow)
With carry borrow
Input Address Value
4300 07
4301 05
Output Address Value
4302 02
4303 01 (borrow)
Calculation 05 – 07
07 – 0111
1000
0001
------
1001
05 - 0101
------
1110 (-2)
ADDITION OF TWO 16 – BIT NUMBERS
AIM:
To write an assembly language program for adding two 16 bit numbers using 8085
micro processor kit.
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. Key board
ALGORITHM (ADDITION):
Step1 : Get the 1st
8 bit in ‘C’ register (LSB) and 2nd
8 bit in ‘H’
Register (MSB) of 16 bit number.
Step2 : Save the 1st
16 bit in ‘DE’ register pair
Step3 : Similarly get the 2nd
16 bit number and store it in ‘HL’ register
Pair.
Step3 : Get the lower byte of 1st
number into ‘L’ register
Step4 : Add it with lower byte of 2nd
number
Step5 : tore the result in ‘L’ register
Step6 : Get the higher byte of 1st
number into accumulator
Step7 : Add it with higher byte of 2nd
number and carry of the lower bit
Addition.
Step8 : Store the result in ‘H’ register
Step9 : Store 16 bit addition value in ‘HL’ register pair
Step10 : Stop program execution
Flow chart
NO
YES
C = 00H
Load ‘HL’ with 1st
Data
Transfer HL - DE
Load ‘HL’ with 2nd
Data
DE + HL = HL
C = C + 01
Store ‘HL’ in memory (SUM)
Transfer C - A
END
Check for
carry
START
Store ‘A’ in memory (Cy)
Address Label Mnemonics Hex Code Comments
4500 MVI C,00 0E C = 00H
4501 00
4502 LHLD 4800 2A HL – 1st
No.
4503 00
4504 48
4505 XCHG EB HL – DE
4506 LHLD 4802 2A HL – 2nd
No.
4507 02
4508 48
4509 DAD D 19 Double addition DE +
HL
450A JNC Ahead D2 If Cy = 0, G0 to 450E
450E
450B 0E
450C 45
450D INR C 0C C = C + 01
450E AHEAD SHLD 4804 22 HL – 4804 (sum)
450F 04
4510 48
4511 MOV C,A 79 Cy – A
4512 STA 4806 32 Cy – 4806
4513 06
4514 48
4515 HLT 76 Stop execution
Input
without carry
Input Address Value
4800 01 (addend)
4801 04
4802 02 (augend)
4803 03 (augend)
Output
Output Address Value
4804 03 (sum)
4805 07 (sum)
4806 00 (carry)
Calculation 0000 0100 0000 0001
0000 0011 0000 0010
---------------------------------
0000 0111 0000 0011
0 7 0 3
With carry
Input Address Value
4800 FF (addend)
4801 DE (addend)
4802 96 (augend)
4803 DF (augend)
Output Address Value
4804 95 (sum)
4805 BE (sum)
4806 01 (carry)
Calculation
1101 1110 1111 1111
1101 1111 1001 0101
---------------------------------
1011 1110 1001 0101
B E 9 5
SUBTRACTION OF TWO 16 – BIT NUMBERS
Aim:
To write an assembly language program for subtracting two 16 bit numbers using
8085 microprocessor kit.
Apparatus required:
1. 8085 microprocessor kit
2. Keyboard
ALGORITHM
Step1 : Start the microprocessor
Step2 : Get the 1st
16 bit in ‘HL’ register pair
Step3 : Save the 1st
16 bit in ‘DE’ register pair
Step4 : Get the 2nd
16 bit number in ‘HL’ register pair
Step5 : Get the lower byte of 1st
number
Step6 : Get the subtracted value of 2nd
number of lower byte by
subtracting it with lower byte of 1st
number
Step7 : Store the result in ‘L’ register
Step8 : Get the higher byte of 2nd
number
Step9 : Subtract the higher byte of 1st
number from 2nd
number with
borrow
Step10 : Store the result in ‘HL’ register
Step11 : Stop the program execution
Flow chart
C = 00H
Load ‘HL’ with 1st
Data
Transfer HL - DE
Load ‘HL’ with 2nd
Data
Transfer E – A (LSB)
END
START
A = A – L (LSB)
Store ‘A’ in memory (LSB)
Transfer D – A (MSB)
A – A – H – Borrow (MSB)
Store ‘A’ in memory (MSB)
PROGRAM:
Address Label Mnemonics Hex Code Comments
4500 MVI C,00 0E C = 00H
4501 00
4502 LHLD 4800 2A L – 1st
No.
4503 00
4504 48
4505 XLHG EB HL – DE
4506 LHLD 4802 2A HL – 2nd
No.
4507 02
4508 48
4509 MOV A,E 7B LSB of ‘1’ to ‘A’
450A SUB L 95 A – A – L
450B STA 4804 32 A – memory
450C 04
450D 48
450E MOV A,D 7A MSB of 1 to A
450F SBB H 9C A- A – H
4510 STA 4805 32 A – memory
4511 05
4512 48
4513 HLT 76 Stop execution
Input
Without borrow
Input Address Value
4800 07
4801 08
4802 05
4803 06
Output
Output Address Value
4804 02
4805 02
4807 00
Output
With borrow
Input Address Value
4800 07
4801 08
4802 05
4803 06
Output
Output Address Value
4804 02
4805 02
4807 00
Calculation
05 06 - 07 08
05 06 0101 0110 07 08 0111 1000
1010 1001 1000 0111
0000 0001 0000 0001
--------------- --------------
1010 1010 1000 1000
05 06 + 07 08
1010 1010
1000 1000
---------------
(1) 0010 0010
02 02
8 BIT MULTIPLICATION & DIVISION
AIM:
To perform 8085 assembly language program for 8 bit multiplication .
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. keyboard
ALGORITHM (MULTIPLICATION):
Algorithm:
Step1 : Start the microprocessor
Step2 : Get the 1st
8 bit numbers
Step3 : Move the 1st
8it number to register ‘B’
Step4 : Get the 2nd
8 bit number
Step5 : Move the 2nd
8 bit number to register ‘C’
Step6 : Intialise the accumulator as zero
Step7 : Intialise the carry as zero
Step8 : Add both register ‘B’ value as accumulator
Step9 : Jump on if no carry
Step10 : Increment carry by 1 if there is
Step11 : Decrement the 2nd
value and repeat from step 8, till the 2nd
value becomes zero.
Step12 : Store the multiplied value in accumulator
Step13 : Move the carry value to accumulator
Step14 : Store the carry value in accumulator
Flowchart
NO
YES
No
YES
Get the 1st
8 bit number
Move it to register ‘B’
Get the 2nd
8 bit number
Intialize the accumulator as zero & carry as zero
Add the accumulator with 1st
number
Increment carry
Decrement 2nd
number
Store the value f carry in accumulator
END
Check for
carry
start
2nd
Number
PROGRAM:
Address Label Mnemonics Hex Code Comments
4100 LDA 4500 3A, 00, 45 Load the first 8 bit number
4103 MOV B,A 47 Move the 1st
8 bit data to
register ‘B’
4104 LDA 4501 3A, 01, 45 Load the 2nd
16 it number
4107 MOV C,A 4F Move the 2nd
8 bit data to
register ‘C’
4108 MVI A, 00 3E, 00 Intialise the accumulator as
zero
410A MVI D, 00 16, 00 Intialise the carry as zero
410C ADD B 80 Add the contents of ‘B’ and
accumulator
410D INC D2 11, 41 Jump if no carry
4110 INR D 14 Increment carry if there is
4111 DCR C OD Decrement the value ‘C’
4112 JNZ C2 0C, 41 Jump if number zero
4115 STA 4502 32 02, 45 Store the result in
accumulator
4118 MOV A,D 7A Move the carry into
accumulator
4119 STA 4503 32,03,45 Store the result in
accumulator
411C HLT 76 Stop the program execution
Input
Input Address Value
4500 04
4501 02
Output
Output Address Value
4502 08
4503 00
DIVISION OF TWO 8 – BIT NUMBERS
Aim:
To write an assembly language program for dividing two 8 bit numbers using
microprocessor kit.
Apparatus required:
8085 microprocessor kit
Key board
Algorithm:
Step1 : Start the microprocessor
Step2 : Intialise the Quotient as zero
Step3 : Load the 1st
8 bit data
Step4 : Copy the contents of accumulator into register ‘B’
Step5 : Load the 2nd
8 bit data
Step6 : Compare both the values
Step7 : Jump if divisor is greater than dividend
Step8 : Subtract the dividend value by divisor value
Step9 : Increment Quotient
Step10 : Jump to step 7, till the dividend becomes zero
Step11 : Store the result (Quotient) value in accumulator
Step12 : Move the remainder value to accumulator
Step13 : Store the result in accumulator
Step14 : Stop the program execution
Flow chart
NO
YES
YES
START
Get the divided
Intialise the Quotient as zero
Get the divisor
Compare the dividend & divisor
Add the accumulator with 1st
number
Check for
carry
Increment carry
Decrement 2nd
number
Dividend
Move the remainder to accumulator
Store the Quotient in accumulator
END
Store the remainder in accumulator
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI B,00 0E,00 Clear the content of B Register.
4102 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair.
4105 MOV A,M 7E
Move the content of memory location
to A Register.
4106 INX H 23 Increment memory location.
4107 LOOP 1 SUB M 96
Subtract the content of memory
location with accumulator.
4108 INR B 04 Increment the B register.
4109 JNC 4107 (LOOP 1) D2,07,41 If carry = 0, jump to address 4107.
410C DCR B 05 Decrement the B register.
410D ADD M 86
Add the content of memory location
with accumulator.
411E STA 4301 32,01,43 Store the remainder in address 4301.
4111 MOV A,B 78
Move the B Register content to the
accumulator.
4112 STA 4302 32,02,43 Store the quotient in address 4302.
4115 HLT 76 End the program
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 4300
4201 4301
RESULT:
Thus the ALP for 8 bit multiplication and division were performed and output was
verified
EXPT .NO:
BLOCK TRANSFER OPERATION
AIM:
To perform a forward block transfer and reverse block transfer operation using 8085
microprocessor.
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. keyboard
ALGORITHM (Forward block transfer):
1. Initialize the source address in HL register pair.
2. Initialize the destination address in DE register pair
3. Move the memory content pointed by HL pair to accumulator.
4. Move accumulator content to memory location pointed by storing DE register.
5. Increment the HL pair
6. Increment the DE registers pair
7. Decrement C register
8. If there is no zero jump to step 4
9. Stop the Program.
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI C,05 0E,05
Clear the content of C registers.(Count
5)
4102 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair
4105 LXID 4300 21,00,43
The content of data 4300 transfer to DE
pair
4108
LOOP 1
MOV A,M 7E
Move the content of memory to
accumulator
4109 STAX D 12
Store the accumulator content at D
register.
410A INX H 23 Increment the H register
410B INX D 13 Increment the D register
410C DCR C 0D Decrement the C register
410D JNZ 4108 (LOOP 1) C2,08,41 If carry = 0, jump to address 4108.
4110 HLT 76 End the program
Flow chart
No
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 4300
4201 4301
4202 4302
4203 4303
4204 4304
Clear the content of C registers. (Count value)
Load the content to H reg
Load the content to D reg
Store the Accumulator content D register
INR H Reg
END
Check for
carry
START
INX D Reg
Move the content of memory to accumulator
ALGORITHM (Reverse transfer):
1. Initialize the source address in HL register pair.
2. Initialize the destination address in DE register pair
3. Move the memory content pointed by HL pair to C register
4. Move the content of C register to E register
5. Increment the HL pair
6. Move the content of memory to accumulator
7. Store the accumulator content at D register
8. Decrement the D register
9. Decrement the C register
10. If carry = 0, jump to address 4107
11. End the program
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair
4103 LXID 4300 21,00,43
The content of data 4200 transfer to DE
pair
4106 MOV C,M 4E
Move the content of memory to C
register
4107 LOOP 1 MOV E,C 59
Move the content of C register to E
register.
4108 INX H 23 Increment the H register
4109 MOV A,M 7E
Move the content of memory to
accumulator
410A STAX D 12
Store the accumulator content at D
register.
410B DCX D 1B Decrement the D register
410C DCR C 0D Decrement the C register
410D JNZ 4107 (LOOP 1) C2,07,41 If carry = 0, jump to address 4107.
4110 HLT 76 End the program
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 (Count 4) 4300
4201 4301
4202 4302
4203 4303
4204
Flow Chart
No
RESULT:
Thus the forward block transfer and reverse block transfer operation were performed and
output was verified.
Load the content to HL Pair (Count value)
Transfer content HL to DE Pair
Transfer the content of C register to E register.
INR H Reg
END
Check for
carry
START
DCR C Reg
Transfer the content of memory to C Reg
Transfer the content of memory to accumulator
Store the accumulator content at D register.
DCX D Reg
EXPT .NO:
ARRAY OPERATION
AIM:
To perform a smallest and largest of numbers using 8085 microprocessor.
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. Keyboard
ALGORITHM (LARGEST NUMBER):
1. Place all the elements of an array in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content (next
Element).
7. If the accumulator content is smaller, then move the memory content
(Largest element) to the accumulator. Else continue.
8. Decrement the counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI C,00 0E,00 Clear the content of C Register
4102 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair
4105 MOV C,M 4E
Move the content of memory to C
register
4106 INX H 23 Increment the H register
4107 MOV A,M 7E
Move the content of memory to
accumulator
4108 DCR C 0D Decrement the C register
4109 LOOP 1 INX H 23 Increment the C register
410A CMP M BE
Compare the content of memory with
accumulator
410B JNC 410F (Loop 2) D2,0F,41 If carry = 0, jump to address 410F
410E MOV A,M 7E
Move the content of memory to
accumulator
410F Loop 2 DCR C 0D Decrement the C register
4110 JNZ 4109 (LOOP 1) C2,09,41 If carry = 0, jump to address 4109
4113 STA 4300 32,00,43
Store the largest number in the
memory location
4116 HLT 76 End the program.
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 03 (Count) 4300
4201
4202
4203
ALGORITHM (SMALLEST NUMBER):
1. Place all the elements of an array in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content (next
Element).
7. If the accumulator content is smaller, then move the memory content
(Largest element) to the accumulator. Else continue.
8. The counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI C,00 0E,00 Clear the content of C Register.
4102 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair
4105 MOV C,M 4E
Move the content of memory to C
register
4106 INX H 23 Increment the H register
4107 MOV A,M 7E
Move the content of memory to
accumulator
4108 DCR C 0D Decrement the C register
4109 LOOP 1 INX H 23 Increment the C register
410A CMP M BE
Compare the content of memory with
accumulator
410B JC 410F (Loop 2) DA,0F,41 If carry = 1, jump to address 410F
410E MOV A,M 7E
Move the content of memory to
accumulator
410F LOOP 2 DCR C 0D Decrement the C register
4110 JNZ 4109 (LOOP 1) C2,09,41 If carry = 0, jump to address 4109
4113 STA 4300 32,00,43
Store the Smallest number in the
memory location
4116 HLT 76 End the program
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 03(Count) 4300
4201
4202
4203
RESULT:
Thus the largest and smallest number operation were performed and output was verified.
EXPT .NO:
SORTING
AIM:
To perform a ascending and descending order of using 8085 microprocessor.
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. Keyboard
ALGORITHM (ascending order):
1. Get the numbers to be sorted from the memory locations.
2. Compare the first two numbers and if the first number is larger than second then
Interchange the number.
3. If the first number is smaller, go to step 4
4. Repeat steps 2 and 3 until the numbers are in required order
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair
4103 MOV B,M 46
Move the content of memory to B
register
4104 DCR B 05 Decrement the B register
4105 LOOP 1 MOV C,B 48
Move the content of B register to C
register.
4106 LXIH 4201 21,01,42
The content of data 4201 transfer to HL
pair
4109 LOOP 2 MOV A,M 7E
Move the content of memory to
accumulator
410A INX H 23 Increment the H register
410B MOV D,M 56
Move the content of memory to D
register
410C CMP D BA
Compare the content of D register with
accumulator
410D JC 4114 (LOOP 3) DA,14,41 If carry = 1, jump to address 4114
4110 MOV M,A 77
Move the content of memory to
accumulator
4111 DCX H 2B Decrement the H register
4112 MOV M,D 72
Move the content of D register to
memory
4113 INX H 23 Increment the H register
4114 LOOP 3 DCR C 0D Decrement the C register
4115 JNZ 4109 (LOOP 2) C2,09,41 If zero flag = 0, jump to address 4109
4118 DCR B 05 Decrement the B register
4119 JNZ 4105 (LOOP 1) C2,05,41 If zero flag = 0, jump to address 4105
411C HLT 76 End the program
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 (Count 05) 4201
4201 4202
4202 4203
4203 4204
4204 4205
4205
ALGORITHM (Descending order):
1. Get the numbers to be sorted from the memory locations.
2. Compare the first two numbers and if the first number is smaller than second then I
Interchange the number.
3. If the first number is larger, go to step 4
4. Repeat steps 2 and 3 until the numbers are in required order
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 LXIH 4200 21,00,42
The content of data 4200 transfer to HL
pair
4103 MOV B,M 46
Move the content of memory to B
register
4104 DCR B 05 Decrement the B register
4105 LOOP 1 MOV C,B 48
Move the content of B register to C
register.
4106 LXIH 4201 21,01,42
The content of data 4201 transfer to HL
pair
4109 LOOP 2 MOV A,M 7E
Move the content of memory to
accumulator
410A INX H 23 Increment the H register
410B MOV D,M 56
Move the content of memory to D
register
410C CMP D BA
Compare the content of D register with
accumulator
410D JNC 4114 (LOOP 3) DA,14,41 If carry = 0, jump to address 4114
4110 MOV M,A 77
Move the content of memory to
accumulator
4111 DCX H 2B Decrement the H register
4112 MOV M,D 72
Move the content of D register to
memory
4113 INX H 23 Increment the H register
4114 LOOP 3 DCR C 0D Decrement the C register
4115 JNZ 4109 (LOOP 2) C2,09,41 If zero flag = 0, jump to address 4109
4118 DCR B 05 Decrement the B register
4119 JNZ 4105 (LOOP 1) C2,05,41 If zero flag = 0, jump to address 4105
411C HLT 76 End the program
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 (Count 05) 4201
4201 4202
4202 4203
4203 4204
4204 4205
4205
RESULT:
Thus the Ascending and Descending operation were performed and output was verified.
EXPT .NO:
CODECONVERSION
AIM:
To perform a code conversion for Following
1.HEXA DECIMAL TO ASCII
2.ASCII TO HEXA DECIMAL
3
APPARATUS REQUIRED:
1. 8085 microprocessor kit
2. Keyboard
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
4100 MVI C,00 0E,00 Clear the content of C Register.
4102 LHLD 4200 2A,00,42
Load the augend in DE pair through HL
pair
4105 XCHG EB
Transfer the content of HL pair to DE
pair
4106 LHLD 4202 2A,02,42 Load the addend in HL pair
4109 MOV A,E 7B
Move the content of E register to A
register
410A SUB L 95
Subtract the content of L register with
accumulator
410B STA 4204 32,04,42 Store the LSB in address location 4204
410E MOV A,D 7A
Move the Content of D register to
register A
410F SBB H 9C
Subtract the content of H register and
carry flag with accumulator
4110 STA 4205 32,05,42 Store the MSB in address location 4205
4113 JNC 4117 ( LOOP 1) D2,17,41 If there is no carry go to label (LOOP 1)
4116 INR C 0C Increment the C register
4117 LOOP 1 MOV A,C 79
Move the content of C Register to A
register
4118 STA 4206 32,06,42
Store the carry in 4206 through
accumulator ( MSB of sum )
411B HLT 76 End the program
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)

More Related Content

What's hot

Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 Microprocessor
Nikhil Kumar
 

What's hot (20)

Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Logical and shift micro operations
Logical and shift micro operationsLogical and shift micro operations
Logical and shift micro operations
 
Code Conversion in 8085 Microprocessor
Code Conversion in 8085 MicroprocessorCode Conversion in 8085 Microprocessor
Code Conversion in 8085 Microprocessor
 
Interrupts of microprocessor 8085
Interrupts of microprocessor  8085Interrupts of microprocessor  8085
Interrupts of microprocessor 8085
 
8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
80386 microprocessor
80386 microprocessor80386 microprocessor
80386 microprocessor
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
 
Introduction to 80386
Introduction to 80386Introduction to 80386
Introduction to 80386
 
Direct memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerDirect memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA Controller
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 Microprocessor
 
Hamming code system
Hamming code systemHamming code system
Hamming code system
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
COMPUTER ORGANIZATION NOTES Unit 7
COMPUTER ORGANIZATION NOTES Unit 7COMPUTER ORGANIZATION NOTES Unit 7
COMPUTER ORGANIZATION NOTES Unit 7
 
Datapath design
Datapath designDatapath design
Datapath design
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
 

Viewers also liked

MICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMSMICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMS
Sabin Gautam
 
Chuyen de ptlgiac
Chuyen de ptlgiacChuyen de ptlgiac
Chuyen de ptlgiac
MrNgo Ngo
 
Washing machine
Washing  machineWashing  machine
Washing machine
Eng Eng
 
An efficient vertical handoff mechanism for future mobile network
An efficient vertical handoff mechanism for  future mobile networkAn efficient vertical handoff mechanism for  future mobile network
An efficient vertical handoff mechanism for future mobile network
Basil John
 

Viewers also liked (20)

MICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMSMICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMS
 
Chuyen de ptlgiac
Chuyen de ptlgiacChuyen de ptlgiac
Chuyen de ptlgiac
 
Biomasa
BiomasaBiomasa
Biomasa
 
9.references
9.references9.references
9.references
 
Handoff survey
Handoff surveyHandoff survey
Handoff survey
 
Wi max
Wi maxWi max
Wi max
 
Washing machine
Washing  machineWashing  machine
Washing machine
 
LEGAL LEASE DOCUMENT
LEGAL LEASE DOCUMENT LEGAL LEASE DOCUMENT
LEGAL LEASE DOCUMENT
 
BIZITZAREN HISTORIA ZURE GORPUTZA SM-IKASMINA SAN MARTIN ESKOLAN EGOKITUA
BIZITZAREN  HISTORIA ZURE  GORPUTZA SM-IKASMINA  SAN MARTIN  ESKOLAN EGOKITUABIZITZAREN  HISTORIA ZURE  GORPUTZA SM-IKASMINA  SAN MARTIN  ESKOLAN EGOKITUA
BIZITZAREN HISTORIA ZURE GORPUTZA SM-IKASMINA SAN MARTIN ESKOLAN EGOKITUA
 
An efficient vertical handoff mechanism for future mobile network
An efficient vertical handoff mechanism for  future mobile networkAn efficient vertical handoff mechanism for  future mobile network
An efficient vertical handoff mechanism for future mobile network
 
Networks lab manual ecp62
Networks lab manual ecp62Networks lab manual ecp62
Networks lab manual ecp62
 
3.table of contents
3.table of contents3.table of contents
3.table of contents
 
Persona global newsletter issue iv
Persona global newsletter issue ivPersona global newsletter issue iv
Persona global newsletter issue iv
 
Class7
Class7Class7
Class7
 
Biderketa taulak
Biderketa taulakBiderketa taulak
Biderketa taulak
 
Hrm1
Hrm1Hrm1
Hrm1
 
Leaders as learning facilitators: learnscapes, prerequisites & field of action
Leaders as learning facilitators: learnscapes, prerequisites & field of actionLeaders as learning facilitators: learnscapes, prerequisites & field of action
Leaders as learning facilitators: learnscapes, prerequisites & field of action
 
Urdaneta comic
Urdaneta comicUrdaneta comic
Urdaneta comic
 
Fuzzy logic - copy
Fuzzy logic - copyFuzzy logic - copy
Fuzzy logic - copy
 
Ni ... naiz 1. maila
Ni  ...  naiz  1. mailaNi  ...  naiz  1. maila
Ni ... naiz 1. maila
 

Similar to Introduction to 8085 & it's description(includes basic lab experiments)

Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
vijaydeepakg
 
8085 microprocessor(1)
8085 microprocessor(1)8085 microprocessor(1)
8085 microprocessor(1)
Reevu Pal
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Swati Watve-Phadke
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085
RAHULNOUGHTY
 

Similar to Introduction to 8085 & it's description(includes basic lab experiments) (20)

Mpi lab manual eee
Mpi lab manual eeeMpi lab manual eee
Mpi lab manual eee
 
Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
 
EE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab ManuelEE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab Manuel
 
8085 microprocessor(1)
8085 microprocessor(1)8085 microprocessor(1)
8085 microprocessor(1)
 
Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310
 
Micro Processor Lab Manual!
Micro Processor Lab Manual!Micro Processor Lab Manual!
Micro Processor Lab Manual!
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310
 
Lab manual mp
Lab manual mpLab manual mp
Lab manual mp
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
 
8085_LAB_PROGRAMS.pdf
8085_LAB_PROGRAMS.pdf8085_LAB_PROGRAMS.pdf
8085_LAB_PROGRAMS.pdf
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
 
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. Kaware
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
180410227 ae2406-lab-manual-doc
180410227 ae2406-lab-manual-doc180410227 ae2406-lab-manual-doc
180410227 ae2406-lab-manual-doc
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 

More from Basil John

An advanced handoff algoritm in mobile communication network using fuzzy deci...
An advanced handoff algoritm in mobile communication network using fuzzy deci...An advanced handoff algoritm in mobile communication network using fuzzy deci...
An advanced handoff algoritm in mobile communication network using fuzzy deci...
Basil John
 

More from Basil John (20)

Mm case 2 ref
Mm case 2 refMm case 2 ref
Mm case 2 ref
 
Class 5 ipr trips - trims
Class 5 ipr trips - trimsClass 5 ipr trips - trims
Class 5 ipr trips - trims
 
Business Law
Business LawBusiness Law
Business Law
 
Basil john mm field assignment jan2016
Basil john mm field assignment jan2016Basil john mm field assignment jan2016
Basil john mm field assignment jan2016
 
Overcoming communication Barriers
Overcoming communication BarriersOvercoming communication Barriers
Overcoming communication Barriers
 
Luxottica
LuxotticaLuxottica
Luxottica
 
AADHAR Card- Database Creation
AADHAR Card- Database CreationAADHAR Card- Database Creation
AADHAR Card- Database Creation
 
Walmart f500
Walmart f500Walmart f500
Walmart f500
 
Umts
UmtsUmts
Umts
 
Interworking of wi_max_and_3gpp_networks_-slides
Interworking of wi_max_and_3gpp_networks_-slidesInterworking of wi_max_and_3gpp_networks_-slides
Interworking of wi_max_and_3gpp_networks_-slides
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Wcdma systems 003
Wcdma systems 003Wcdma systems 003
Wcdma systems 003
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
An advanced handoff algoritm in mobile communication network using fuzzy deci...
An advanced handoff algoritm in mobile communication network using fuzzy deci...An advanced handoff algoritm in mobile communication network using fuzzy deci...
An advanced handoff algoritm in mobile communication network using fuzzy deci...
 
Neural networks
Neural networksNeural networks
Neural networks
 
An efficient vertical handoff mechanism
An efficient vertical handoff mechanismAn efficient vertical handoff mechanism
An efficient vertical handoff mechanism
 
1. front page
1. front page1. front page
1. front page
 
8.conclusion
8.conclusion8.conclusion
8.conclusion
 
4. list of figures
4. list of figures4. list of figures
4. list of figures
 
2.acknowledgement
2.acknowledgement2.acknowledgement
2.acknowledgement
 

Recently uploaded

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 

Introduction to 8085 & it's description(includes basic lab experiments)

  • 1. INTRODUCTION TO 8085 INTEL 8085 is one of the most popular 8-bit microprocessor capable of addressing 64 KB of memory and its architecture is simple. The device has 40 pins, requires +5 V power supply and can operate with 3MHz single phase clock. 8085 MICROPROCESSOR FUNCTIONAL BLOCK DIAGRAM Architecture of 8085 Microprocessor a) General purpose register It is an 8 bit register i.e. B,C,D,E,H,L. The combination of 8 bit register is known as register pair, which can hold 16 bit data. The HL pair is used to act as memory pointer is accessible to program. b) Accumulator It is an 8 bit register which hold one of the data to be processed by ALU and stored the result of the operation. c) Program counter (PC) It is a 16 bit pointer which maintain the address of a byte entered to line stack. d) Stack pointer (Sp) It is a 16 bit special purpose register which is used to hold line memory address for line next instruction to be executed. e) Arithmetic and logical unit It carries out arithmetic and logical operation by 8 bit address it uses the accumulator content as input the ALU result is stored back into accumulator.
  • 2. f) Temporary register It is an 8 bit register associated with ALU hold data, entering an operation, used by the microprocessor and not accessible to programs. g) Flags Flag register is a group of fire, individual flip flops line content of line flag register will change after execution of arithmetic and logic operation. The line states flags are i) Carry flag (C) ii) Parity flag (P) iii) Zero flag (Z) iv) Auxiliary carry flag (AC) v) Sign flag (S) Carry flag: If an arithmetic operation results in a carry, the carry flag is set. The carry flag also serves as a borrow flag for subtraction. Parity flag: After arithmetic – logic operation, if the result has an even number of 1’s the flag is set. If it has odd number of 1’s it is reset. Zero flag: The zero flag is set if the ALU operation results in zero. This flag is modified by the result in the accumulator as well as in other registers. Auxiliary carry flag: In an arithmetic operation when a carry is generated by digit D3 and passed on to D4, the auxiliary flag is set. Sign flag: After the execution of the arithmetic - logic operation if the bit D7 of the result is 1, the sign flag is set. This flag is used with signed numbers. If it is 1, it is a negative number and if it is 0, it is a positive number. h) Timing and control unit Synchronous all microprocessor, operation with the clock and generator and control signal from it necessary to communicate between controller and peripherals. i) Instruction register and decoder Instruction is fetched from line memory and stored in line instruction register decoder the stored information. j) Register Array These are used to store 8 bit data during execution of some instruction. PIN Description Address Bus 1. The pins Ao – A15 denote the address bus. 2. They are used for most significant bit Address / Data Bus 1. AD0 – AD7 constitutes the address / Data bus 2. These pins are used for least significant bit
  • 3. ALE (Address Latch Enable) 1. The signal goes high during the first clock cycle and enables the lower order address bits. IO / M 1. This distinguishes whether the address is for memory or input. 2. When this pins go high, the address is for an I/O device. S0 – S1 S0 and S1 are status signal which provides different status and functions. RD 1. This is an active low signal 2. This signal is used to control READ operation of the microprocessor. WR 1. WR is also an active low signal 2. Controls the write operation of the microprocessor. HOLD 1. This indicates if any other device is requesting the use of address and data bus. 2. It indicates whether the hold signal is received or not. HLDA 1. HLDA is the acknowledgement signal for HOLD 2. It indicates whether the hold signal is received or not. INTR 1. INTE is an interrupt request signal 2. IT can be enabled or disabled by using software INTA 1. Whenever the microprocessor receives interrupt signal 2. It has to be acknowledged. RST 5.5, 6.5, 7.5 1. These are nothing but the restart interrupts 2. They insert an internal restart junction automatically.
  • 4. 8 BIT ADDITION AIM: To write a assembly language program for Addition two (8) bit numbers by using-8085 micro processor kit. APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. keyboard ALGORITHM (ADDITION) Step1 : Start the microprocessor Step2 : Initialize the carry as ‘Zero’ Step3 : Load the first 8 bit data into the accumulator Step4 : Copy the contents of accumulator into the register ‘B’ Step5 : Load the second 8 bit data into the accumulator. Step6 : Add the 2 - 8 bit datas and check for carry. Step7 : Jump on if no carry Step8 : Increment carry if there is Step9 : Store the added request in accumulator Step10 : More the carry value to accumulator Step11 : Store the carry value in accumulator Step12 : Stop the program execution.
  • 5. Flow chart NO YES Intialise the carry as zero Load the 1st 8 bit number Transfer the 1st number to register ‘B’ Load the 2nd 8 bit number Transfer and Add the contents of A and B Increment carry by one Store the added value in accumulator Store the value of carry in accumulator Move the contents of carry into accumulator END Check for carry START
  • 6. PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI C,00 0E,00 Clear the content of C Register. 4102 LDA 4300 3A,00,43 Load the content of the accumulator in 4300 4105 MOV B, A 47 Move the content from accumulator to B register 4106 LDA 4301 3A,01,43 Load the content of the accumulator in 4301 4109 ADD B 80 Add the content from accumulator to B register 410A JNC 410E ( LOOP 1) D2,0E,41 Jump on no carry to the label (LOOP 1) 410D INR C 0C Increment the C register content 410E LOOP 1 STA 4302 32,02,43 Store the sum at accumulator at in location 4300 4111 MOV A,C 79 Move the carry content from C Register to accumulator 4112 STA 4303 32,03,43 Store carry content in accumulator at the location 4303 4115 HLT 76 End the program Input Without carry Input Address Value 4300 04 4301 02 Output Output Address Value 4302 06 4303 00 (carry) With carry Input Address Value 4300 FF 4301 FF Output Address Value Output 4302 FE 4303 01 (carry) Calculation 1111 1111 0000 0100 1111 1111 0000 0010 --------------- (1) 1111 1110 0000 0110 ========= F E
  • 7. 8 BIT SUBTRACTION Aim: To write a assembly language program for subtracting two (8) bit numbers by using- 8085 micro processor kit. Apparatus required: 1. 8085 microprocessor kit 2. Keyboard ALGORITHM Step1 : Start the microprocessor Step2 : Intialize the carry as ‘Zero’ Step3 : Load the first 8 bit data into the accumulator Step4 : Copy the contents of accumulator into the register ‘B’ Step5 : Load the second 8 bit data into the accumulator. Step6 : Add the 2 - 8 bit datas and check for carry. Step7 : Jump on if no carry Step8 : Increment carry if there is Step9 : Store the added request in accumulator Step10 : More the carry value to accumulator Step11 : Store the carry value in accumulator Step12 : Stop the program execution.
  • 8. Flow chart NO YES Intialise the carry as zero Load the 1st 8 bit number Transfer the 1st number to register ‘B’ Load the 2nd 8 bit number Subtract the two values Increment carry by one 1’s compliment of 2nd value Add 1 to 1’s compliment for 2’s compliment END Check for carry START Store the value of result in accumulator Move the carry into the accumulator Store the value of carry in accumulator
  • 9. PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI C,00 0E,00 Clear the content of C Register. 4102 LDA 4300 3A,00,43 Load the content of the accumulator in 4300 4105 MOV B, A 47 Move the content from accumulator to B register 4106 LDA 4301 3A,01,43 Load the content of the accumulator in 4301 4109 SUB B 90 Sub the content from accumulator to B register 410A JNC 410E ( LOOP 1) D2,0E,41 Jump on no carry to the label (LOOP 1) 410D INR C 0C Increment the C register content 410E LOOP 1 STA 4302 32,02,43 Store the content of accumulator at in location 4302 4111 MOV A,C 79 Move the carry content from C Register to accumulator 4112 STA 4303 32,03,43 Store carry content in accumulator at the location 4303 4115 HLT 76 End the program Input Without borrow Input Address Value 4300 05 4301 07 Output Output Address Value 4302 02 4303 00 (borrow) With carry borrow Input Address Value 4300 07 4301 05 Output Address Value 4302 02 4303 01 (borrow) Calculation 05 – 07 07 – 0111 1000 0001 ------ 1001 05 - 0101 ------ 1110 (-2)
  • 10. ADDITION OF TWO 16 – BIT NUMBERS AIM: To write an assembly language program for adding two 16 bit numbers using 8085 micro processor kit. APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. Key board ALGORITHM (ADDITION): Step1 : Get the 1st 8 bit in ‘C’ register (LSB) and 2nd 8 bit in ‘H’ Register (MSB) of 16 bit number. Step2 : Save the 1st 16 bit in ‘DE’ register pair Step3 : Similarly get the 2nd 16 bit number and store it in ‘HL’ register Pair. Step3 : Get the lower byte of 1st number into ‘L’ register Step4 : Add it with lower byte of 2nd number Step5 : tore the result in ‘L’ register Step6 : Get the higher byte of 1st number into accumulator Step7 : Add it with higher byte of 2nd number and carry of the lower bit Addition. Step8 : Store the result in ‘H’ register Step9 : Store 16 bit addition value in ‘HL’ register pair Step10 : Stop program execution
  • 11. Flow chart NO YES C = 00H Load ‘HL’ with 1st Data Transfer HL - DE Load ‘HL’ with 2nd Data DE + HL = HL C = C + 01 Store ‘HL’ in memory (SUM) Transfer C - A END Check for carry START Store ‘A’ in memory (Cy)
  • 12. Address Label Mnemonics Hex Code Comments 4500 MVI C,00 0E C = 00H 4501 00 4502 LHLD 4800 2A HL – 1st No. 4503 00 4504 48 4505 XCHG EB HL – DE 4506 LHLD 4802 2A HL – 2nd No. 4507 02 4508 48 4509 DAD D 19 Double addition DE + HL 450A JNC Ahead D2 If Cy = 0, G0 to 450E 450E 450B 0E 450C 45 450D INR C 0C C = C + 01 450E AHEAD SHLD 4804 22 HL – 4804 (sum) 450F 04 4510 48 4511 MOV C,A 79 Cy – A 4512 STA 4806 32 Cy – 4806 4513 06 4514 48 4515 HLT 76 Stop execution Input without carry Input Address Value 4800 01 (addend) 4801 04 4802 02 (augend) 4803 03 (augend) Output Output Address Value 4804 03 (sum) 4805 07 (sum) 4806 00 (carry) Calculation 0000 0100 0000 0001 0000 0011 0000 0010 --------------------------------- 0000 0111 0000 0011 0 7 0 3
  • 13. With carry Input Address Value 4800 FF (addend) 4801 DE (addend) 4802 96 (augend) 4803 DF (augend) Output Address Value 4804 95 (sum) 4805 BE (sum) 4806 01 (carry) Calculation 1101 1110 1111 1111 1101 1111 1001 0101 --------------------------------- 1011 1110 1001 0101 B E 9 5
  • 14. SUBTRACTION OF TWO 16 – BIT NUMBERS Aim: To write an assembly language program for subtracting two 16 bit numbers using 8085 microprocessor kit. Apparatus required: 1. 8085 microprocessor kit 2. Keyboard ALGORITHM Step1 : Start the microprocessor Step2 : Get the 1st 16 bit in ‘HL’ register pair Step3 : Save the 1st 16 bit in ‘DE’ register pair Step4 : Get the 2nd 16 bit number in ‘HL’ register pair Step5 : Get the lower byte of 1st number Step6 : Get the subtracted value of 2nd number of lower byte by subtracting it with lower byte of 1st number Step7 : Store the result in ‘L’ register Step8 : Get the higher byte of 2nd number Step9 : Subtract the higher byte of 1st number from 2nd number with borrow Step10 : Store the result in ‘HL’ register Step11 : Stop the program execution
  • 15. Flow chart C = 00H Load ‘HL’ with 1st Data Transfer HL - DE Load ‘HL’ with 2nd Data Transfer E – A (LSB) END START A = A – L (LSB) Store ‘A’ in memory (LSB) Transfer D – A (MSB) A – A – H – Borrow (MSB) Store ‘A’ in memory (MSB)
  • 16. PROGRAM: Address Label Mnemonics Hex Code Comments 4500 MVI C,00 0E C = 00H 4501 00 4502 LHLD 4800 2A L – 1st No. 4503 00 4504 48 4505 XLHG EB HL – DE 4506 LHLD 4802 2A HL – 2nd No. 4507 02 4508 48 4509 MOV A,E 7B LSB of ‘1’ to ‘A’ 450A SUB L 95 A – A – L 450B STA 4804 32 A – memory 450C 04 450D 48 450E MOV A,D 7A MSB of 1 to A 450F SBB H 9C A- A – H 4510 STA 4805 32 A – memory 4511 05 4512 48 4513 HLT 76 Stop execution Input Without borrow Input Address Value 4800 07 4801 08 4802 05 4803 06 Output Output Address Value 4804 02 4805 02 4807 00
  • 17. Output With borrow Input Address Value 4800 07 4801 08 4802 05 4803 06 Output Output Address Value 4804 02 4805 02 4807 00 Calculation 05 06 - 07 08 05 06 0101 0110 07 08 0111 1000 1010 1001 1000 0111 0000 0001 0000 0001 --------------- -------------- 1010 1010 1000 1000 05 06 + 07 08 1010 1010 1000 1000 --------------- (1) 0010 0010 02 02
  • 18. 8 BIT MULTIPLICATION & DIVISION AIM: To perform 8085 assembly language program for 8 bit multiplication . APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. keyboard ALGORITHM (MULTIPLICATION): Algorithm: Step1 : Start the microprocessor Step2 : Get the 1st 8 bit numbers Step3 : Move the 1st 8it number to register ‘B’ Step4 : Get the 2nd 8 bit number Step5 : Move the 2nd 8 bit number to register ‘C’ Step6 : Intialise the accumulator as zero Step7 : Intialise the carry as zero Step8 : Add both register ‘B’ value as accumulator Step9 : Jump on if no carry Step10 : Increment carry by 1 if there is Step11 : Decrement the 2nd value and repeat from step 8, till the 2nd value becomes zero. Step12 : Store the multiplied value in accumulator Step13 : Move the carry value to accumulator Step14 : Store the carry value in accumulator
  • 19. Flowchart NO YES No YES Get the 1st 8 bit number Move it to register ‘B’ Get the 2nd 8 bit number Intialize the accumulator as zero & carry as zero Add the accumulator with 1st number Increment carry Decrement 2nd number Store the value f carry in accumulator END Check for carry start 2nd Number
  • 20. PROGRAM: Address Label Mnemonics Hex Code Comments 4100 LDA 4500 3A, 00, 45 Load the first 8 bit number 4103 MOV B,A 47 Move the 1st 8 bit data to register ‘B’ 4104 LDA 4501 3A, 01, 45 Load the 2nd 16 it number 4107 MOV C,A 4F Move the 2nd 8 bit data to register ‘C’ 4108 MVI A, 00 3E, 00 Intialise the accumulator as zero 410A MVI D, 00 16, 00 Intialise the carry as zero 410C ADD B 80 Add the contents of ‘B’ and accumulator 410D INC D2 11, 41 Jump if no carry 4110 INR D 14 Increment carry if there is 4111 DCR C OD Decrement the value ‘C’ 4112 JNZ C2 0C, 41 Jump if number zero 4115 STA 4502 32 02, 45 Store the result in accumulator 4118 MOV A,D 7A Move the carry into accumulator 4119 STA 4503 32,03,45 Store the result in accumulator 411C HLT 76 Stop the program execution Input Input Address Value 4500 04 4501 02 Output Output Address Value 4502 08 4503 00
  • 21. DIVISION OF TWO 8 – BIT NUMBERS Aim: To write an assembly language program for dividing two 8 bit numbers using microprocessor kit. Apparatus required: 8085 microprocessor kit Key board Algorithm: Step1 : Start the microprocessor Step2 : Intialise the Quotient as zero Step3 : Load the 1st 8 bit data Step4 : Copy the contents of accumulator into register ‘B’ Step5 : Load the 2nd 8 bit data Step6 : Compare both the values Step7 : Jump if divisor is greater than dividend Step8 : Subtract the dividend value by divisor value Step9 : Increment Quotient Step10 : Jump to step 7, till the dividend becomes zero Step11 : Store the result (Quotient) value in accumulator Step12 : Move the remainder value to accumulator Step13 : Store the result in accumulator Step14 : Stop the program execution
  • 22. Flow chart NO YES YES START Get the divided Intialise the Quotient as zero Get the divisor Compare the dividend & divisor Add the accumulator with 1st number Check for carry Increment carry Decrement 2nd number Dividend Move the remainder to accumulator Store the Quotient in accumulator END Store the remainder in accumulator
  • 23. PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI B,00 0E,00 Clear the content of B Register. 4102 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair. 4105 MOV A,M 7E Move the content of memory location to A Register. 4106 INX H 23 Increment memory location. 4107 LOOP 1 SUB M 96 Subtract the content of memory location with accumulator. 4108 INR B 04 Increment the B register. 4109 JNC 4107 (LOOP 1) D2,07,41 If carry = 0, jump to address 4107. 410C DCR B 05 Decrement the B register. 410D ADD M 86 Add the content of memory location with accumulator. 411E STA 4301 32,01,43 Store the remainder in address 4301. 4111 MOV A,B 78 Move the B Register content to the accumulator. 4112 STA 4302 32,02,43 Store the quotient in address 4302. 4115 HLT 76 End the program OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 4300 4201 4301 RESULT: Thus the ALP for 8 bit multiplication and division were performed and output was verified
  • 24. EXPT .NO: BLOCK TRANSFER OPERATION AIM: To perform a forward block transfer and reverse block transfer operation using 8085 microprocessor. APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. keyboard ALGORITHM (Forward block transfer): 1. Initialize the source address in HL register pair. 2. Initialize the destination address in DE register pair 3. Move the memory content pointed by HL pair to accumulator. 4. Move accumulator content to memory location pointed by storing DE register. 5. Increment the HL pair 6. Increment the DE registers pair 7. Decrement C register 8. If there is no zero jump to step 4 9. Stop the Program. PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI C,05 0E,05 Clear the content of C registers.(Count 5) 4102 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair 4105 LXID 4300 21,00,43 The content of data 4300 transfer to DE pair 4108 LOOP 1 MOV A,M 7E Move the content of memory to accumulator 4109 STAX D 12 Store the accumulator content at D register. 410A INX H 23 Increment the H register 410B INX D 13 Increment the D register 410C DCR C 0D Decrement the C register 410D JNZ 4108 (LOOP 1) C2,08,41 If carry = 0, jump to address 4108. 4110 HLT 76 End the program
  • 25. Flow chart No OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 4300 4201 4301 4202 4302 4203 4303 4204 4304 Clear the content of C registers. (Count value) Load the content to H reg Load the content to D reg Store the Accumulator content D register INR H Reg END Check for carry START INX D Reg Move the content of memory to accumulator
  • 26. ALGORITHM (Reverse transfer): 1. Initialize the source address in HL register pair. 2. Initialize the destination address in DE register pair 3. Move the memory content pointed by HL pair to C register 4. Move the content of C register to E register 5. Increment the HL pair 6. Move the content of memory to accumulator 7. Store the accumulator content at D register 8. Decrement the D register 9. Decrement the C register 10. If carry = 0, jump to address 4107 11. End the program PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair 4103 LXID 4300 21,00,43 The content of data 4200 transfer to DE pair 4106 MOV C,M 4E Move the content of memory to C register 4107 LOOP 1 MOV E,C 59 Move the content of C register to E register. 4108 INX H 23 Increment the H register 4109 MOV A,M 7E Move the content of memory to accumulator 410A STAX D 12 Store the accumulator content at D register. 410B DCX D 1B Decrement the D register 410C DCR C 0D Decrement the C register 410D JNZ 4107 (LOOP 1) C2,07,41 If carry = 0, jump to address 4107. 4110 HLT 76 End the program OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 (Count 4) 4300 4201 4301 4202 4302 4203 4303 4204
  • 27. Flow Chart No RESULT: Thus the forward block transfer and reverse block transfer operation were performed and output was verified. Load the content to HL Pair (Count value) Transfer content HL to DE Pair Transfer the content of C register to E register. INR H Reg END Check for carry START DCR C Reg Transfer the content of memory to C Reg Transfer the content of memory to accumulator Store the accumulator content at D register. DCX D Reg
  • 28. EXPT .NO: ARRAY OPERATION AIM: To perform a smallest and largest of numbers using 8085 microprocessor. APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. Keyboard ALGORITHM (LARGEST NUMBER): 1. Place all the elements of an array in the consecutive memory locations. 2. Fetch the first element from the memory location and load it in the accumulator. 3. Initialize a counter (register) with the total number of elements in an array. 4. Decrement the counter by 1. 5. Increment the memory pointer to point to the next element. 6. Compare the accumulator content with the memory content (next Element). 7. If the accumulator content is smaller, then move the memory content (Largest element) to the accumulator. Else continue. 8. Decrement the counter by 1. 9. Repeat steps 5 to 8 until the counter reaches zero 10. Store the result (accumulator content) in the specified memory location PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI C,00 0E,00 Clear the content of C Register 4102 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair 4105 MOV C,M 4E Move the content of memory to C register 4106 INX H 23 Increment the H register 4107 MOV A,M 7E Move the content of memory to accumulator 4108 DCR C 0D Decrement the C register 4109 LOOP 1 INX H 23 Increment the C register 410A CMP M BE Compare the content of memory with accumulator 410B JNC 410F (Loop 2) D2,0F,41 If carry = 0, jump to address 410F 410E MOV A,M 7E Move the content of memory to accumulator 410F Loop 2 DCR C 0D Decrement the C register 4110 JNZ 4109 (LOOP 1) C2,09,41 If carry = 0, jump to address 4109 4113 STA 4300 32,00,43 Store the largest number in the memory location 4116 HLT 76 End the program.
  • 29. OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 03 (Count) 4300 4201 4202 4203 ALGORITHM (SMALLEST NUMBER): 1. Place all the elements of an array in the consecutive memory locations. 2. Fetch the first element from the memory location and load it in the accumulator. 3. Initialize a counter (register) with the total number of elements in an array. 4. Decrement the counter by 1. 5. Increment the memory pointer to point to the next element. 6. Compare the accumulator content with the memory content (next Element). 7. If the accumulator content is smaller, then move the memory content (Largest element) to the accumulator. Else continue. 8. The counter by 1. 9. Repeat steps 5 to 8 until the counter reaches zero 10. Store the result (accumulator content) in the specified memory location PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI C,00 0E,00 Clear the content of C Register. 4102 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair 4105 MOV C,M 4E Move the content of memory to C register 4106 INX H 23 Increment the H register 4107 MOV A,M 7E Move the content of memory to accumulator 4108 DCR C 0D Decrement the C register 4109 LOOP 1 INX H 23 Increment the C register 410A CMP M BE Compare the content of memory with accumulator 410B JC 410F (Loop 2) DA,0F,41 If carry = 1, jump to address 410F 410E MOV A,M 7E Move the content of memory to accumulator 410F LOOP 2 DCR C 0D Decrement the C register 4110 JNZ 4109 (LOOP 1) C2,09,41 If carry = 0, jump to address 4109 4113 STA 4300 32,00,43 Store the Smallest number in the memory location 4116 HLT 76 End the program
  • 30. OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 03(Count) 4300 4201 4202 4203 RESULT: Thus the largest and smallest number operation were performed and output was verified.
  • 31. EXPT .NO: SORTING AIM: To perform a ascending and descending order of using 8085 microprocessor. APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. Keyboard ALGORITHM (ascending order): 1. Get the numbers to be sorted from the memory locations. 2. Compare the first two numbers and if the first number is larger than second then Interchange the number. 3. If the first number is smaller, go to step 4 4. Repeat steps 2 and 3 until the numbers are in required order PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair 4103 MOV B,M 46 Move the content of memory to B register 4104 DCR B 05 Decrement the B register 4105 LOOP 1 MOV C,B 48 Move the content of B register to C register. 4106 LXIH 4201 21,01,42 The content of data 4201 transfer to HL pair 4109 LOOP 2 MOV A,M 7E Move the content of memory to accumulator 410A INX H 23 Increment the H register 410B MOV D,M 56 Move the content of memory to D register 410C CMP D BA Compare the content of D register with accumulator 410D JC 4114 (LOOP 3) DA,14,41 If carry = 1, jump to address 4114 4110 MOV M,A 77 Move the content of memory to accumulator 4111 DCX H 2B Decrement the H register 4112 MOV M,D 72 Move the content of D register to memory 4113 INX H 23 Increment the H register 4114 LOOP 3 DCR C 0D Decrement the C register 4115 JNZ 4109 (LOOP 2) C2,09,41 If zero flag = 0, jump to address 4109 4118 DCR B 05 Decrement the B register 4119 JNZ 4105 (LOOP 1) C2,05,41 If zero flag = 0, jump to address 4105 411C HLT 76 End the program
  • 32. OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 (Count 05) 4201 4201 4202 4202 4203 4203 4204 4204 4205 4205 ALGORITHM (Descending order): 1. Get the numbers to be sorted from the memory locations. 2. Compare the first two numbers and if the first number is smaller than second then I Interchange the number. 3. If the first number is larger, go to step 4 4. Repeat steps 2 and 3 until the numbers are in required order PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 LXIH 4200 21,00,42 The content of data 4200 transfer to HL pair 4103 MOV B,M 46 Move the content of memory to B register 4104 DCR B 05 Decrement the B register 4105 LOOP 1 MOV C,B 48 Move the content of B register to C register. 4106 LXIH 4201 21,01,42 The content of data 4201 transfer to HL pair 4109 LOOP 2 MOV A,M 7E Move the content of memory to accumulator 410A INX H 23 Increment the H register 410B MOV D,M 56 Move the content of memory to D register 410C CMP D BA Compare the content of D register with accumulator 410D JNC 4114 (LOOP 3) DA,14,41 If carry = 0, jump to address 4114 4110 MOV M,A 77 Move the content of memory to accumulator 4111 DCX H 2B Decrement the H register 4112 MOV M,D 72 Move the content of D register to memory 4113 INX H 23 Increment the H register 4114 LOOP 3 DCR C 0D Decrement the C register 4115 JNZ 4109 (LOOP 2) C2,09,41 If zero flag = 0, jump to address 4109 4118 DCR B 05 Decrement the B register 4119 JNZ 4105 (LOOP 1) C2,05,41 If zero flag = 0, jump to address 4105 411C HLT 76 End the program
  • 33. OBSERVATION: INPUT OUTPUT ADDRESS DATA ADDRESS DATA 4200 (Count 05) 4201 4201 4202 4202 4203 4203 4204 4204 4205 4205 RESULT: Thus the Ascending and Descending operation were performed and output was verified.
  • 34. EXPT .NO: CODECONVERSION AIM: To perform a code conversion for Following 1.HEXA DECIMAL TO ASCII 2.ASCII TO HEXA DECIMAL 3 APPARATUS REQUIRED: 1. 8085 microprocessor kit 2. Keyboard PROGRAM: ADDRESS LABEL MNEMONICS OPCODE COMMENTS 4100 MVI C,00 0E,00 Clear the content of C Register. 4102 LHLD 4200 2A,00,42 Load the augend in DE pair through HL pair 4105 XCHG EB Transfer the content of HL pair to DE pair 4106 LHLD 4202 2A,02,42 Load the addend in HL pair 4109 MOV A,E 7B Move the content of E register to A register 410A SUB L 95 Subtract the content of L register with accumulator 410B STA 4204 32,04,42 Store the LSB in address location 4204 410E MOV A,D 7A Move the Content of D register to register A 410F SBB H 9C Subtract the content of H register and carry flag with accumulator 4110 STA 4205 32,05,42 Store the MSB in address location 4205 4113 JNC 4117 ( LOOP 1) D2,17,41 If there is no carry go to label (LOOP 1) 4116 INR C 0C Increment the C register 4117 LOOP 1 MOV A,C 79 Move the content of C Register to A register 4118 STA 4206 32,06,42 Store the carry in 4206 through accumulator ( MSB of sum ) 411B HLT 76 End the program