Micro Processor and Micro Controlle1
Micro Processor and Micro Controlle1
CONTROLLER
CIE 2 QUESTION BANK WITH ANSWERS
SET 1
2 MARKS
Pipelining
• While EU executes instructions, BIU fetches instructions from memory and stores them in the
QUEUE.
2. Analyze difference between the instructions MOV AX, 2437H and MOV AX, [2437H]
MOV AX, 2437H: Is immediate addressing mode in which the data operand is a part of the
instruction itself. And so, it Moves the 16 bit number 2437H into accumulator.
MOV AX, [2437H]: It is a Direct addressing mode which the effective address of the memory
location is written directly in the instruction. And it moves the 16 hit numbers present in the
memory location whose address is represented by the offset 2437H.
5. Determine the command word to set keyboard/display mode for encoded scan
Bit Value Description
D7 0 Keyboard/Display mode
D3 1 Enable display
D2 1 N-key rollover
D1 0 16 characters
D0 1 16 characters
6. Identify the type of communication adopted in hello FM radio. Justify your answer.
Hello FM radio, like other FM (Frequency Modulation) radio stations, adopts analog
communication for its broadcasting.
Key Characteristics of Analog Communication in FM:
• Frequency Variations: The core principle of FM is that it varies the frequency of the
carrier wave based on the analog input signal, indicative of analog communication.
5 MARK
7. Write a program to move a string 200 bytes long from the offset address 1000H to
the offset address 3000Hin the segment 5000H.
MOV SI,1000H
MOV DI,3000H
MOV AX,200
MOV DS.AX
MOV ES,AX
MOV CL,[SI]
MOV CH,00
INC SI
CLD
REP
MOV SB
HLT
8. What are the functions performed by port-C of 8255.
BSR MODE-
The two basic modes are selected by D7 bit of control register.
When D7=1 it is an I/O mode and when D7=0;
BSR mode.
• The BSR mode is a port C bit set/reset mode.
• The individual bit of port C can be set or reset by writing control word in the
control register.
• The pin of port C is selected using bit select bits [b b b] and set or reset is decided
by bit S/R.̅
• The BSR mode affects only one bit of port C at a time. The bit set using BSR mode
remains set unless and until you change the bit. So to set any bit of port C, bit pattern
is loaded in control register
. • If a BSR mode is selected it will not affect I/O mode.
Port C Functions:
• PC0, PC1, PC2: Handshaking and status signals for Port B.
o PC0: Input/output ready (STB or IBF)
o PC1: Acknowledge (ACK)
o PC2: Input/output ready (INTR)
• PC3, PC4, PC5:
Handshaking and status signals for Port A. o PC3:
Input/output ready (STB or IBF) o PC4:
Acknowledge (ACK) o PC5: Input/output ready (INTR)
• PC6, PC7:
These bits are often left unused or can be used for general-purpose I/O.
7 MARKS
9. Explain the various addressing modes used in 8086 microprocessor with suitable
examples.
1. Immediate Addressing Mode
• Description:
The operand is specified directly in the instruction.
• Example: MOV AX, 1234H o Here, the immediate value 1234H is moved directly
into the AX register.
2. Register Addressing Mode
• Description: The operand is a register and the data is in the register.
• Example: MOV AX, BX o This instruction moves the content of register BX into
register AX.
3. Direct Addressing Mode
• Description: The effective address of the operand is given directly in the
instruction.
• Example: MOV AX, [1234H] o This instruction moves the data from memory
location 1234H into the AX register.
4. Register Indirect Addressing Mode
• Description: The operand's effective address is stored in a register.
• Example: MOV AX, [BX] o This instruction moves the data from the memory
location pointed to by BX into the AX register.
5. Indexed Addressing Mode
• Description: The effective address of the operand is obtained by adding a constant
displacement to an index register.
• Example: MOV AX, [SI + 1234H] o Here, the effective address is the sum of the
content of SI register and 1234H. The data from this computed address is moved into
AX.
6. Base-Indexed Addressing Mode
• Description: The effective address is obtained by adding the contents of a base
register and an index register.
• Example: MOV AX, [BX + SI]
o This instruction adds the contents of BX and SI registers to get the effective address
from which data is moved into AX.
7. Base-Indexed with Displacement Addressing Mode
• Description: The effective address is obtained by adding a base register, an index
register, and a constant displacement.
• Example: MOV AX, [BX + SI + 1234H]
Here, the effective address is calculated by adding the contents of BX, SI, and the
displacement 1234H. The data from this computed address is moved into AX.
8. Relative Addressing Mode
Description:
The effective address is determined relative to the current value of the instruction
pointer.
• Example: JMP SHORT LABEL
o This jumps to the address specified by LABEL, which is calculated relative to the
current value of the instruction pointer IP.
• Description: The operand is implied by the instruction itself, rather than being
explicitly stated.
Example: CWD o This converts the word in AX to a double word in DX:AX. The
operands AX and DX are implied.
10. Describe the various modes of operation in 8253 programmable interval timer.
8253/54 can be operated in 6 different modes. In this chapter, we will discuss these operational
modes.
These instructions are used to perform arithmetic operations like addition, subtraction,
multiplication, division, etc.
https://www.rcet.org.in/uploads/academics/rohini_83318880820.pdf
13.Design a programmable timer using 8253 and 8086. Interface 8253 at an address of 0040H for
counter 0 and write the following ALPs. The 8086 and 8253 run at 6 MHz and 1.5 MHz respectively.
(i) (ii) To generate a square wave of period 1ms. To interrupt the microprocessor after 10ms. To
derive a monoshot pulse with quasi-stable state duration of 5ms.
i) MOV AL,37H
OUT 46H,AL
MOV AL,00
OUT 40H,AL
MOV AL,15
OUT 40H,AL
HLT
OUT 46H,AL
MOV AL,98H
OUT 42H,AL
MOV AL,3AH
OUT 42H,AL
HLT
OUT 46H,AL
MOV AL,4CH
OUT 44H,AL
MOV AL,1D
OUT 44H,AL
HLT
14. Design a microprocessor system for the 8085 microprocessor such that it should contain 4
Kbyte of EPROM and 2 Kbyte of RAM using two 2 Kbytes of EPROMs and two 1 Kbytes RAM. Draw
the complete interfacing diagram with appropriate chip select logic used.
15. Design an interface between 8086 microprocessor system and two 8K x 8 RAM memory
chips (6264) and two 8K x 8 EPROM memory chip. Select the starting address of EPROM
suitably. Assign the address range 80000H to 87FFFH for RAM and use two 74138 ICs decoder.
(ASSIGNMENT 3RD QUESTION)
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 1 0 0 0
• ORG 100H:
• MOV DX, 83H
• MOV AL, 98H:
• OUT DX, AL:
• INT 20H:
SET 2
2 MARKS
17. Compare the flags available in 8086 with 8085.
• Common Flags: Both processors share some common flags like Sign, Zero, Auxiliary Carry, and
Carry flags.
• Additional Flags in 8086: The 8086 introduces flags like Overflow, Direction, Interrupt, and Trap
flags, which provide additional control and status information compared to the 8085.
• Purpose and Usage: The flags in each processor are used for status reporting (like zero or non-zero
results, carry, overflow) and control (like enabling interrupts, direction of string operations).
18. Classify the addressing modes of 1) MOV AX, 55H (BX) (SI) , 2) MOV AX, [2437H]
• Addressing Modes: Base Register (BX), Index Register (SI), Immediate (55H).
• Usage: Directly accesses the memory location 2437H to load data into AX
Bits Description:
• D5-D4: I/O Control for Port C (PC0 to PC7). 00 for PC0-PC7 as output.
• D3-D2: I/O Control for Port B (PB0 to PB7). 00 for PB0-PB7 as output.
• D1-D0: I/O Control for Port A (PA0 to PA7). 00 for PA0-PA7 as output.
• G1-G0: Mode selection bits for all three ports. 00 for mode 0 operation (basic input/output mode).
21. Determine the program clock command word if external clock frequency is 2 MHz.
Desired outputfrequency:1kHz
2MHz/1kHz=2000000/1000=2000
22. Calculate the number of memory chips needed to design 1K byte memory if the memory chip
size is 1024x4?
• Calculate Total Storage Requirement:
• Determine how many 1024x4 memory chips are needed to store 8,192 bits.
5 MARK
23. Write an 8086 ALP to find average of two numbers.
MOV SI,500
MOV DI,600
MOV AX,0000
MOV CL,[SI]
MOV BL,CL
INC SI
ADD AL,[SI]
ADC AH,00
INC SI
DEC CL
JNZ 40E
DIV BL
MOV[DI],AX
HLT