COMSATS University Islamabad, Abbottabad Campus
Department of Electrical and Computer Engineering
Mid Term Fall 2022
Class: EPE-5B Date: Nov 18, 2022
Subject: MSI Instructor: Sahibzada Aasim
Time Allowed: 1hr 10 Minutes Max Marks: 35
Name:___________________________ Registration #______________
Course Learning Program Learning Domain /
Question Objective Objective Level Justification
(CLO) (PLO)
1 CLO-0 PLO-0 - MCQs
2 CLO-1 PLO-1 C1 Machine code
3 CLO-2 PLO-1 C3 Assembly Programming
4 CLO-2 PLO-1 C3 Data Transfer/Assembly
SECTION-A
(Time allowed: 10 minutes) (Marks: 10)
1. MCQs
1. The format for MOVF command is ______.
a. MOVF filereg, filereg
b. MOVF filereg,d
c. MOVF filereg,w
d. MOVF filereg,f
2. The format for MOVFF command is ______.
a. MOVFF filereg, filereg
b. MOVFF filereg,d
c. MOVFF filereg,w
d. MOVFF filereg,f
3. In the PIC microcontroller, the data memory is called ___________
a. SFR
b. GPR
c. File Register
d. WREG
4. The SFR’s in PIC 18 are 16-bit wide
a. True
b. False
1
5. The file register space in PIC18 is divided into 128-byte banks
a. True
b. False
6. After the DECF instruction, the result will be stored in
a. File Register
b. WREG
c. both a and b
d. a or b
7. GOTO instruction is a _____ byte instruction
a. 1
b. 2
c. 3
d. 4
8. PIC18f452 takes ________ clock periods to execute an instruction
a. 1
b. 2
c. 3
d. 4
9. The contents of WREG after the execution of MOVLW .1234 will be
a. 1234D
b. 12H
c. 34H
d. D2H
10. The maximum number of times a loop via a counter can run is ______
a. 256
b. 255
c. 16
d. 65025
2
SECTION-B
(Time allowed: 1 hr) (Marks 25)
Name: ___________________________ Registration #______________
2. Recall the knowledge of Machine Code Conversion to answer the following questions: [8+4]
1. Convert the following assembly language instructions into equivalent machine code:
MOV CX, [BX][DI] + 1248H
MOV AX, BX
2. Given the following machine code, what will be its equivalent assembly language
instruction? 1000101111001010
3. Apply the instruction set of 8086 microprocessors to write down an assembly language program
that will perform the following task: [7]
Move any 16-bit value into Register AX, your program should count the number of 1’s in this
value. The result should be stored in Register BX. For example, if you move the value 4100H
into AX, then the result in BX should be 2, as there are only two 1’s in 4100H
(0100000100000000).
Similarly, if the value moved in AX is FFH then the result in BX should be 8.
4. Interpret the contents of Register CX, after the execution of the following Programs: [3+3]
1. MOV [1000H] , 4488H
INC [1001H]
MOV CL , [1001H]
2. MOV [1000H] , 4488H
INC [1000H]
MOV CL , [1000H]