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 array1 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 17 and tolerance is given as 5, your program should count the number of values in the array that are between 12 and 22 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:
array1 dq 10,-3,4,19,39,22,7,13,22,-8
array1_len equ ($-array1)/8
target dq 17
tolerance dq 5
count dq 0
The value at count when the program completes should be 4.
Sample values are provided in the starter code (different from the example shown above). If the values or number of values in array1 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 20 signed quadwords
array1 dq -413,879,347,345,48,-991,229,-654,596,706,-646,-433,-505,752,-539,875,-601,111,-601,-331
array1_len equ ($-array1)/8
target dq 183 ; Target value
tolerance dq 217 ; Tolerance value
count dq 0 ; Count of values in array1 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 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!