SlideShare a Scribd company logo
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

PPT
Introduction to microprocessor
PDF
Unit II arm 7 Instruction Set
PPT
Multiplexers & Demultiplexers
PPTX
8255 PPI
PPTX
Programmable peripheral interface 8255
PPTX
Programmable logic devices
PPT
Interfacing 8255
PPT
8085 microproceesor ppt
Introduction to microprocessor
Unit II arm 7 Instruction Set
Multiplexers & Demultiplexers
8255 PPI
Programmable peripheral interface 8255
Programmable logic devices
Interfacing 8255
8085 microproceesor ppt

What's hot (20)

PPT
8255 presentaion.ppt
PPTX
Microprocessor 8085 complete
PPTX
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
PPTX
DMA operation
PPT
Semiconductor memory
PPT
introduction to microprocessors
PPT
Adc interfacing
PDF
MICROCONTROLLER - INTEL 8051
PPTX
state diagrams of flip flops
PDF
ARM Architecture
PPTX
SHLD and LHLD instruction
PPTX
Interrupts in 8051
PPTX
Segment registers
PPTX
Introduction to arm processor
PPTX
Stacks & subroutines 1
PPT
Computer architecture pipelining
PPTX
8051 Microcontroller ppt
PPT
Introduction to microprocessor
PPTX
8086 Microprocessor Pipeline Architecture.pptx
PPT
8255 Introduction
8255 presentaion.ppt
Microprocessor 8085 complete
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
DMA operation
Semiconductor memory
introduction to microprocessors
Adc interfacing
MICROCONTROLLER - INTEL 8051
state diagrams of flip flops
ARM Architecture
SHLD and LHLD instruction
Interrupts in 8051
Segment registers
Introduction to arm processor
Stacks & subroutines 1
Computer architecture pipelining
8051 Microcontroller ppt
Introduction to microprocessor
8086 Microprocessor Pipeline Architecture.pptx
8255 Introduction
Ad

Viewers also liked (20)

PDF
MICROPROCESSOR 8085 WITH PROGRAMS
DOC
Chuyen de ptlgiac
DOCX
DOC
9.references
PPT
Handoff survey
PPT
Wi max
PPTX
Washing machine
DOC
LEGAL LEASE DOCUMENT
PPTX
BIZITZAREN HISTORIA ZURE GORPUTZA SM-IKASMINA SAN MARTIN ESKOLAN EGOKITUA
PDF
An efficient vertical handoff mechanism for future mobile network
DOC
Networks lab manual ecp62
DOC
3.table of contents
PDF
Persona global newsletter issue iv
PPTX
Class7
PDF
Biderketa taulak
DOCX
PDF
Leaders as learning facilitators: learnscapes, prerequisites & field of action
PDF
Urdaneta comic
PPT
Fuzzy logic - copy
PPSX
Ni ... naiz 1. maila
MICROPROCESSOR 8085 WITH PROGRAMS
Chuyen de ptlgiac
9.references
Handoff survey
Wi max
Washing machine
LEGAL LEASE DOCUMENT
BIZITZAREN HISTORIA ZURE GORPUTZA SM-IKASMINA SAN MARTIN ESKOLAN EGOKITUA
An efficient vertical handoff mechanism for future mobile network
Networks lab manual ecp62
3.table of contents
Persona global newsletter issue iv
Class7
Biderketa taulak
Leaders as learning facilitators: learnscapes, prerequisites & field of action
Urdaneta comic
Fuzzy logic - copy
Ni ... naiz 1. maila
Ad

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

DOC
180410227 ae2406-lab-manual-doc
PPT
8085_Microprocessor(simar).ppt
PDF
EE2356 Microprocessor and Microcontroller Lab Manuel
PDF
Architecture of 8085
PPT
8085 Microprocessor artchitecture -ppt.ppt
PPT
Introduction to 8085 microprocessor
PDF
mod1 microprocessor ppt if you want you can download it if younwant to study ...
PPTX
PPT 8085 microprocessor
DOCX
Mpi lab manual eee
PDF
itft-Instruction set-of-8085
PPTX
Copy of 8085_Microprocessor.pptx MBSD EE
PDF
microprocessor MICROPROCESSOR 8085 MICROPROCESSOR 8085
PDF
Architecture of 8085
PDF
Lecture1 The 8085 Microprocessor
PDF
8085 Instructions.pdf
PPTX
8085 architecture
PPT
Pdemodule 4
PPSX
Intel 8085 mp
PPT
Assemblylanguageprogrammingof8085 100523023329-phpapp02
180410227 ae2406-lab-manual-doc
8085_Microprocessor(simar).ppt
EE2356 Microprocessor and Microcontroller Lab Manuel
Architecture of 8085
8085 Microprocessor artchitecture -ppt.ppt
Introduction to 8085 microprocessor
mod1 microprocessor ppt if you want you can download it if younwant to study ...
PPT 8085 microprocessor
Mpi lab manual eee
itft-Instruction set-of-8085
Copy of 8085_Microprocessor.pptx MBSD EE
microprocessor MICROPROCESSOR 8085 MICROPROCESSOR 8085
Architecture of 8085
Lecture1 The 8085 Microprocessor
8085 Instructions.pdf
8085 architecture
Pdemodule 4
Intel 8085 mp
Assemblylanguageprogrammingof8085 100523023329-phpapp02

More from Basil John (20)

PPTX
Mm case 2 ref
PPTX
Class 5 ipr trips - trims
PPTX
Business Law
PDF
Basil john mm field assignment jan2016
PPTX
Overcoming communication Barriers
PPT
Luxottica
PPT
AADHAR Card- Database Creation
PPTX
Walmart f500
PPT
PPT
Interworking of wi_max_and_3gpp_networks_-slides
PPT
Cloud computing
PPT
Wcdma systems 003
PPT
Fuzzy logic
PPT
An advanced handoff algoritm in mobile communication network using fuzzy deci...
PPT
Neural networks
PPTX
An efficient vertical handoff mechanism
DOC
1. front page
DOC
8.conclusion
DOC
4. list of figures
DOC
2.acknowledgement
Mm case 2 ref
Class 5 ipr trips - trims
Business Law
Basil john mm field assignment jan2016
Overcoming communication Barriers
Luxottica
AADHAR Card- Database Creation
Walmart f500
Interworking of wi_max_and_3gpp_networks_-slides
Cloud computing
Wcdma systems 003
Fuzzy logic
An advanced handoff algoritm in mobile communication network using fuzzy deci...
Neural networks
An efficient vertical handoff mechanism
1. front page
8.conclusion
4. list of figures
2.acknowledgement

Recently uploaded (20)

PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Welding lecture in detail for understanding
PDF
Well-logging-methods_new................
PPT
Project quality management in manufacturing
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
UNIT 4 Total Quality Management .pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Embodied AI: Ushering in the Next Era of Intelligent Systems
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Foundation to blockchain - A guide to Blockchain Tech
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Welding lecture in detail for understanding
Well-logging-methods_new................
Project quality management in manufacturing
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
R24 SURVEYING LAB MANUAL for civil enggi
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
UNIT 4 Total Quality Management .pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Model Code of Practice - Construction Work - 21102022 .pdf
bas. eng. economics group 4 presentation 1.pptx
Operating System & Kernel Study Guide-1 - converted.pdf

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