Question: Code with comments for each line of code please. The starter code is provided. Evaluate the following expression given values for A , B ,

Code with comments for each line of code please. The starter code is provided.
Evaluate the following expression given values for A, B, C, D, and X:
(a * x * x + b * y + c)/ d
The starter code for this assignment defines
a, b, c, d, x, and y with initial values.
All are signed quadwords.
Evaluate the expression and leave the result in the *RAX* register.
Note that since division is involved and we're using integer quadwords,
there may be a remainder after the division. Use the value of this
remainder to determine if the result of the division should be rounded up.
For example, if the value of d is 5, you should round up (add 1) to your
result if the remainder after division was 3 or 4. If the value of d
is 4, you should round up if the remainder is 2 or 3.
Starter Code:
global _start ; expose program entry point
section .text ; start of code segment
_start:
; Evaluate the expression: (a * x * x + b * y + c)/ d
; Leave the result in RAX, be sure to round after division
; End the program
mov rax,0x3c ; system call for exit
xor rdi,rdi ; exit code 0
syscall ; invoke operating system call
section .data ; start of initialized data segment
; Values for expression: (a * x * x + b * y + c)/ d
; Program is to be written such that if these values are changed, no code
; changes are necessary in the .text section.
a dq 3
b dq 5
c dq -7
d dq 3
x dq 4
y dq 9
section .bss ; start of uninitialized data segment

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 Programming Questions!