Ceng 280 F s00 (Sample)
Ceng 280 F s00 (Sample)
Ceng 280 F s00 (Sample)
TIME ALLOWED: 2 HOURS INSTRUCTIONS: Number of problems on paper-6. FIVE problems ONLY to be answered. ALL problems carry equal marks. Show ALL steps for full credit. Write neatly.
Problem 1
Write a program that reads 2,3, or 4 from the keyboard. If 2,3, or 4 is typed a 2,3, or 4 should be displayed. [20p]
Problem 2 a) Write a near procedure to solve the quadratic equation Y= 4 X2 + 2X - 3, where the value of X is stored in AL and the result of the equation (Y) is returned in AX.
[12p]
b) Develop a short sequence of instructions that stores a OOH into 150H of memory beginning at extra segment memory location DATA. You must use the LOOP instruction to help perform this task. [8p]
Problem 3 The block diagram of the architecture (internal organisation) of an 8088 microprocessor is shown below. a. Explain the basic operation of the EU and BIU units. [4p]
b. Briefly explain the operation of the following: I. General registers II. Pointer and Index registers III. Flags IV. Segment Registers V. Instruction pointer VI. block
[12p]
c. What are the major differences between 8088 and 8086 microprocessors. [4p]
Problem 4 a) For the short program listed below: I. Write appropriate comments for each line of the program. [4p] II. Give a brief explanation of the function performed by the program. [2p]
III.
What is the purpose of the statements beginning with an asterisk (*) in the listing? [2p]
b) I. Explain what the JMP AX instruction accomplishes. Also identify it as a near or a far jump instruction. [2p] II. Which type of JMP instruction (short, near, or far) assembles for the distance 002OH bytes? [2p] When does the JCXZ instruction jump? [2p]
III. IV.
List the five flag bits tested by the conditional jump instructions. [2p]
c) Explain the operation of the following instructions: I. LOOPD: II. LOOPNE: Problem 5
[4p]
a) I. Develop a sequence of instructions that set (1) the right four bits of AX, clear (0) the left most three bits of AX, and invert bits 7,8, and 9 of AX. [6p]
II.
Develop a short sequence of instructions that set the right most 5-bits of DI without changing the remaining bits of DI save the result in SI. [4p]
b) Assume that AX and BX contain 1234H and 2345H, respectively: I. What is the result of ADD AX, BX? How would this answer compare with ADD BX, AX? [2p]
II.
[3p]
c) I. What CMP instruction is needed to determine if the accumulator contains the value 3B2EH? [2p]
II.
Describe what happens to the status flags (Z, S, C, A, O, P) as the sequence of instructions that follows is executed. Assume that status flags are all initially reset. [3p] MOV AX, 1234H MOV BX, OABCDH CMP AX, BX
II. is it
What does the REP prefix accomplish and with what type of instruction used? [2p]
III. Explain the operation of the direction flag (D) in relation with DI and SI as they apply to the string instructions. [3p]
b) Give a brief description of the function performed by the short program listed below. Write appropriate comments for each line of the program. (0720H: ASCII - coded space = 20H and white text on a black backround=07H) [12p]