Micro Assignment 5
Micro Assignment 5
(5
Marks)
Assembler directives guide the assembler on how to process the source code. They are not
executable instructions but help in organizing the code. Six common directives:
3. Explain the function of (i) Editor, (ii) Assembler, (iii) Linker, (iv) Debugger.
(5 Marks)
Editor: A software tool to write and edit source code (e.g., Notepad++, Turbo
Editor).
Assembler: Converts assembly language code into machine code (.obj files).
Examples: TASM, MASM.
Linker: Combines object files and resolves addresses to create a final executable file.
Debugger: Helps trace and fix logical and runtime errors by allowing step-by-step
execution.
4. Discuss difference between I/O Mapped I/O interfacing and Memory
Mapped I/O interfacing. (5 Marks)
5. Explain block diagram of 8255 and explain its different modes of operation.
(10 Marks)
Modes of Operation:
The control word (for I/O mode) is an 8-bit data written to the control register to configure
the ports:
Bit Function
D7 Mode Set Flag (1 = I/O Mode)
D6-D5 Group A Mode Selection (00-11)
Bit Function
D4 Port A Direction (1 = Input)
D3 Group B Mode Selection (0/1)
D2 Port B Direction
D1 Port C Upper (PC7-PC4) Dir
D0 Port C Lower (PC3-PC0) Dir
8. Write an ALP using directives to find even and odd numbers from the given
array. (5 Marks)
LEA SI, ARRAY
MOV CX, 05
REPEAT:
MOV AL, [SI]
TEST AL, 01 ; Check LSB
JZ EVEN
; Handle ODD
JMP SKIP
EVEN:
; Handle EVEN
SKIP:
INC SI
LOOP REPEAT
9. Explain the different hand shake signals in mode 1 of 8255 interface for
input and output device interfacing both. (10 Marks)
Input Handshaking:
10. Explain block diagram of 8253/8254 and explain its different modes of
operation. (10 Marks)
Modes:
1. Mode 0 (Interrupt on Terminal Count): Counter decrements and sets OUT high on
zero.
2. Mode 1 (Hardware Retriggerable One-Shot): OUT goes low on GATE, high after
count.
3. Mode 2 (Rate Generator): Periodic low pulse output.
4. Mode 3 (Square Wave Generator): Generates square wave output.
5. Mode 4 (Software Triggered Strobe): Single low pulse after count.
6. Mode 5 (Hardware Triggered Strobe): Similar to Mode 4, but triggered via GATE.
Bit Description
D7-D6 Counter Select (00: Counter 0, etc.)
D5-D4 Read/Write (00 = Latch, 11 = LSB+MSB)
D3-D1 Mode Select (000 to 101)
D0 BCD/Binary Mode (0 = Binary, 1 = BCD)
12. Write a program to generate a square wave of 1 KHz using 8253 timer.
Assume the clock frequency of 8253 is 2 MHz. (10 Marks)
Required Count: 2MHz / (2*1kHz) = 1000 = 03E8H
Components:
Components:
Features:
Memory-to-memory transfer
Automatic address increment/decrement
Priority control
Cascade for expansion