Professional Documents
Culture Documents
M 2021
M 2021
Q1. (20 %) Write an assembly language program to compute number of successful in a class of 50 students.
.MODEL small
.STACK 100H
.DATA
A DB 12h, 26h, 33h, 40h, 35h, ....
B DB ?
.CODE
START: MOV AX, SEG A
MOV DS, AX
MOV SI, OFFSET A
MOV CX, 0032h
XOR AX, AX
NEXT : MOV AL, [SI]
CMP AL, 32h
JC NEXT2
INC AH
NEXT2 INC SI
LOOP NEXT
MOV B, AH
MOV AH, 4Ch
INT 21h
END START
Q2. (10 %) If CS = 1111 and IP = 0100, determine logical, physical, segment, and offset addresses.
Logical address 1111:0100
Segment address 1111
Offset address 0100
Physical address 1111 * 16 + 0100 = 11210
Q3. (10 %) Explain briefly the function and components of 8086 execution unit .
EU execute instruction received from IQ
ALU performs arithmetic and logic operations
Eight registers
Control unit
Q4. (10 %) What are the differences between JMP and CALL instructions?
JMP CALL
Target address inside/outside main program outside main program
Return address no yes
Type unconditional and conditional unconditional
Q5. (15 %) Show the error in following instructions and fix it:
Q6. (10 %) Draw block diagram of the circuit to demultiplex address/data bus.
1. Produce small size program which can be run faster than compiler-based generated code.
2. Allows direct access to hardware.
3. Helps to understand of how computers work.