You are on page 1of 2

Daffodil International University

Department of Computer Science and Engineering


Faculty of Science & Information Technology
Final Exam Examination, Fall 2020 @ DIU Blended Learning Center
Course Code: CSE231 (Day+Eve), Course Title: Microprocessor and Assembly Language
Level: 2 Term: 3 Section: R1 and Eve-O1
Instructor: FA Modality: Open Book Exam
Date: Thursday 20 December, 2020 Time: 06:30am-10:30pm
Four hours (4:00) to support online open/case study based assessment Marks: 40
Directions:
 Students need to go through the CASE STUDY shown in this exam paper.
 Analyze and answer specific section based on your own thinking and work.
 Do not share as this will be treated as plagiarism by Blended Learning Center.

1 a Write a program that prompts the user to enter a binary number and prints the 5
binary number in reverse on the next line.
Example: Type A Number: 10100011
The number in reverse is: 11000101

b Write assembly code for each of the high level language assignment statements: 2*2.5=5
a. A = (B X 5) – (C X 4)
b. B = (A + C) / (C)

2 a Suppose BL contains 11101100 b and CF = 0. Give the new contents of BL and CF after 5
each of the following instruction is executed sequentially:

i. SHL BL, CL; where CL = 2


ii. SAR BL, 3
iii. ROL BL, 2
iv. RCR BL, CL; where CL = 3
v. SAL BL, CL; where CL =2

b Give the assembly instructions to do each of the followings 5


(i Clear the odd number bit of BX, leaving the other bits unchanged.
(ii Complement the 7th and 8th bits of BX, leaving the other bits unchanged.
(iii Set the even bits of AX, leaving the other bits unchanged.
(iv) Change the 0th bit of AX.
(v) Set LSB of BX.

3 a Use PROCEDURE to write an assembly code to do the following: 5


i. Read a character
ii. Create a procedure LOWER. If AL contains 1 or 3, display “Odd”
iii. Create another procedure UPPER. If AL contains 2 or 4, display
“Even”
iv. Otherwise terminate the program.

b Suppose AX = ABCD h, BX = EF12 h, CX = A12F h and SP = 1000 h. Give the 5


contents of AX, BX, CX and SP after executing the following instructions:
PUSH CX
PUSH BX
XCHG AX, BX
POP AX
PUSH BX
POP CX
4 a Write a program to read characters until a * is read. 2

b Suppose DX contains 00F7h, AX contains FFF2h and BX contains FFF2h. Now 8


implement the following instructions with mentioning the status of CF/OF.
i. MUL AX
ii. IMUL DX
iii. DIV BX
iv. IDIV BX

You might also like