Question: Code and comments for each line of code please. Write a 6 4 - bit NASM program to fill an array of quadwords of size

Code and comments for each line of code please.
Write a 64-bit NASM program to fill an array of quadwords of size ARRAY_SIZE (constant defined in the starter code. Ensure that your program uses these constants such that if the constant values are changed, your program accommodates the new values.
The given code includes three constants:
ARRAY_SIZE- The size of the array to be populated. See the array definition in the .bss section
START_VALUE- The value (given in decimal form) that is to start the sequence, and thus should be placed in the first element (position 0 of the array.
ADD_Value- Fill the second element (position 1) of the array with the sum of the first element and this value. For each subsequent position, add the next multiple of this value to the previous value placed in the array.
For example, the starter code gives the values 10,14, and 3 respectively for these constants. The resulting (decimal) values in the quadword array should be as follows:
1417233244597798122149
Array starts with 14. Add 3 to 14, next array value 17. Add 6 to 17, next array value is 23. Add 9 to 23, next value is 32, and so on.
Starter code:
global_start
section .text
ARRAY_SIZE equ 10
START_VALUE equ 14
ADD_VALUE equ 3
_start:
; End the program
mov rax, 0x3c ; system call for exit
xor rdi, rdi ; exit code 0
syscall ; invoke operating system call
section .date ; start of initialized data segment
section .bss ; start of uninitialized data segment
array resq ARRAY_SIZE

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!