Sheet Cheat West
Sheet Cheat West
Write down the different features of 8085 Accumulator (A): Central to all arithmetic and
microprocessor. logical operations. It acts as a data register, an accumulator,
The Intel 8085 microprocessor has the following features: and stores results of operations.
8-bit microprocessor: It processes 8 bits of data in a single B, C, D, E, H, L Registers: Serve as general-purpose registers
operation. for
16-bit address bus: Can address up to 64KB of memory. temporary data storage. These registers can also be used
8-bit data bus: Facilitates data transfer of 8 bits at a time. in pairs (BC, DE, HL) to hold 16-bit data or addresses.
74 instructions: Comprises a set of 74 instructions for various Program Counter (PC): Keeps track of the memory address of
operations.
the next instruction to be executed, enabling the sequential
5 MHz clock speed: Operates at a maximum frequency of 5
MHz. execution of instructions.
5 interrupt lines: Supports five hardware interrupts Stack Pointer (SP): Points to the top of the stack, a special
memory
(TRAP, RST7.5, RST6.5, RST5.5, INTR).
area used for temporary storage during subroutine calls and
246 operational codes: Unique machine code for each interrupts.
instruction.
Instruction Register: Holds the current instruction fetched
16-bit program counter: Holds the address of the next from
instruction to be executed.
memory and awaiting execution.
16-bit stack pointer: Points to the top of the stack.
Temporary Register: Used internally to hold data temporarily
On-chip clock generator: Includes a clock generator, which
eliminates the need for an external clock. during instruction execution.
3. Explain the functions of internal registers of 8085 Flag Register: Contains five flags (Sign, Zero, Auxiliary Carry,
microprocessor. Parity, Carry)
The internal registers of the 8085 microprocessor that indicate the result of the most recent arithmetic or
logical operation.
play specific roles in its operations:
These flags are used for conditional branching. The Control Unit of the 8085 microprocessor orchestrates the
4. Explain the operation of Arithmetic and Logic Unit (ALU) operations
of 8085 microprocessor. of the microprocessor by generating timing and control
The ALU of the 8085 microprocessor performs arithmetic and signals:
logical operations as follows: Instruction Fetch: Generates control signals to fetch the
Arithmetic Operations: Addition, subtraction, increment, and opcode of the next
decrement. instruction from memory.
For example, adding two 8-bit numbers using the ADD Instruction Decode: Decodes the fetched opcode to
instruction. determine the type
Logical Operations: AND, OR, XOR, NOT (complement). For of operation and the operands involved.
example, Execution: Generates appropriate control signals to execute
performing a bitwise AND operation using the ANA the decoded
instruction. instruction (e.g., signals for ALU operations, memory
Flags Update: After each operation, the ALU updates the read/write operations).
status flags in the Timing Control: Synchronizes the operations of the
flag register to reflect the result of the operation (e.g., microprocessor with
setting the Zero flag if the result is zero). the clock signal, ensuring proper sequencing of fetch, decode,
Data Transfer: The ALU takes one operand from the and execute phases.
accumulator and the Interrupt Handling: Manages interrupt requests by generating
other from a register or memory, performs the operation, control
and signals to save the current state and jump to the interrupt
stores the result back in the accumulator. service routine.
5. Explain the operation of Control unit (CU) of 8085 7. What do you mean by program status word (PSW) in
microprocessor. 8085? Explain
with the help of suitable example.
The Program Status Word (PSW) in the 8085 microprocessor Sign (S): Set if the result is negative.
is a combination Zero (Z): Set if the result is zero.
of the accumulator and the flag register. It reflects the Auxiliary Carry (AC): Set if there is a carry out from bit 3.
outcome of the most recent
Parity (P): Set if the result has even parity.
operation performed by the ALU. For example, after an
addition operation, the Carry (CY): Set if there is a carry out from the most significant
bit.
PSW indicates if there was a carry, if the result is zero, or if
the result has even parity. Example: After adding 0x45 and 0x35 using the ADD
instruction, the
Example: If the accumulator contains 0x0F and an ADD B
instruction is result is 0x7A. The flags would be set as follows:
executed with register B containing 0x01, the result is 0x10. Zero flag (Z): 0 (result is not zero)
The PSW will update the flags as follows: Sign flag (S): 0 (result is positive)
Zero flag (Z): 0 (result is not zero) Auxiliary Carry flag (AC): 0 (no carry from bit 3 to bit 4)
Sign flag (S): 0 (result is positive) Parity flag (P): 0 (result has odd parity)
Parity flag (P): 1 (result has even parity) Carry flag (CY): 0 (no carry out)
Carry flag (CY): 0 (no carry out) 9. What are the different addressing modes of 8085
microprocessor?
Auxiliary Carry flag (AC): 1 (carry from bit 3 to bit 4)
Explain with the help of suitable example.
8. What do you mean by Flag register in 8085?
The 8085 microprocessor supports several addressing modes,
Explain with the help of suitable example. each
The Flag register in the 8085 microprocessor is an 8-bit specifying the operand's location:
register where
Immediate Addressing: The operand is part of the instruction.
each bit represents a specific flag that indicates the status of
the ALU Example: MVI A, 32H (loads the immediate value 32H into the
accumulator).
operations. The flags are:
Direct Addressing: The address of the operand is given in the HLDA (Hold Acknowledge): Indicates that the CPU has
instruction. acknowledged
Example: LDA 2050H (loads the accumulator with the value the HOLD request and has relinquished control of the buses.
at memory address 2050H). 11. Explain Instruction cycle and Machine cycle of Intel
Register Addressing: The operand is in a register. 8085.
Example: MOV A, B (copies the contents of register B into the Instruction Cycle: The time taken to fetch, decode, and
accumulator). execute an instruction.
Register Indirect Addressing: The address of the operand is in It consists of one or more machine cycles.
a register pair. Fetch Cycle: Fetches the opcode from memory.
Example: MOV A, M (moves the contents of the memory Decode Cycle: Decodes the fetched opcode to determine the
location pointed operation.
to by the HL register pair into the accumulator). Execute Cycle: Executes the instruction.
Implicit Addressing: The operand is implied in the instruction. Machine Cycle: The basic operation cycle of the processor. It
Example: CMA (complements the accumulator). includes:
10. Explain the DMA related signals present in 8085. Opcode Fetch Cycle: Fetches the opcode from memory.
DMA (Direct Memory Access) allows peripherals to directly Memory Read Cycle: Reads data from memory.
read from Memory Write Cycle: Writes data to memory.
or write to memory without involving the CPU. The 8085 I/O Read Cycle: Reads data from an I/O device.
microprocessor
I/O Write Cycle: Writes data to an I/O device.
supports DMA with the following signals:
15. Explain ADD, ADI, SUB, SUI instructions
HOLD: Indicates that an external device is requesting the use
of the address with the help of suitable example.
and data buses. The CPU responds by tri-stating its buses. ADD: Adds the contents of a register to the accumulator.
Example: ADD B (if A = 0x10 and B = 0x05, then A = 0x15).
ADI: Adds an immediate value to the accumulator. Example: LXI H, 2500H (loads the immediate value 2500H into
Example: ADI 12H (if A = 0x10, then A = 0x22). the HL register pair).
SUB: Subtracts the contents of a register from the MVI: Move immediate value into a register.
accumulator. Example: MVI A, 32H (loads the immediate value 32H into
Example: SUB C (if A = 0x10 and C = 0x05, then A = 0x0B). the accumulator A).
SUI: Subtracts an immediate value from the accumulator. LDA: Load accumulator from memory.
Example: SUI 05H (if A = 0x10, then A = 0x0B). Example: LDA 2050H (loads the contents of memory location
2050H into the accumulator A).
16. Explain DAD and DAA instructions with the help of
suitable example. STA: Store accumulator into memory.
DAD: Adds the contents of a register pair to the HL pair. Example: STA 2070H (stores the contents of the accumulator
A into memory location 2070H).
Example: DAD B (if HL = 0x1234 and BC = 0x1111, then HL =
0x2345). 18. Explain LHLD, SHLD, XCHG, SPHL instructions with the
help of suitable example.
DAA: Decimal Adjust Accumulator. Adjusts the value of the
accumulator LHLD: Load H and L registers directly from memory. Example:
LHLD 2500H
for BCD operations. Example: After adding 0x09 and 0x07, A
= 0x10. (loads the contents of memory location 2500H into L and
2501H into H).
Executing DAA converts it to 0x16.
SHLD: Store H and L registers directly into memory. Example:
17. Explain MOV, LXI, MVI, LDA and STA instructions with SHLD 2600H
the
(stores the contents of L into memory location 2600H and H
help of suitable example. into 2601H).
MOV: Move data between registers. XCHG: Exchange the contents of HL and DE register pairs.
Example: MOV A, B (copies the contents of register B to the Example: XCHG
accumulator A). (if HL = 1234H and DE = 5678H, after execution HL = 5678H
LXI: Load immediate value into register pair. and DE = 1234H).
SPHL: Load the stack pointer with the contents of HL register , 299E contain 34H, 12H respectively, after execution DE =
pair. 1234H and SP = 3000H).
Example: SPHL (if HL = 1234H, after execution SP = 1234H). 21. Explain RLC, RAL, RRC, RAR instructions with the help of
19. Explain ANA, ORA, XRA, CMA instructions with the help suitable example.
of suitable example. RLC: Rotate accumulator left through carry.
ANA: Logical AND with accumulator. Example: ANA B (if A = Example: RLC (if A = 0x85, after execution A = 0x0B and Carry
0x0F and B = 0xF0, then A = 0x00). = 1).
ORA: Logical OR with accumulator. Example: ORA C (if A = RAL: Rotate accumulator left through carry with carry.
0x0F and C = 0xF0, then A = 0xFF). Example: RAL (if A = 0x85 and Carry = 1, after execution A =
XRA: Logical XOR with accumulator. Example: XRA D (if A = 0x0B and Carry = 1).
0x0F and D = 0x0F, then A = 0x00). RRC: Rotate accumulator right through carry.
CMA: Complement accumulator. Example: CMA (if A = 0x55, Example: RRC (if A = 0x85, after execution A = 0xC2 and Carry
after execution A = 0xAA). = 1).
20. Explain CMP, PUSH, POP instructions with the help of RAR: Rotate accumulator right through carry with carry.
suitable example.
Example: RAR (if A = 0x85 and Carry = 1, after execution A =
CMP: Compare register with accumulator. 0xC2 and Carry = 1).
Example: CMP B (if A = 0x10 and B = 0x10, the Zero flag is 22. Explain conditional and unconditional jump instructions
set).
with the help of suitable example.
PUSH: Push register pair onto stack.
Unconditional Jump: Jumps to the specified address
Example: PUSH H (if HL = 1234H and SP = 3000H,
unconditionally. Example: JMP 2000H (jumps to address
after execution SP = 299EH and memory locations 299F, 299E 2000H).
contain 34H, 12H respectively).
Conditional Jump: Jumps to the specified address based on
POP: Pop register pair from stack.
the status of flags. Examples:
Example: POP D (if SP = 299EH and memory locations 299F
JZ: Jump if zero. Example: JZ 2000H
(jumps to address 2000H if Zero flag is set). EI (Enable Interrupts): Enables all interrupts. Example: EI
JNZ: Jump if not zero. Example: JNZ 2000H (enables interrupts, allowing interrupt requests to be
(jumps to address 2000H if Zero flag is not set). recognized).
JC: Jump if carry. Example: JC 2000H 25. What do you mean by memory interfacing in 8085?
(jumps to address 2000H if Carry flag is set). Explain with the help of suitable example.
JNC: Jump if not carry. Example: JNC 2000H (jumps to address Memory interfacing in the 8085 microprocessor involves
2000H if Carry flag is not set). connecting
23. What is the difference between SIM and RIM external memory chips to the microprocessor so that it can
instruction? read from
SIM (Set Interrupt Mask): Used to mask/unmask hardware and write to memory locations. This is done using address
interrupts lines, data
and send serial output data. lines, and control signals (RD, WR, and ALE).
Example: SIM (sets the interrupt masks and sends serial Example: To interface an 8KB RAM with the 8085:
output). Connect the address lines (A0-A12) of the microprocessor to
RIM (Read Interrupt Mask): Used to read the status of the
interrupt address lines of the RAM.
lines and serial input data. Example: Connect the data lines (D0-D7) of the microprocessor to the
RIM (reads the interrupt status and serial input data). data
24. What is the difference between DI and EI instruction? lines of the RAM.
DI (Disable Interrupts): Disables all interrupts except the Use the RD and WR control signals from the microprocessor
to
TRAP. Example: DI (disables interrupts, preventing any
interrupt control the read and write operations of the RAM.
requests from being recognized). Use an address decoder to generate chip select (CS) signals
for
the RAM based on the address range it occupies. For An interrupt is a signal to the processor emitted by hardware
instance, or software
if the RAM is mapped to the address range indicating an event that needs immediate attention.
• Software Interrupts: These are instructions in the
program. In 8085, there are eight software interrupts:
RST0 through RST7.
27. Consider a system in which the available 64KB • Hardware Interrupts: These are signals generated by
memory space is equally divided external devices. In 8085, there are five hardware
interrupts: TRAP, RST7.5, RST6.5, RST5.5, and INTR.
between EPROM and RAM and interfaced with 8085 • Maskable Interrupts: These can be enabled or disabled
microprocessor. What will be the using the EI (Enable Interrupts) and DI (Disable
Interrupts) instructions. Examples: RST7.5, RST6.5,
possible addressing range? RST5.5, INTR.
In an 8085 microprocessor system, the total addressable • Non-maskable Interrupts: These cannot be disabled.
memory is 64KB (2^16 bytes). If this Example: TRAP.
memory is equally divided between EPROM and RAM, each 29. What are the vectored addresses of all interrupts
will occupy 32KB (2^15 bytes). present in 8085 microprocessor?
• EPROM: Address range: 0000H to 7FFFH the vectored addresses for interrupts in 8085 are as follows:
• RAM: Address range: 8000H to FFFFH • TRAP: 0024H
Thus, the possible addressing ranges are: • RST7.5: 003CH
• RST6.5: 0034H
• EPROM: 0000H to 7FFFH • RST5.5: 002CH
• RAM: 8000H to FFFFH • INTR: Address is supplied externally
28. What do you mean by interrupt in 8085? Explain 30. Explain memory mapped I/O and I/O mapped I/O.
different types of interrupts
• Memory Mapped I/O: In this scheme, I/O devices are
(Software, Hardware, Maskable, and Non-maskable treated as memory locations.
interrupts) in 8085.
• Each device is assigned a unique address in the memory 2. The DMA controller takes control of the bus from
space. The processor uses memory instructions to the CPU.
interact with I/O devices. 3. It transfers data directly between the memory and
• I/O Mapped I/O: Here, I/O devices are given separate the peripheral.
address space. The processor 4. Once the transfer is complete, it returns control of
• uses special instructions (IN and OUT) to access I/O the bus to the CPU.
devices.
33. Write an Assembly Language program to ADD two 8
31. Explain 8255A peripheral interface with Intel 8085. bit numbers using 8085.
The 8255A is a programmable peripheral interface. It has assembly
three 8-bit ports Copy code
(Port A, Port B, and Port C) which can be configured as input MVI A, 56H ; Load first number into
Accumulator
or output ports.
MVI B, 34H ; Load second number into
• Interfacing Steps: register B
1. Connect the data bus of 8085 to the data bus of ADD B ; Add contents of register B
8255A. to Accumulator
2. Connect the control signals (RD, WR, IO/M) HLT ; Halt the program
appropriately. 34. Write an Assembly Language program to SUBTRACT
3. Configure the control word to set the mode of two 8 bit numbers using 8085.
operation for each port.
4. Use IN and OUT instructions to communicate with assembly
the ports. Copy code
MVI A, 56H ; Load first number into
32. Explain briefly the operation of DMA controller. Accumulator
MVI B, 34H ; Load second number into
DMA (Direct Memory Access) controller allows peripherals register B
to directly read/write memory without CPU intervention. SUB B ; Subtract contents of
register B from Accumulator
• Operation: HLT ; Halt the program
1. The peripheral requests DMA transfer by asserting
the DMA request line.
35. Write an Assembly Language program to LXI H, 2000H ; Load address of first 16-
ADD array of 10 numbers using 8085 bit number
assembly LXI D, 2002H ; Load address of second 16-
Copy code bit number
LXI H, 2000H ; Load starting address of MOV A, M ; Load low byte of first
the array number
MVI C, 0AH ; Initialize counter to 10 MOV B, A ; Move it to B
MVI D, 00H ; Initialize sum high byte INX H
to 00 MOV A, M ; Load high byte of first
MVI E, 00H ; Initialize sum low byte to number
00 MOV C, A ; Move it to C
; If A > B SMALLER:
MOV C, A ; Move larger number (A) to MOV C, A ; Move smaller number (A) to
C C
JMP END JMP END
SMALLER: EQUAL:
MOV C, B ; Move larger number (B) to MOV C, A ; Numbers are equal, move
C either to C
JMP END
END:
EQUAL: HLT ; Halt the program
MOV C, A ; Numbers are equal, move
either to C 39. Write an Assembly Language program to find the
largest number
END:
from a given array of 10 numbers using 8085.
HLT ; Halt the program
assembly
38. Write an Assembly Language program to find smaller LXI H, 2000H ; Load starting address of
between two 8 bit numbers using 8085. the array
assembly MVI C, 0AH ; Initialize counter to 10
MVI A, 56H ; Load first number into MOV A, M ; Load the first number
Accumulator INX H
MVI B, 34H ; Load second number into
register B START:
CMP B ; Compare A with B MOV B, M ; Load the next number
JZ EQUAL ; If A = B, jump to EQUAL CMP B ; Compare with the current
JC SMALLER ; If A < B, jump to SMALLER largest
JC SKIP ; If A < B, skip to SKIP
; If A > B MOV A, B ; Move B to A, as B is
MOV C, B ; Move smaller number (B) to larger
C
SKIP:
INX H ; Increment memory pointer 41.Write an Assembly Language Program to find out 1’s
DCR C ; Decrement counter & 2’s complement of an 8 bit number.
JNZ START ; If counter not zero,
repeat assembly
MVI A, 56H ; Load the number into
HLT ; Halt the program Accumulator
o Manages data transfers. 47.What are the different modes of operation in 8086
• Execution Unit (EU): microprocessor?
o Decodes and executes instructions.
Memory Size 64KB 1MB • Status Flags: Carry (CF), Parity (PF), Auxiliary Carry (AF),
Zero (ZF), Sign (SF), Overflow (OF).
Instruction Set Less powerful More powerful • Control Flags: Trap (TF), Interrupt Enable (IF), Direction
Clock Speed Up to 3 MHz Up to 10 MHz (DF).
Multiprocessing Not supported Supported (Max Mode) Example: After an addition operation, if the result is zero, the
ZF is set.
Pin Count 40 pins 40 pins
assembly
Copy code
56. Explain the functions of internal registers of 8051 57. What do you mean by Flag register in 8051
microcontroller. microcontroller? Explain with the help of a suitable
example.
The 8051 microcontroller has several internal registers that
serve various functions essential for its operation: In the 8051 microcontroller, the Flag Register is also known
as the Program Status Word (PSW).
• Accumulator (Acc): It is an 8-bit register used for
arithmetic, logic, and data manipulation operations. It contains various flags that reflect the results of arithmetic
and logical operations performed by
the microcontroller's ALU (Arithmetic Logic Unit). These 58. Explain the functions of PSEN and EA pins in 8051
flags include: microcontroller.
• CY (Carry): Set if there's a carry out of the MSB (most • PSEN (Program Store Enable):
significant bit) in arithmetic operations or borrow in • Function: PSEN is used during external program memory
subtraction. accesses. It is activated (low)
• AC (Auxiliary Carry): Used for BCD (Binary Coded • when the microcontroller fetches instructions from
Decimal) arithmetic to indicate carry between lower and external program memory (such as ROM).
higher nibbles. • Usage: Typically used to fetch program instructions
• F0, F1 (User-definable Flags): Reserved for user- during the execution phase from external ROM
defined purposes. locations.
• OV (Overflow): Indicates overflow in signed arithmetic • EA (External Access):
operations.
• Function: Determines the source of program memory
Example: for the microcontroller.
• Modes:
Consider an addition operation in which the result exceeds the • EA = 0: Microcontroller fetches program instructions
maximum value representable in an 8-bit register: from internal ROM (built-in program memory).
assembly • EA = 1: Microcontroller fetches program instructions
Copy code from external memory (program memory is
MOV A, #250 ; Load accumulator with • external, typically connected via address and data
250 buses).
ADD A, #20 ; Add 20 to accumulator
; After addition, A = 270, which exceeds
8-bit range
; CY flag will be set to indicate the
carry out of MSB