Midterm Exam Microprosser 2021-2022
Midterm Exam Microprosser 2021-2022
معالجات دقيقة:المـــــــــــــادة
ساعتان:الزمه
4. The logic instruction ……. can be used to test if the two registers contain the same value.
(a) AND instruction (b) OR instruction (c) XOR instruction (d) all of these
5. In 8086, The mean of assembly code (DATA1 DT 4DUP(?)) is set aside of……...
(a) 9 words (b) 18 words (c 30 words (d) none of these
6. In 8086, to enable the modules to be linked together, certain directives ……. must be used.
(a) EXTRN (b) XLAT (c) XCHANG (d) EXTRN and PUPLIC
9. …….hold the address of a procedure or variable, and perform arithmetic and data movement
(a) BX register (b) SI register (c) DX register (d) none of these
10. The Call instruction is used to call a procedure and it can be……….
(a) FAR (b) NEAR (c) FAR or NEAR (d) none of these
11. LOCAL directive is used to define label in……...
(a) macro (b) module (c) subroutine (d) none of these
12. In8086, using the DS & DI registers to compute the physical address of the……...
(a) stack segment (b) code segment (c) data segment (d) all of these
1
13. REPZ, will repeat the string operation as long as the source and destination are………
(a) not equal (b) equal (c) ZF =0 (d) CX = 0
14. STOSW instruction is stored the byte in ………. register into memory locations pointed at by ES:DI.
(a) DL (b) AL (c) CL (d) none of these
15. The conditional branch instruction JB performs the operations when if …….
(a) ZF =0 (b) CF=1 (c) ZF=1 (d) CF=0
16. In 8086, the following assembly code (mov [29H],AL) is…..
(a) valid (b) invalid (c) none of these
17. What is the output of the following code REPE CMPSB
(a) repeat as long as not equal or CX=0 (b) repeat as long as equal and CX=1
(c) repeat as long as not equal and ZF=0 (d) repeat as long as equal or ZF=1
18. Number of the times the instruction sequence below will loop before coming out of loop is
A1: MOV AL, 0FH
A2: MOV CL, 05H
LOOP A2
DEC AL
JNZ A2
(a) 16 (b) 80 (c) 255 (d) none of these
19. What is the output of the following code
STC
MOV AL,15H
MOV CL,2
RCL AL, CL
(a) AL=01010110, CF=0 (b) AL=01010111, CF=1 (c) AL=01100101, CF=1 (d) AL=01010110, CF=1
20. In CMP instruction, if the destination operand is smaller than the source operand then………
(a) CF=0 & ZF=0 (b) CF=1 & ZF=1 (c) CF=1 & ZF=0 (d) CF=0 & ZF=1
Q3: Answer only for two parts from the following:
a) In 8086, write an assembly code to input the user name from the keyboard. If the user is typed
the ‘communication’ it will output ‘The username is valid’ else it will output ‘Invalid user name’.
b) In 8086, write an assembly code to find factorial of 09H.
c) In 8086, write assembly code to perform the following:
1. Calculate the number of letters in any string (small letters) was inputted by keyboard.
2. Convert this string into capital letters.
3. Output the results of part (1) and (2) to the monitor.
d) In 8086, write assembly program to perform the following:
1. Add the values (B1H, 02H)
2. Multiply the values (B1H, 02H)
NOTE: the add and multiply should be performed by separate module. The data is defined in the
main module, and the add and multiply modules have no data segment.
GOOD LUCK