0% found this document useful (0 votes)
13 views

Midterm Exam Microprosser 2021-2022

اختبار
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Midterm Exam Microprosser 2021-2022

اختبار
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

)‫ رابع (اتصاالت‬:‫والتخصص‬ ‫المستوى‬

‫ معالجات دقيقة‬:‫المـــــــــــــادة‬

‫ ساعتان‬:‫الزمه‬

‫الهندسة الكهربائية‬: ‫القسم‬


:‫الزمــــــــــــه‬
Q1: Mark the following statement or code as either True (T) or False (F):
1) The assembler is used to transfer the high-level code to assembly code.
2) In 8086, all memory locations as a bit addressable.
3) The ASCII system uses 8 bits to represent each code.
4) In 8086, the flag register contains only information reflecting the status of a microprocessor .
5) The control bus determines the capability of the CPU.
6) The instruction MOV CL, [0123H] indicates register direct addressing mode.
7) If CS = FFF6H and IP = 636AH, then the lower range of the code segment is FFF60H
8) If a byte push into the stack, then the SP decrement by 1.
9) In 8086, the following assembly code is valid (MOV ES,E3H).
10) INCLUDE directive, allows a programmer to write modules and save them in a file and later bring
them into any file or program.
Q2: Choose the correct answer for the following:
1. 3 Mega Byte of memory is equal………………..
(a) 3072 bytes (b) 3145728 bytes (c) 98304 bytes (d) none of these
2. If CPU has …….. buses, it could access 4096 byte.
(a) 16 address (b) 14 address (c) 12 address (d) none of these
3. In 8086, Point to the address of the next instruction to be executed.
(a) Flag register (b) IP register (c) DX register (d) none of these

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

7. ……. is used to transform the assembly code to machine code.


(a) compiler (b) assembler (c) linker (d) none of these

8. In 8086, using the …………… to display a string on the screen.


(a) INT 21H & option 0A (b) INT 21H & option 02 (c) INT 10H & option 09 (d) none of these

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

Dr. Mohammed Alolofi

You might also like