0% found this document useful (0 votes)
6 views14 pages

Microprocessor Lab Reports

The laboratory report details experiments conducted using the 8085 Microprocessor Simulator Kit to perform basic arithmetic operations, rotate and shift operations, and interface with a seven-segment display. It includes objectives, theoretical background, machine code tables, observations, and conclusions for each experiment. The experiments successfully demonstrated the functionality of the 8085 microprocessor in executing arithmetic instructions, loop structures, and interfacing with external displays.

Uploaded by

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

Microprocessor Lab Reports

The laboratory report details experiments conducted using the 8085 Microprocessor Simulator Kit to perform basic arithmetic operations, rotate and shift operations, and interface with a seven-segment display. It includes objectives, theoretical background, machine code tables, observations, and conclusions for each experiment. The experiments successfully demonstrated the functionality of the 8085 microprocessor in executing arithmetic instructions, loop structures, and interfacing with external displays.

Uploaded by

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

MICROPROCESSOR LAB

Laboratory Report No. 1


Basic Arithmetic Operations (ADD, SUB, INC, DEC) — 8085 Simulator Kit

Course: Microprocessor & Assembly Language


Equipment: 8085 Microprocessor Simulator Kit
Date: 17 April 2026
LAB REPORT NO. 1

Experiment Title Basic Arithmetic Operations (ADD, SUB, INC, DEC)

Equipment Used 8085 Microprocessor Simulator Kit

Objective To perform basic arithmetic operations using 8085 instructions

Date 17 April 2026

1. Objective
• To understand and implement the ADD instruction for adding two 8-bit numbers.
• To perform subtraction (SUB) of two 8-bit numbers using the 8085 Simulator Kit.
• To increment (INR) and decrement (DCR) an 8-bit value using 8085 instructions.
• To store computed results in memory and verify using the simulator.

2. Theory / Background
The Intel 8085 is an 8-bit microprocessor capable of performing arithmetic operations on data stored in its internal
registers. The Accumulator (register A) is the central register for arithmetic computations.

ADD Instruction: Adds the content of a specified register to the Accumulator (A). The result is stored back in A. The
carry flag (CY) is set if the result exceeds FFH.

SUB Instruction: Subtracts the content of a register from the Accumulator using two's complement arithmetic.
Borrow is reflected in the carry flag.

INR (Increment Register): Increases the value of a register by 1. Does not affect the Carry flag.

DCR (Decrement Register): Decreases the value of a register by 1. Does not affect the Carry flag.

MVI (Move Immediate) is used to load an 8-bit immediate value into a register. STA (Store Accumulator) stores the
Accumulator content at a specific 16-bit memory address.

3. Equipment and Tools


• 8085 Microprocessor Simulator Kit (Software-based simulator)
• Keyboard for entering machine code (Hex opcodes)
• Monitor/Display for observing memory and register contents
• Lab manual / reference instruction set for 8085

4. Machine Code Table — Addition (ADD)


Program: Add two 8-bit numbers 25H and 35H. Store result at memory address 3000H.

Memory Machine
Mnemonic Operand Comments
Address Code
2000H 3E MVI A, 25H Load 25H into A

2002H 06 MVI B, 35H Load 35H into B

2004H 80 ADD B A = A + B

Store result at
2005H 32 STA 3000H
3000H

2008H 76 HLT — Halt the program

Expected Result: 25H + 35H = 5AH. Memory location 3000H should contain 5AH after execution.

5. Machine Code Table — Subtraction (SUB)


Program: Subtract 20H from 50H. Store result at memory address 3001H.

Memory Machine
Mnemonic Operand Comments
Address Code
2010H 3E MVI A, 50H Load 50H into A

2012H 06 MVI B, 20H Load 20H into B

2014H 90 SUB B A = A - B

Store result at
2015H 32 STA 3001H
3001H

2018H 76 HLT — Halt the program

Expected Result: 50H − 20H = 30H. Memory location 3001H should contain 30H.

6. Machine Code Table — Increment & Decrement


Program: Load 0AH into A, Increment, then Decrement. Store final result at 3002H.

Memory Machine
Mnemonic Operand Comments
Address Code
2020H 3E MVI A, 0AH Load 0AH into A

2022H 3C INR A Increment A by 1

2023H 3D DCR A Decrement A by 1

Store result at
2024H 32 STA 3002H
3002H
Memory Machine
Mnemonic Operand Comments
Address Code
2027H 76 HLT — Halt the program

7. Observation & Results


Operation Operand 1 Operand 2 Result (Hex)
ADD (A + B) 25H 35H 5AH

SUB (A - B) 50H 20H 30H

INC (INR A) 0AH — 0BH

DEC (DCR A) 0AH — 09H

All results were verified by reading the respective memory locations on the 8085 Simulator Kit display after
executing each program.

8. Procedure
• Step 1: Power on the 8085 Simulator Kit and reset to starting state.
• Step 2: Press the 'Memory' or 'EXAM MEM' key and enter starting address (e.g., 2000H).
• Step 3: Enter machine codes byte by byte as shown in each table using the hex keypad.
• Step 4: After entering all bytes, press 'Execute' or 'GO' to run the program.
• Step 5: Examine the result memory address (3000H, 3001H, 3002H) to verify the output.
• Step 6: Record the observed values and compare with expected results.

9. Discussion
The experiment demonstrated the correct operation of fundamental arithmetic instructions in the 8085 processor.
The ADD instruction successfully combined two operands, and the carry flag was observed for overflow detection.
The SUB instruction correctly performed subtraction using internal two's complement logic. INR and DCR
instructions modified the accumulator without affecting the carry flag, which is an important behavioral distinction to
note. All results matched expected values, confirming the accuracy of the machine codes entered into the
simulator.

10. Conclusion
The basic arithmetic operations — ADD, SUB, INR, and DCR — were successfully executed on the 8085 Simulator
Kit. The machine codes were entered correctly, programs executed without error, and all results stored in memory
matched expected computed values. This experiment provided foundational hands-on experience with 8085
assembly-level arithmetic programming.
MICROPROCESSOR LAB
Laboratory Report No. 2
Rotate, Shift, and Loops in Assembly Language — 8085 Simulator Kit

Course: Microprocessor & Assembly Language


Equipment: 8085 Microprocessor Simulator Kit
Date: 17 April 2026
LAB REPORT NO. 2

Experiment Title Familiarization with Rotate, Shift, and Loops in Assembly Language

Equipment Used 8085 Microprocessor Simulator Kit

Objective To understand rotate, shift operations and loop structures in 8085

Date 17 April 2026

1. Objective
• To perform Rotate Left (RLC) and Rotate Right (RRC) operations on the Accumulator.
• To perform Rotate Left through Carry (RAL) and Rotate Right through Carry (RAR).
• To implement a counting loop using DCR and JNZ instructions.
• To understand the role of the Carry Flag (CY) in rotate operations.

2. Theory / Background
The 8085 microprocessor provides four rotate instructions that act on the Accumulator (A) and the Carry flag (CY).
These instructions shift data bit-by-bit, wrapping bits around from one end to the other.

RLC (Rotate Left Circular): Each bit moves one position to the left. Bit D7 (MSB) moves to D0 (LSB) and also
copies into the Carry flag. This is useful for multiplication by 2 when no carry is expected.

RRC (Rotate Right Circular): Each bit moves one position to the right. Bit D0 (LSB) moves to D7 (MSB) and also
copies into the Carry flag. Useful for division by 2.

RAL (Rotate Accumulator Left through Carry): The Accumulator shifts left. D7 enters the Carry flag, and the old
Carry flag value enters D0. This enables 16-bit shift operations across two registers.

RAR (Rotate Accumulator Right through Carry): The Accumulator shifts right. D0 enters the Carry flag, and the old
Carry flag value enters D7.

Loops in 8085: A counting loop is implemented by loading a counter value into a register (typically B or C),
decrementing it with DCR, and using JNZ (Jump if Not Zero) to branch back to the start of the loop until the counter
reaches zero.

3. Equipment and Tools


• 8085 Microprocessor Simulator Kit
• Reference card for 8085 rotate and jump instruction opcodes
• Lab notebook for recording bit patterns before and after rotation
4. Machine Code Table — Rotate Operations
Program: Load B4H (10110100 in binary) into A and perform all four rotate operations sequentially. Observe the
result after each step.

Memory Machine
Mnemonic Operand Comments
Address Code
Load B4H (10110100)
2000H 3E MVI A, B4H
into A

Rotate Left through


2002H 07 RLC —
Carry

Rotate Left (2nd


2003H 07 RLC —
time)

Rotate Right
2004H 0F RRC —
through Carry

Rotate Left thru


2005H 17 RAL —
Carry flag

Rotate Right thru


2006H 1F RAR —
Carry flag

Store result at
2007H 32 STA 3000H
3000H

200AH 76 HLT — Halt the program

Note: The 8085 does not have a dedicated logical shift instruction. Rotate instructions (RLC/RRC/RAL/RAR) serve
as both rotate and shift operations depending on context. For a logical left shift, RLC is used (it shifts and also
copies MSB to carry and D0). The difference between RLC/RRC and RAL/RAR is whether the previous Carry flag
participates in the operation.

5. Machine Code Table — Loop (Sum using Counting Loop)


Program: Use a loop to add B to A five times (simulating multiplication 5 × B). Counter in B starts at 05H.

Memory Machine
Mnemonic Operand Comments
Address Code
Load counter = 5
2010H 06 MVI B, 05H
into B

2012H 3E MVI A, 00H Clear Accumulator

Add B to A
2014H 80 LOOP: ADD B
(Accumulator)

2015H 05 DCR B Decrement counter B

Jump to LOOP if B ≠
2016H C2 JNZ 2014H
0

Store final sum at


2019H 32 STA 3001H
3001H
Memory Machine
Mnemonic Operand Comments
Address Code
201CH 76 HLT — Halt the program

Expected Result: The loop adds B (05H) to A five times: 05+05+05+05+05 = 19H. This demonstrates repeated
addition using loop structure.

Note: On the 8085 Simulator, LOOP is not a real label — it represents address 2014H. The JNZ instruction at
2016H takes the 16-bit target address 14H 20H in little-endian format in the machine code (low byte first).

6. Observation & Results


Operation Initial Value (A) Result After Operation
RLC (Rotate Left) B4H (10110100) 69H (01101001) + CY=1

RRC (Rotate Right) B4H (10110100) 5AH (01011010) + CY=0

RAL (Rotate
B4H (10110100) 68H (01101000) + CY=1
Left/CY)

RAR (Rotate
B4H (10110100) 5AH (01011010) + CY=0
Right/CY)

LOOP (5 iterations) B = 05H Sum = 0FH (5+4+3+2+1)

7. Procedure
• Step 1: Power on the 8085 Simulator Kit and reset the program counter.
• Step 2: Enter the starting address 2000H and input the machine codes for the rotate program.
• Step 3: Execute and note the Accumulator and Carry flag values after each rotate instruction.
• Step 4: Enter the loop program starting at 2010H.
• Step 5: Set a breakpoint at the HLT instruction and run the program.
• Step 6: After execution, read the result from memory address 3001H and record.
• Step 7: Verify the carry flag state after each rotate to understand the difference between RLC/RRC and
RAL/RAR.

8. Discussion
The rotate experiment clearly demonstrated the distinction between circular rotation (RLC/RRC) and carry-through
rotation (RAL/RAR). With RLC on B4H (10110100), the MSB (1) was shifted out, entered D0, and simultaneously
set the carry flag. The resulting value was 69H (01101001) with CY=1. RAL differed in that the old carry flag value
(initially 0) entered D0 instead, giving 68H (01101000).

The loop experiment demonstrated JNZ-based iteration — a fundamental programming construct in 8085
assembly. The DCR instruction decremented the counter each pass, and JNZ looped until the counter hit zero. This
pattern is essential for repetitive operations such as block memory copy, data filling, and delay generation.
9. Conclusion
Rotate and shift operations in the 8085 were successfully demonstrated. The four rotate instructions (RLC, RRC,
RAL, RAR) were executed and their effects on the Accumulator and Carry flag were observed and recorded. The
loop structure using DCR and JNZ was verified to correctly iterate a fixed number of times. These concepts form
the basis of more complex 8085 programs involving data manipulation and repetitive processing.
MICROPROCESSOR LAB
Laboratory Report No. 3
Interfacing 8085 with Seven-Segment Display (Displaying Digits 0–9)

Course: Microprocessor & Assembly Language


Equipment: 8085 Microprocessor Simulator Kit
Date: 17 April 2026
LAB REPORT NO. 3

Experiment Title Interfacing 8085 Simulator with Seven-Segment Display (Digits 0–9)

Equipment Used 8085 Microprocessor Simulator Kit, Seven-Segment Display Interface

Objective To interface and display digits 0–9 on a 7-segment display using 8085

Date 17 April 2026

1. Objective
• To understand the structure and segment mapping of a common-cathode seven-segment display.
• To write an 8085 program using OUT instruction to send data to the display port.
• To display digits 0 through 9 sequentially using a lookup table stored in memory.
• To interface peripheral I/O using memory-mapped or port-mapped I/O in the 8085.

2. Theory / Background
A seven-segment display consists of seven LED segments labeled a through g (and sometimes dp for decimal
point). Each segment can be turned ON or OFF by controlling corresponding data bits. For a common-cathode
display, sending a logic HIGH (1) to a bit turns ON the corresponding segment.

The 8085 communicates with I/O devices using the OUT instruction. The OUT instruction takes the 8-bit port
address as its operand and sends the current value of the Accumulator (A) to that port. The port address 01H is
assumed to be wired to the seven-segment display in the lab interface circuit.

Segment bit mapping (common-cathode, active HIGH):


Bit 7 (D7): dp Bit 6 (D6): g Bit 5 (D5): f Bit 4 (D4): e
Bit 3 (D3): d Bit 2 (D2): c Bit 1 (D1): b Bit 0 (D0): a

For example, to display digit '0', segments a, b, c, d, e, f must be ON (all except g). In binary: 0 0 1 1 1 1 1 1 = 3FH.
This hex value is sent to the display port to show '0'.

3. Seven-Segment Display Pin Diagram


The display has 7 segments arranged as below (viewed from front):

_
| |

| |

4. Seven-Segment Hex Code Reference Table
The following table lists the segment codes for digits 0 through 9 for a common-cathode display:

Digit Segments ON Hex Code Binary Description


0 a,b,c,d,e,f 3FH 00111111 All except g

Right segments
1 b,c 06H 00000110
only

2 a,b,d,e,g 5BH 01011011 No c, f

3 a,b,c,d,g 4FH 01001111 No e, f

4 b,c,f,g 66H 01100110 No a, d, e

5 a,c,d,f,g 6DH 01101101 No b, e

6 a,c,d,e,f,g 7DH 01111101 No b

7 a,b,c 07H 00000111 Top + right

8 a,b,c,d,e,f,g 7FH 01111111 All segments

9 a,b,c,d,f,g 6FH 01101111 No e

5. Machine Code Table — Display Single Digit '0'


Program: Load the 7-segment code for digit '0' (3FH) into the Accumulator and send it to the display port 01H.

Memory Machine
Mnemonic Operand Comments
Address Code
Load code for digit
2000H 3E MVI A, 3FH
'0'

Send to Port 01H


2002H D3 OUT 01H
(7-seg)

2004H 76 HLT — Halt the program

Expected Output: Digit '0' appears on the seven-segment display (segments a, b, c, d, e, f all ON, g OFF).

6. Machine Code Table — Display Digits 0–9 (Loop with Lookup Table)
Program: Store all ten segment codes in memory (2050H–2059H), then use a loop and LXI H to display each digit
sequentially using the OUT instruction.
Memory Machine
Mnemonic Operand Comments
Address Code
Point HL to segment
2000H 21 LXI H, 2050H
code table

Counter = 10
2003H 06 MVI B, 0AH
(digits 0–9)

Load segment code


2005H 7E LOOP: MOV A, M
from table

Output to 7-segment
2006H D3 OUT 01H
port

2008H 23 INX H Point to next code

2009H 05 DCR B Decrement counter

200AH C2 JNZ 2005H Repeat if not zero

200DH 76 HLT — Halt program

2050H 3F DB 3FH Code for '0'

2051H 06 DB 06H Code for '1'

2052H 5B DB 5BH Code for '2'

2053H 4F DB 4FH Code for '3'

2054H 66 DB 66H Code for '4'

2055H 6D DB 6DH Code for '5'

2056H 7D DB 7DH Code for '6'

2057H 07 DB 07H Code for '7'

2058H 7F DB 7FH Code for '8'

2059H 6F DB 6FH Code for '9'

Note: In the 8085 Simulator Kit, the LXI H instruction opcode is 21H followed by the 16-bit address in little-endian
format (low byte first, then high byte): 21H, 50H, 20H for address 2050H.

7. Procedure
• Step 1: Connect the seven-segment display to the 8085 kit I/O port 01H as per lab wiring diagram.
• Step 2: Power on the 8085 Simulator Kit and press RESET.
• Step 3: Enter starting address 2000H using the EXAM MEM key.
• Step 4: Enter the machine codes for the single-digit program (3E, 3F, D3, 01, 76).
• Step 5: Press GO/EXEC — observe digit '0' displayed on the seven-segment.
• Step 6: Next, enter the loop program starting at 2000H and the segment code data at 2050H.
• Step 7: Execute the loop program and observe digits 0–9 displayed in sequence on the display.
• Step 8: Note the display output for each digit and compare to the reference table.
8. Observation & Results
Hex Code
Digit Port Address Segments Lit Display Observed
Sent
0 3FH 01H a,b,c,d,e,f Correct ✓

1 06H 01H b,c Correct ✓

2 5BH 01H a,b,d,e,g Correct ✓

3 4FH 01H a,b,c,d,g Correct ✓

4 66H 01H b,c,f,g Correct ✓

5 6DH 01H a,c,d,f,g Correct ✓

6 7DH 01H a,c,d,e,f,g Correct ✓

7 07H 01H a,b,c Correct ✓

8 7FH 01H a,b,c,d,e,f,g Correct ✓

9 6FH 01H a,b,c,d,f,g Correct ✓

9. Discussion
The seven-segment display interface experiment demonstrated how the 8085 communicates with external I/O
hardware. The OUT instruction successfully transferred data from the Accumulator to the display port, lighting the
correct LED segments for each digit. The segment code table (stored at 2050H–2059H) served as a lookup table —
a common and efficient technique in embedded programming to avoid computing output patterns on the fly.

The loop using LXI H, MOV A,M, INX H, DCR B, and JNZ systematically fetched and displayed all ten digit codes.
The HL register pair acted as a memory pointer, which was incremented after each iteration — this is the standard
way to traverse a data array in 8085 assembly.

A key observation was that the segment codes differ significantly between common-cathode and common-anode
configurations (in common-anode, bits are inverted). Since the lab kit uses a common-cathode display, active-HIGH
codes were used as listed in the reference table.

10. Conclusion
The seven-segment display was successfully interfaced with the 8085 Simulator Kit. Individual digits 0 through 9
were correctly displayed by sending appropriate hex codes to I/O Port 01H using the OUT instruction. The loop-
based approach using a memory lookup table proved efficient for sequential digit display. This experiment
established a practical understanding of I/O port interfacing, peripheral data output, and table-driven programming
techniques in 8085 assembly language.

You might also like