Question: Code with comments with each line of code please. Starter code is provided. Using the starter code provided, write an assembly program that counts the
Code with comments with each line of code please. Starter code is provided.
Using the starter code provided, write an assembly program that counts the number of values in the signed quadword array at location array that are within some given tolerance of a given target value. The tolerance and target values are given in the quadwords at locations tolerance and target.
For example, if target is given as and tolerance is given as your program should count the number of values in the array that are between and inclusive.
A quadword location is given in the starter at count and is initialized to zero. Your program should leave the count of values in this location.
Example:
If the values given are:
array dq
arraylen equ $array
target dq
tolerance dq
count dq
The value at count when the program completes should be
Sample values are provided in the starter code different from the example shown above If the values or number of values in array are changed, or if the values given for target or tolerance are changed your code text section should run successfully on that data without modification.
global start ; expose program entry point
section text ; start of code segment
start:
section data ; start of initialized data segment
; Sample array with signed quadwords
array dq
arraylen equ $array
target dq ; Target value
tolerance dq ; Tolerance value
count dq ; Count of values in array within tolerance of target
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
