Question: Write a complete ARM assembly language program that will count the number of negative integers in an array of 32-bit signed integers. The program will

Write a complete ARM assembly language program that will count the number of negative integers in an array of 32-bit signed integers. The program will use a stack to pass to a subroutine named negCount two arguments: the starting address of the array and the number of elements in the array. You must use an empty descending stack. When called, negCount will save the return address and any scratch registers it uses on the stack. It will then retrieve the array location and size arguments from the stack and use the arguments to count the number of negative values in the array. Scratch registers are then restored from the stack and control returned to the calling function. The negative number count is to be returned in register r0. The calling routine must remove the arguments from the stack. Include the array declaration below in your program.

array DCD 55,-3,20,678,-99,1000,-10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!