Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a function which takes four 64-bit integer arguments (eg. W, X, Y, Z). o Your function should compute (W * X) - (Y/Z), and

Create a function which takes four 64-bit integer arguments (eg. W, X, Y, Z). o Your function should compute (W * X) - (Y/Z), and leave the result in RAX when it returns. o Your function should accept the four arguments using appropriate conventions (see registers listed in the lecture slides). o Your function should NOT print anything - it should ONLY perform the math, and return the result via RAX.

2. Use a loop to compute the above function over an array of size 16 (A[O], A[1], ..., A[15]) o Declare an array (in memory) containing 16 reasonable 64-bit integer values (of your choosing, but avoid using zero). o Use a loop to iterate over the elements of the array, and use your function (above) to calculate the value of every four consecutive array values. o For example, rax = (A[O] * A[1]) - (A[2] / A[3]), then rax = (A[1] * A[2]) - (A[3] / A[4]), then rax = (A[2] * A[3]) - (A[4] / A[5]), then rax = (A[12] * A[13]) - (A[14] / A[15]) done

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions