Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write and test an ARMv8 program which calculates the sum of all even numbers in an array of n non-zero positive integers. Store the array

Write and test an ARMv8 program which calculates the sum of all even numbers in an array of nnon-zero positive integers.

Store the array in the data section. You may use any values for testing, but you will be given an array on the due date which you must use. The array will have an arbitrary size and will be terminated with a value of 0.

Create a loop to iterate through the array and determine whether values are even or odd. Even values will have their low-order bit set to zero, and odd values will have the low-order bit set to one.

Some new instructions that you should be familiar with: TST, CBZ, CBNZ, B

Submit (Required, as PDF, PNG, JPG files)

a) A file containing your assembly code (.S file)

b) A read-me file which indicates your use of registers

c) Two screen shots, showing register values before executing the first instruction, and after the last instruction has executed.

This is what I started With so far :

.data // data section

.type x, %object // defining object x

.size x, 9 // size 3 elements

v: // v array

.xword 1, 2, 3, 4, 5, 6, 7, 8, 0 // elements of size 64-bit

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Explain how discrimination is a by-product of our thinking.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago