Microcomputers and Interfacing Final Exam Answer Key
Microcomputers and Interfacing Final Exam Answer Key
1. C
1. C0000H
2. C
2. 20 bits
3. A
16 bits
4. B
3. 32 bits
5. A
4. AL = FFH
6. C
CF = Unaffected
7. D
8. C
9. F
10. F
Descriptive Questions (15%)
1. Pointers and Index registers are used to keep offset addresses.
a. Index Registers
I. SI-Source Index Register: By default, it keeps offset address relative to DS.
In string operations, it points to memory location in the data segment which
addressed by the DS register.
II. DI-Destination Index Register: By default, it keeps offset address relative to
DS. However, in string operations, DI points to memory location in the extra
segment which is the destination segment in string operations addressed by ES
register.
b. Pointer Registers
I. BP- Base Pointer Register: keeps offset address relative to SS.
II. SP- Stack Pointer Register: Keeps offset address relative to SS. It always
points to top item on the stack. For empty stack, SP will always have FFFEH
value.
2. Main components of Execution Unit are:
a. Instruction Decoder: Translates instructions fetched from memory into a series of
actions which EU carries out.
b. Control System: Generates timing and control signals to perform the internal
operations of the microprocessor (Directs the internal operations)
c. Arithmetic Logic Unit: EU has a 16-bit ALU which can ADD, SUBTRACT, AND,
OR, increment, decrement, complement or shift binary numbers.
d. Register Organization:
I. General Purpose Registers: AX, BX, CX, DX:
are used to store temporary data in the time of different operations in
microprocessor (AX, BX, CX, DX).
Can also be used as a Counter (CX).
Used for storing offset addresses for some particular addressing modes
(BX).
II. Pointers and Index Registers: see above
III. Flag Register: a flip-flop which indicates some condition produced by the
execution of instruction or controls certain operations of the EU (Execution
Unit)
Conditional flags: six flags, set or reset by EU on the basis of results
of some arithmetic operations
Control flags: three flags, used to control certain operations of the
processor
3. Machine Language Vs. Assemble Language, Sr. No 1, 5 and 6.
5. Program addressing mode is required for instructions that cause a branch in the program
(JMP & CALL instructions)
Types of program addressing Mode:
a. Intrasegement addressing mode: If the branch is within the segment, it is called
as an Intra-Segment Branch or a Near Branch. only IP changes, CS doesn’t
change. Two types of Intrasegment modes
I. Intra-Segment Direct Addressing Mode: Address where to transfer
program control is specified directly in the instruction as an 8-bt (16-bit)
displacement.
II. Intra-Segment Indirect Addressing Mode: Address where to transfer
program control is specified indirectly in the instruction through a register
or a memory location (in DS only)
b. Intersegment addressing mode: If the branch is in a different segment, it’s
called as an Inter-Segment Branch or a Far Branch. Both CS and IP get new
values.
I. Inter-Segment Direct Addressing Mode: The new branch location is
specified directly in the instruction.
II. Inter-Segment Indirect Addressing Mode: The new branch location is
specified indirectly in the instruction through a register or a memory
location (in DS only)
Workout (20%)
1. Givens:
CX: Undefined
Data Segment and Stack Segment
6. To show the steps clearly we need to go through all lines one by one.
Given Program:
I. MOV AX, 39h
II. MOV BX, 35h
III. ADD AX, BX
IV. AAA
The steps: