×
Expecting to get a good job without studying hard is like expecting to win a marathon without running it.
--Your friends at LectureNotes
Close

Microprocessor

by Anju JangidAnju Jangid
Type: PracticalOffline Downloads: 2Views: 88Uploaded: 2 months ago

Share it with your friends

Suggested Materials

Leave your Comments

Contributors

Anju Jangid
Anju Jangid
MICROPROCESSOR & MICROCONTROLLER LAB MANUAL 8085 MICROPROCESSOR PROGRAMS C.SARAVANAKUMAR. M.E., LECTURER, DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 1
MICROPROCESSOR & MICROCONTROLLER LAB MANUAL ADDITION OF TWO 8 BIT NUMBERS AIM: To perform addition of two 8 bit numbers using 8085. ALGORITHM: 1) 2) 3) 4) 5) 6) 7) Start the program by loading the first data into Accumulator. Move the data to a register (B register). Get the second data and load into Accumulator. Add the two register contents. Check for carry. Store the value of sum and carry in memory location. Terminate the program. PROGRAM: MVI LDA MOV LDA ADD JNC INR LOOP: STA MOV STA HLT C, 00 Initialize C register to 00 4150 Load the value to Accumulator. B, A Move the content of Accumulator to B register. 4151 Load the value to Accumulator. B Add the value of register B to A LOOP Jump on no carry. C Increment value of register C 4152 Store the value of Accumulator (SUM). A, C Move content of register C to Acc. 4153 Store the value of Accumulator (CARRY) Halt the program. OBSERVATION: Input: Output: 80 (4150) 80 (4251) 00 (4152) 01 (4153) RESULT: Thus the program to add two 8-bit numbers was executed. C.SARAVANAKUMAR. M.E., LECTURER, DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 2
MICROPROCESSOR & MICROCONTROLLER LAB MANUAL SUBTRACTION OF TWO 8 BIT NUMBERS AIM: To perform the subtraction of two 8 bit numbers using 8085. ALGORITHM: 1. 2. 3. 4. 5. 6. 7. 8. 9. Start the program by loading the first data into Accumulator. Move the data to a register (B register). Get the second data and load into Accumulator. Subtract the two register contents. Check for carry. If carry is present take 2’s complement of Accumulator. Store the value of borrow in memory location. Store the difference value (present in Accumulator) to a memory location and terminate the program. PROGRAM: MVI LDA MOV LDA SUB JNC CMA INR INR LOOP: STA MOV STA HLT C, 00 4150 B, A 4151 B LOOP A C 4152 A, C 4153 Initialize C to 00 Load the value to Acc. Move the content of Acc to B register. Load the value to Acc. Jump on no carry. Complement Accumulator contents. Increment value in Accumulator. Increment value in register C Store the value of A-reg to memory address. Move contents of register C to Accumulator. Store the value of Accumulator memory address. Terminate the program. C.SARAVANAKUMAR. M.E., LECTURER, DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 3
MICROPROCESSOR & MICROCONTROLLER LAB MANUAL OBSERVATION: Input: 06 (4150) 02 (4251) Output: 04 (4152) 01 (4153) RESULT: Thus the program to subtract two 8-bit numbers was executed. C.SARAVANAKUMAR. M.E., LECTURER, DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 4

Lecture Notes