Question: Assembly language Exercise 2: Write an assembly program in 32-bit Protected mode that implements the following arithmetic expressions using as few instructions and registers as

Assembly language

Assembly language Exercise 2: Write an assembly program in 32-bit Protected mode

Exercise 2: Write an assembly program in 32-bit Protected mode that implements the following arithmetic expressions using as few instructions and registers as possible without simplifying the expression manually (1.e., perform operations in correct order according to normal precedence and use variables as applicable). Assume that r1 is a 32- bit signed value and r2 is a 16-bit unsigned value. You can confirm that variables r1 and r2 hold correct values by assign them to different registers and call DumpRegs. r1 = -(V2 - (v3 + vb)) + 1 r2 = 14 + 10h Use the following data definitions: v1 SDWORD 10h V2 SDWORD 30h | v3 SDWORD 20 ri SDWORD ? v4 WORD OFFFFh r2 WORD ? In comments next to each instruction, write the current hexadecimal value of the affected register or variable (for example: mov eax, 12 ; eax = Och). Insert a call DumpRegs statement at the end of the program and you should examine various registers to confirm that your program is working properly. In addition, display the message "Author: Your Name." at the beginning of your program by defining a null-terminated string and then add a call WriteString instruction

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!