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 = 0 ZF = 0 SF = 0
ii. mov al,00110011b test al,2 ; CF = 0 ZF = 0 SF = 0
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) mov bl,al and bl,00111111b
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) shr al,4 mov bl,al
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) test dl,1100b ; (00001100b) jnz L1
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)
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.
GOOD LUCK
TITLE Letter Grade
INCLUDE Irvine32.inc
.data str1 BYTE "Enter an integer score: ",0 str2 BYTE "The letter grade is: ",0
.code main PROC call Clrscr mov edx,OFFSET str1 ; input score from user call WriteString call ReadInt call Crlf
Mastering IoT For Industrial Environments: Unlock the IoT Landscape for Industrial Environments with Industry 4.0, Covering Architecture, Protocols like MQTT, and Advancements with ESP-IDF