Lecture Notes: Instruction Set and Programming of 8085 Microprocessor
Chapter Introduction
- Chapter: 12th Computer Science Board - Chapter 2
- Focus: Instruction Set and Programming of 8085 Microprocessor
Motivation and Marks Breakdown
- Total Paper Marks: 90 marks (with options write for 50 marks)
- Chapter Contribution: 43 marks (almost half of the total marks)
- Question Type Breakdown:
- 1 mark question - 1 question: 1 mark
- 3 marks questions - 4 questions: 12 marks
- 5 marks questions - 6 questions (with option, 30 marks without option, approx. 10 marks scored)
- Total tangible marks from chapter: 23 marks
Basics Refresher: Number Systems
- Number Systems: Decimal, Binary, Octal, Hexadecimal
- Focus: Hexadecimal Numbers
- Decimal: Based on 10 numbers (0-9)
- Binary: Based on 2 numbers (0 and 1)
- Octal: Not frequently used
- Hexadecimal: Based on 16 numbers (0-9, A-F)
- Hexadecimal Representation:
- Example: Decimal 10 = Hexadecimal A, 11 = B, ..., 15 = F
- Practice: Convert Binary to Hex & vice-versa
- Hexadecimal to Binary Conversion Example:
- Hexadecimal F = Binary 1111, etc. (4 bits to represent)
- Hexadecimal Representation in Programs:
- Example: Memory contents and representation using тАЬHтАЭ
Important Symbols and Abbreviations
- ADDR (Address): Always 16 bits. Represents memory location.
- DATA: Generally 8 bits, but can be 16 bits in rare cases.
- REGISTERS: (R1, R2, etc.) General-purpose registers (A, B, C, D, E, H, L)
- FLAGS: Special status indicators (e.g., Carry Flag, Zero Flag, etc.)
- MEMORY: Addressed by HL pair (MEM[HL] = value stored)
- OPERATORS: (AND, OR, XOR): Logical operation indicators
- MOV Instruction Example: MOV A, B means copy contents of B to A
Addressing Modes of 8085 Microprocessor
- Register Addressing Mode: Operands are registers; MOV A, B
- Direct Addressing Mode: Operands are memory locations; LDA 2000H
- Register Indirect Addressing Mode: Addressed by register pairs (e.g., M = HL)
- Immediate Addressing Mode: Operand is immediate data; MVI A, 55H
- Implied Addressing Mode: No explicit operands; CMA (complement accumulator)
Instruction Size
- Size Determination Example: MOV A, B (1 byte), MVI A, 23H (2 bytes)
- Instruction Breakdown: LDA 2000H involves 3 bytes; Opcode (1 byte) + Address (2 bytes)
Instruction Set
Data Transfer Group
- MOV dest, src: Transfer data between registers (MOV A, B).
- MVI reg, data: Immediate data transfer (MVI A, 23H).
- LDA addr: Load accumulator from memory (LDA 2000H).
- STA addr: Store accumulator in memory.
- LHLD addr: Load HL pair from memory (LHLD 2000H).
- SHLD addr: Store HL pair to memory.
- LDAX rp: Load accumulator pair data (LDAX B).
- STAX rp: Store accumulator pair data.
- XCHG: Exchange HL and DE contents.
Arithmetic Group
- ADD R: Add register to accumulator; flags affected (ADD B).
- ADI data: Add immediate data to accumulator (ADI 05H).
- ADC R: Add register with carry.
- SBB R: Subtract register from accumulator with borrow.
- INR R: Increment register by one (INR B).
- DCR R: Decrement register by one (DCR B).
Logical Group
- ANA R: Logical and with register (ANA B).
- XRA R: Exclusive OR with register (XRA B).
- CMP R: Compare register with accumulator (CMP B).
- RLC: Rotate accumulator left.
- RRC: Rotate accumulator right.
- CMA: Complement accumulator.
- CMC: Complement carry.
Branching Group
- JMP addr: Unconditional jump (JMP 2000H).
- JC addr: Jump if carry (JC 2000H).
- JZ addr: Jump if zero (JZ 2000H).
- CALL addr: Call subroutine (CALL 2000H).
- RET: Return from subroutine (RET).
- RST n: Restart from specific address (RST 7).
Machine Control Group
- NOP: No operation.
- HLT: Halt the microprocessor.
- DI: Disable interrupts.
- EI: Enable interrupts.
- RIM: Read interrupt mask.
- SIM: Set interrupt mask.
- SPHL: Copy HL to stack pointer.
Example Programs and Applications
- Example application and detailed walk-through to follow in practical session or next lecture.
Conclusion
- Emphasis on practicing instructions and understanding opcode conversions.
- Next Steps: Preparing for programming exercises.
For more detailed notes and explanation of specific instructions, refer to further study materials or reach out on discussed communication platforms.