Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

x86_64 Assembly Programming Overview Develop an x86_64 assembly language program that uses a function and a loop to calculate values across an array. Procedure For

x86_64 Assembly Programming
Overview
Develop an x86_64 assembly language program that uses a function and a loop to calculate values across an array.
Procedure
For this assignment you must write all code in x86_64 assembly (but you may use/call C functions in your assembly code).
All code should be in one source file only (asm_program.asm)
You may reuse code from any of my assembly examples for this assignment.
Create a function which takes four 64-bit integer arguments (eg. W, X, Y, Z).
Your function should compute (W / X) - (Y * Z), and leave the result in RAX when it returns.
Your function should accept the four arguments using appropriate conventions (see registers listed in the lecture slides).
Your function should NOT print anything - it should ONLY perform the math, and return the result via RAX.
Use a loop to compute the above function over an array of size 16 (A[0], A[1], ..., A[15])
Declare an array (in memory) containing 16 reasonable 64-bit integer values (of your choosing, but avoid using zero).
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.
For example, rax = (A[0] / A[1]) - (A[2] * A[3]), then rax = (A[1] / A[2]) - (A[3] * A[4]), etc.
For each iteration, print out the calculation, the result, and start a newline (exactly like this): (5 / 2) - (3 * 4) = -10
The last iteration should compute rax = (A[12] / A[13]) - (A[14] * A[15])

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

How is the cash balance determined

Answered: 1 week ago

Question

Graph the solution of the system of inequalities. x + 2y 2 3x X 2

Answered: 1 week ago

Question

Uses effective delegation to develop others.

Answered: 1 week ago