Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer using coldfire assembly language 2 (15 points) Design an assembly language subroutine that receives an array of longword- sized positive integers (in two's

please answer using coldfire assembly language image text in transcribed
2 (15 points) Design an assembly language subroutine that receives an array of longword- sized positive integers (in two's complement representation). The subroutine is to determine how many of the integers in the array are even but not multiples of 4. The input array is to be specified using two parameters: a longword-sized starting address of the array, and a longword-sized number of integers in the array. These two input parameters are to be pushed onto the stack (in that order: push address first, and then push the number of integers) before the subroutine is called. The output parameter (i.e., the number of integers that are even but not multiples of 4) of the subroutine is to be returned on the stack and should replace the first input parameter (i.e., starting address of the array). Also write a main program that puts input parameters for an array (which has starting address 0x0006000 and has 400 longword-sized positive integers) on the stack, calls the subroutine, and retrieves the output parameter from the stack after the subroutine ends. In the main program, the output parameter, which is retrieved from the stack, should be stored to dataeister D3. Note that at the beginning of your main program, you do not know the exact initial value in any data or address register All registers (except A7) used by the subroutine must be preserved. Hint: For an integer in two's complement representation, if the last two bits (Bit #1 and Bit #0) ofthe integer's binary format are both zeros, then the integer is a multiple of 4

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

More Books

Students also viewed these Databases questions

Question

are data about data in a repository

Answered: 1 week ago