Microprocessor and Computer Architecture · Unit 2
Instruction Set and Addressing Modes
Exam-focused notes for Instruction Set and Addressing Modes (Microprocessor and Computer Architecture, BIT151): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.
Instruction Set and Addressing Modes in short
The instruction set is the list of all operations the 8085 can perform. Every program for the 8085 is built from these instructions, so knowing their format, types and addressing modes is the base for all assembly programming.
What this unit covers
- Instruction format and structure
- Instruction types and classification
- Addressing modes in 8085
- Arithmetic instructions with examples
- Instruction cycle and execution time
Addressing modes in 8085
2082 · 10 marks
Explain different addressing modes in 8085 microprocessor.Explain any five arithmetic instructions in 8085 microprocessor with suitable example.[5+5]
2080 · 10 marks
What is Addressing Modes? Explain each with example. Explain the function and type of addressing mode with reason of instructions STA 4000H.[10]
2080.1 · 5 marks
What is addressing mode? Explain different addressing modes in 8085 microprocessor. [5]
Show solved answerHide answer
Addressing Modes in 8085 Microprocessor
Definition
Addressing mode refers to the way in which the operand (data) of an instruction is specified or accessed. It defines the method used by the CPU to identify the location of the data to be operated upon.
Types of Addressing Modes in 8085
The 8085 microprocessor supports the following addressing modes:
1. Immediate Addressing Mode
- The operand (data) is directly specified in the instruction itself.
- The data follows immediately after the opcode in memory.
- Example:
MVI A, 25H ; Load 25H directly into accumulator LXI H, 2050H ; Load 2050H into HL pair
2. Register Addressing Mode
- The operand is stored in a register, and the instruction specifies that register.
- Data is transferred between registers.
- Example:
MOV A, B ; Copy contents of register B to A ADD C ; Add contents of register C to accumulator
3. Direct Addressing Mode
- The 16-bit memory address of the operand is directly given in the instruction.
- The CPU directly accesses that memory location.
- Example:
LDA 2050H ; Load data from memory address 2050H into A STA 3000H ; Store accumulator content at address 3000H
4. Indirect Addressing Mode (Register Indirect)
- The address of the operand is stored in a register pair (usually HL, BC, or DE).
- The register pair acts as a pointer to the memory location.
- Example:
MOV A, M ; M refers to memory location pointed by HL pair LDAX B ; Load accumulator with data at address in BC pair
5. Implicit (Implied) Addressing Mode
- The operand is implicitly defined by the instruction itself; no address or data needs to be specified separately.
- The instruction operates on a fixed, implied register (usually the accumulator).
- Example:
CMA ; Complement the accumulator (A is implied) RAL ; Rotate accumulator left (A is implied)
Summary Table
| Addressing Mode | Operand Location | Example |
|---|---|---|
| Immediate | In the instruction | MVI A, 30H |
| Register | In a register | MOV A, B |
| Direct | Memory (address given) | LDA 2050H |
| Register Indirect | Memory (address in register pair) | MOV A, M |
| Implicit/Implied | Fixed (accumulator) | CMA |
Note: The reference notes were not available for this topic. The above answer is based on standard 8085 microprocessor curriculum as taught in BSc CSIT, consistent with Tribhuvan University syllabus.
Arithmetic instructions with examples
2082 · 5 marks
Write an assembly language program to multiply 08H and 09H, store the product in memory location 8050H and carry in 8051H using 8085 microprocessor instructions. [5]
Show solved answerHide answer
Assembly Language Program: Multiply 08H × 09H (8085 Microprocessor)
Given
- Multiplicand = 08H
- Multiplier = 09H
- Product storage address = 8050H
- Carry (higher byte) storage address = 8051H
Solution
Concept
The 8085 has no hardware multiply instruction, so multiplication is done by repeated addition: add the multiplicand (08H) to itself the number of times given by the multiplier (09H). Any carry beyond 8 bits is counted in a separate register.
Program
LXI H, 8050H ; HL points to product location 8050H
MVI B, 08H ; B = multiplicand (08H)
MVI C, 09H ; C = multiplier / counter (09H)
MVI A, 00H ; A = 00H (accumulate product low byte)
MVI D, 00H ; D = 00H (accumulate carry / high byte)
LOOP: ADD B ; A = A + B
JNC SKIP ; if no carry, skip
INR D ; else increment high byte
SKIP: DCR C ; decrement counter
JNZ LOOP ; repeat until C = 0
MOV M, A ; store product low byte at 8050H
INX H ; HL points to 8051H
MOV M, D ; store carry / high byte at 8051H
HLT ; halt
Execution Trace
| Iteration | A before | ADD B (08H) | Carry | D |
|---|---|---|---|---|
| 1 | 00H | 08H | 0 | 00H |
| 2 | 08H | 10H | 0 | 00H |
| 3 | 10H | 18H | 0 | 00H |
| 4 | 18H | 20H | 0 | 00H |
| 5 | 20H | 28H | 0 | 00H |
| 6 | 28H | 30H | 0 | 00H |
| 7 | 30H | 38H | 0 | 00H |
| 8 | 38H | 40H | 0 | 00H |
| 9 | 40H | 48H | 0 | 00H |
Verification
$$08H \times 09H = 8 \times 9 = 72_{10} = 48H$$
Since the result 72 fits in one byte (< 256), no carry is generated, so D = 00H.
Result in Memory
| Address | Content | Meaning |
|---|---|---|
| 8050H | 48H | Product (low byte) |
| 8051H | 00H | Carry (high byte) |
The final product is 48H with carry 00H.
2080 · 5 marks
Write 8085 assembly language to add two numbers located at 2030H and 2040H. Store the sum in the address 2050H. [5]
2079 · 5 marks
Write a 8085 assembly langauge for division of two 8-bit numbers by repeated subtraction method. [5]
Instruction types and classification
2081 · 5 marks
Write an assembly language program to swap the content of memory location 8000H and 9000H using 8085 microprocessor instructions. [5]
2078 · 10 marks
What are different types of instructions available in 8085 microprocessor? Write a program to find smallest element of an array: (Assume all the necessary data and memory location).[10]
Instruction cycle and execution time
2079 · 5 marks
What is instruction cycle? If the clock frequency is 5 MHz, how much time is required to execute an instruction MVI A, 08H? [3+2]
Make Unit 2 stick
Practice BIT151 with flashcards & quizzes