Question: ou will turn in TWO different . asm files. They will be called FirstLastLab 3 Q 1 . asm and FirstLastLab 3 Q 2 .
ou will turn in TWO different asm files. They will be called FirstLastLabQasm and FirstLastLabQasm.
Use your first and last name in place of First and Last Use the file template.asm or addtwo.asm as a guide when
creating your programs. A portion of your grade will be based on program comments, indentation, spacing, and other
coding conventions that are used in class.
Question : File Name: FirstLastLabQasm
Create a program that will sum the double gaps between consecutive array element values. The array will be
of DWORDS.
o Example:
Given the following array: myArray DWORD
The gaps between the numbers are and Doubling these values double gaps give us
and Add these together and the result is
Store the result in a variable named doubleGapSum.
This program should work for an array with any number of elements without changing anything other than the
array itself I will test with various array lengths. The array is guaranteed to have at least two elements.
Make sure that you use ESI when accessing different elements of the array.
Question : File Name: FirstLastLabQasm
Create a program that will calculate the first n elements of the Fibonacci number sequence.
Create a symbolic constant called n and assign any value to it This will be the number of Fibonacci numbers
that will be generated.
Create an array of DWORDS called fibonacciNumbers. Initialize this array to all zeros. The number of elements
in this array is determined by the value that you set n to in the prior step.
Your program should fill the fibonacciNumbers array with the first n Fibonacci numbers.
o In case you are not familiar with Fibonacci numbers, the first number is the second number is the
third number is the sum of the first two The fourth is the sum of numbers and
and so on Each number is the sum of the prior two numbers. Here are the first few values of the
sequence:
When I test, I will change the value of n THIS WILL BE THE ONLY THING THAT I CHANGE. Your program should
work regardless of what value I put in there. Be sure to test with different values. You may assume that n
Make sure that you use ESI when accessing different elements of the array.
template.asm:
; Program template
model flat,stdcall
stack
ExitProcess proto,dwExitCode:dword
data
; declare variables here
code
main proc
; write your code here
invoke ExitProcess,
main endp
end main
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
