d. What are the correct values of the Carry, Zero, and Sign flags after the following instructions execute? (6 points, 3 pts each)
i. mov al, 6 cmp al, 5 ; CF = ZF = SF =
ii. mov al,00110011b test al,2 ; CF = ZF = SF =
Question # 2. Short Programming Problems (25 points)
a. Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged. (5pts)
b. Write a sequence of two instructions that copies the integer in bits 4-7 from the AL register into bits 0-3 of the BL register. The upper 4 bits of AL will be cleared, as will the upper 4 bits of BL. . (5pts)
3 c. Code instructions that jump to the label L1 when either bit 2 or 3 is set in the DL register (do not modify DL). (5pts)
d. Write instructions that implement the following pseudo-code using conditional jump instructions. Do not use the .IF directive. Assume that integers are signed. (5pts)
if (eax > ecx ) mov dl, +7 else mov dl, -2
e. Implement the following pseudo-code with assembly language statements without using the .WHILE, the .IF or any other directive. (5pts)
6 Question # 5. Programming (10 points) --- use the back of the page if needed ----
Using the following table as a guide, write a program that asks the user to enter an integer test score between 0 and 100. The program should display the appropriate letter grade:
Score Range Letter Grade 90 to 100 A 80 to 89 B 70 to 79 C 60 to 69 D 0 to 59 F
Hint: You may use the pseudo .IF, .ELSEIF,.ELSE and .ENDIF directives.