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.
48
Embed
Introduction to 8085 & it's description(includes basic lab experiments)
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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 registerIt 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) AccumulatorIt 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 unitIt 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 registerIt is an 8 bit register associated with ALU hold data, entering an operation, used by
the microprocessor and not accessible to programs.
g) FlagsFlag 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 arei) 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 unitSynchronous all microprocessor, operation with the clock and generator and control
signal from it necessary to communicate between controller and peripherals.
i) Instruction register and decoderInstruction is fetched from line memory and stored in line instruction register decoder
the stored information.
j) Register ArrayThese are used to store 8 bit data during execution of some instruction.
PIN Description
Address Bus1. The pins Ao – A15 denote the address bus. 2. They are used for most significant bit
Address / Data Bus1. 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 / M1. 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.
RD1. This is an active low signal 2. This signal is used to control READ operation of the microprocessor.
WR1. WR is also an active low signal 2. Controls the write operation of the microprocessor.
HOLD1. 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.
HLDA1. HLDA is the acknowledgement signal for HOLD 2. It indicates whether the hold signal is received or not.
INTR1. INTE is an interrupt request signal 2. IT can be enabled or disabled by using software
INTA1. Whenever the microprocessor receives interrupt signal 2. It has to be acknowledged.
RST 5.5, 6.5, 7.51. 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 kit2. 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,43Load the content of the accumulator in 4300
4105 MOV B, A 47Move the content from accumulator to B register
4106 LDA 4301 3A,01,43Load the content of the accumulator in 4301
4109 ADD B 80Add the content from accumulator to B register
410A JNC 410E ( LOOP 1) D2,0E,41Jump on no carry to the label (LOOP 1)
410D INR C 0C Increment the C register content
410E LOOP 1 STA 4302 32,02,43Store the sum at accumulator at in location 4300
4111 MOV A,C 79Move the carry content from C Register to accumulator
4112 STA 4303 32,03,43Store carry content in accumulator at the location 4303
To perform 8085 assembly language program for 8 bit multiplication .
APPARATUS REQUIRED:
1. 8085 microprocessor kit2. 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 Comments4100 LDA 4500 3A, 00, 45 Load the first 8 bit number4103 MOV B,A 47 Move the 1st 8 bit data to
register ‘B’4104 LDA 4501 3A, 01, 45 Load the 2nd 16 it number4107 MOV C,A 4F Move the 2nd 8 bit data to
register ‘C’4108 MVI A, 00 3E, 00 Intialise the accumulator as
zero410A MVI D, 00 16, 00 Intialise the carry as zero410C ADD B 80 Add the contents of ‘B’ and
accumulator410D INC D2 11, 41 Jump if no carry4110 INR D 14 Increment carry if there is4111 DCR C OD Decrement the value ‘C’4112 JNZ C2 0C, 41 Jump if number zero4115 STA 4502 32 02, 45 Store the result in
accumulator4118 MOV A,D 7A Move the carry into
accumulator4119 STA 4503 32,03,45 Store the result in
accumulator411C HLT 76 Stop the program execution
InputInput Address Value
4500 044501 02
OutputOutput Address Value
4502 084503 00
DIVISION OF TWO 8 – BIT NUMBERS
Aim:To write an assembly language program for dividing two 8 bit numbers using
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
END
Store the Quotient in accumulator
Move the remainder to accumulator
Dividend
Decrement 2nd number
Increment carry
Check for carry
Add the accumulator with 1st number
Compare the dividend & divisor
Get the divisor
Intialise the Quotient as zero
Get the divided
START
Store the remainder in accumulator
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS4100 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 OUTPUTADDRESS DATA ADDRESS DATA
4200 43004201 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 kit2. keyboard
ALGORITHM (Forward block transfer):
1. Initialize the source address in HL register pair.2. Initialize the destination address in DE register pair3. 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 pair6. Increment the DE registers pair7. Decrement C register8. If there is no zero jump to step 49. 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 register410B INX D 13 Increment the D register410C DCR C 0D Decrement the C register410D 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 OUTPUTADDRESS DATA ADDRESS DATA
4200 4300
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
4201 43014202 43024203 43034204 4304
ALGORITHM (Reverse transfer):
1. Initialize the source address in HL register pair.2. Initialize the destination address in DE register pair3. Move the memory content pointed by HL pair to C register4. Move the content of C register to E register5. Increment the HL pair6. Move the content of memory to accumulator7. Store the accumulator content at D register8. Decrement the D register9. Decrement the C register10. If carry = 0, jump to address 410711. 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 register410C DCR C 0D Decrement the C register410D JNZ 4107 (LOOP 1) C2,07,41 If carry = 0, jump to address 4107.4110 HLT 76 End the program
Thus the forward block transfer and reverse block transfer operation were performed and output was verified.
EXPT .NO:
ARRAY OPERATION
AIM:
To perform a smallest and largest of numbers using 8085 microprocessor.
APPARATUS REQUIRED:
1. 8085 microprocessor kit2. 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 zero10. Store the result (accumulator content) in the specified memory location
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS4100 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 register4109 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 410F410E MOV A,M 7E Move the content of memory to
accumulator410F Loop 2 DCR C 0D Decrement the C register4110 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 OUTPUTADDRESS DATA ADDRESS DATA
4200 03 (Count) 4300420142024203
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 zero10. Store the result (accumulator content) in the specified memory location
PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS4100 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 register4109 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 register4110 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 OUTPUTADDRESS DATA ADDRESS DATA
4200 03(Count) 4300420142024203
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 kit2. 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 44. 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 register4114 LOOP 3 DCR C 0D Decrement the C register4115 JNZ 4109 (LOOP 2) C2,09,41 If zero flag = 0, jump to address 41094118 DCR B 05 Decrement the B register
4119 JNZ 4105 (LOOP 1) C2,05,41 If zero flag = 0, jump to address 4105411C HLT 76 End the program
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 44. 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 register4114 LOOP 3 DCR C 0D Decrement the C register4115 JNZ 4109 (LOOP 2) C2,09,41 If zero flag = 0, jump to address 41094118 DCR B 05 Decrement the B register
4119 JNZ 4105 (LOOP 1) C2,05,41 If zero flag = 0, jump to address 4105411C HLT 76 End the program