Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
1K views2 pages

Microprocessors Midterm Exam

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Name:

Department: Date : 01 JAN 2018

MICROPROCESSORS
Midterm Exam
Instructor: Ebrahim Alssrary

Read the Following Instructions Carefully:


1. The duration of the exam is strictly 120 minutes. No extra time will be given.
2. You are allowed to ask questions regarding the exam questions during the first 45 minutes only.
3. Answer each question to a separate sheet on your answers booklet. and write final result side the questi

QUESTIONS
-------------------------------------------------------------------------------------------------------------------------------
1. Complete the sentences :
a. CF will be set to 1 in a 16-bit ADD if there is a carry out from bit …………………….
b. The CF will be set to 1 in an 8-bit ADD if there is a carry out from bit…………………
c. The ADD instruction can effect which bits of the flag register …,…..,….,…..and……..
d. A segment is an area of memory that includes up to …………………………………….
e. A physical address is a……… bit address; an offset address is a…………… bit address
f. Every macro must start with directive ………. And end with directive …..

2. a. How large is a segment in the 8086?


b. can the physical address 346E0 be the starting address for a segment ? why ?
…………………………………………………………………………………………
c. If BX=1234H and the instruction ‘MOV[2400],BX’ were execute what would be the
contents of memory locations at offsets 2400 (…….)and 2401(…..)?
d. Assume that the physical address for a location is 0046CH.Suggest a possible logical
address……………………………………………………………………………..

3. a. Find the status of the CF,PF,AF,ZF and SF for the following operations
MOV BL,9FH MOV AL,23H MOV DX,10FFH
ADD BL,61H ADD AL,97H ADD DX,1
b. How many bytes are defined by the following?
DATA_1 DB 6 DUP (4DUP(0FFH)
c. Correct the error: ADD DATA_1,DATA_2
4. Give the addressing mode for each of the following :
a. MOV AX,DX c. MOV DX,[BP+DI+4] e. MOV AL,[BX]
b. MOV [BP][SI]+12,AX d. MOV CX,[3000]
5. Show the contents of the memory locations after the execution of each instruction.
a. MOV BX,129FH b. MOV DX,8C63H
MOV[1450],BX MOV [2348],DX
DS:1450 ……… DS:2348…………
DS:1451….. …. DS:2349………….
6. State the difference between the following two instructions:
a. MOV BX,DATA1 b. ADD AX,BX
MOV BX,OFFSET DATA1 ADD AX,[BX]
7. How many bytes are set aside by each of the following directives?
a. ASC_DATA DB ‘1234’ b. HEX_DATA DW 1234H
…………………………………………………………………………………………….
8. a. If CF=1,AL=95,and BL=4F prior to the execution of ‘SBB AL,BL’,what will be the
contents of AL after the subtraction ?
b. Fill in the blanks in the following program ,which clears the screen . write comments on
each line stating the purpose of each line of code .
MOV AH,…..
MOV AL,…..
MOV BH,…..
MOV CH,…..
MOV CL,…..
MOV DH,…..
MOV DL,……
INT 10H

9. What is the total value in registers DX and AX after invoking the following macro?
WAGES MACRO SALARY,OVERTIME,BONUSES
;TOTAL WAGES=SALARY+OVERTIME+BONUSES
SUB AX,AX
MOV DX,AX
ADD AX,SALARY
ADD AX,OVERTIME
ADC DX,0
ADD AX,BONUSES
ADC DX,0
ENDM
The macro is invoked as WAGES 60000,25000,3000

10. Find the overflow flag for each case :


a. 15-12 b. -127+127 c. -123-127 d.1000-1000 e.25h+34
11. Develop a sequence of instructions that will;
a) toggle (invert) the most significant nibble and the least significant nibble of AX.
b) clear the least significant bit and set the most significant nibble of BX

12. a. Write an assembly language program to perform the following function.


R=((X-7)*(Y+3))/Z
b. Fill blankets of control register after execution theses instructions:

MOV AL,77
MOV DX,303H

You might also like