Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Converting C program into ARM assembly. I have no idea how ARM assembly works so I'm struggling. I'm not sure how to start it. Below

Converting C program into ARM assembly. I have no idea how ARM assembly works so I'm struggling. I'm not sure how to start it. Below is the C program and the program works.

#include

int main() { int nums[] = {100, 40, 5, -1, 19}; const int size = 5; // change here if the array size is different // we will need counters to hold each of the categories int countLostGeneration = 0, countGreatestGeneration = 0, countBabyBoomerGeneration = 0, countGenerationX = 0, countGenerationY = 0, countGenerationZ = 0, countNotApplicable =0; int i=0; for (i = 0; i < size; i++){ // Now we need to compare if (nums[i] >= 102 && nums[i] <= 127){ countLostGeneration++; } else if (nums[i] >= 93 && nums[i] <= 101){ countGreatestGeneration++; } else if(nums[i] >= 53 && nums[i] <= 71){ countBabyBoomerGeneration++; } else if(nums[i] >= 38 && nums[i] <= 52){ countGenerationX++; } else if(nums[i] >= 22 && nums[i] <= 36){ countGenerationY++; } else if(nums[i] >= 7 && nums[i] <= 21){ countGenerationZ++; } else{ countNotApplicable++; } } // Now once we are done with the counting, we can print the statistics printf("Lost generation is:%d ", countLostGeneration); printf("Greatest generation:%d ", countGreatestGeneration); printf("Baby boomer generation:%d ", countBabyBoomerGeneration); printf("Generation X:%d ", countGenerationX); printf("Generation Y:%d ", countGenerationY); printf("Generation Z:%d ", countGenerationZ); printf("Not Applicable:%d ", countNotApplicable); return 0;

}

Thank you.

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions