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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started