Question: X86 Assembly problems. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; Answer each question below by writing code at the APPROPRIATE places in the file ;;;;; Putting your answer immediately after
X86 Assembly problems.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; Answer each question below by writing code at the APPROPRIATE places in the file ;;;;; Putting your answer immediately after the question is not necessarily the correct place
;;;;; Q2: Write the directive to bring in the IO library
;;;;; Q3: Create a constant called HOURS and initialize it to 24
;;;;; Q4: Create a constant called HRS_PER_YEAR by using HOURS (of Q3) in an integer expression constant
;;;;; Q5: Define an array of 30 signed doublewords, use any array name you like. Initialize: ;;;;; - the 1st element to -25 ;;;;; - the 2nd element to the hexadecimal value C2 ;;;;; - the 3rd element to the binary value 1010 ;;;;; - the 4th element to the HRS_PER_YEAR value defined in Q4 ;;;;; and leave the rest of the array uninitialized.
;;;;; Q6. Define the string "Output = ", use any variable name you like.
;;;;; Q7. Define a prompt that asks the user for a positive number
;;;;; Q8. Write code to print to screen the value of eax after HRS_PER_YEAR is stored in eax (first line of code below) ;;;;; Use the string you defined in Q6 as the text explanation for your output
;;;;; Q9. Write code to prompt the user for a number, using the prompt string that you defined in Q7
;;;;; Q10. Write code to read in the user input, which is guaranteed to be a positive number
;;;;; Q11. Write code to print "Output = " and then echo to screen the user input
;;;;; Q12. Write code to print "Output = " and then print the first element of the array defined in Q5
;;;;; Q13. Build, run, and debug your code ;;;;; Your output should be similar to this (without the commented explanation)
;;;;; Output is 8760 ; printing HRS_PER_YEAR ;;;;; Enter a positive number: 10 ;;;;; Output is 10 ; echo user input ;;;;; Output is -25 ; print first element of array ;;;;; Press any key to continue . . .
;;;;; Q14. At the end of the source file, without using semicolons (;), add a comment block ;;;;; to show how bigData appears in memory (should be the same 8 hexadecimal values as in lab 2), ;;;;; and explain why it looks different than the actual value
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.data bigData QWORD 1234567890abcdefh ; same bigData value as last lab
.code main PROC mov eax, HRS_PER_YEAR ; eax = HRS_PER_YEAR value
exit main ENDP
END main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
