Question: Please use hcs12 codewarrior to write the assembly code thanks cutor Task 3 Write a program that pushes the first 10 natural numbers to the

 Please use hcs12 codewarrior to write the assembly code thanks cutor

Please use hcs12 codewarrior to write the assembly code thanks

cutor Task 3 Write a program that pushes the first 10 natural numbers to the stack, then pops those numbers. Use the debugger to view how the stack changes after each instruction Once all the data has been pushed to the stack, take a screenshot of the stack in memory. Task 4 Write a subroutine called "Area" that calculates the area of a rectangle. Use accumulator A and B to pass the length and the width to the function. Use accumulator D to return the result. HINT: load the width and height into accumulators A and B. Call the subroutine. Provide a flowchart, a snapshot of CPU registers before and after executing the subroutine. Now re-write the program from Task 3, but this time use the stack to pass the function arguments and the return value. HINT: load the width into accumulator A, then push A to the stack load the height into accumulator B. then push B to the stack Allocate one word on the stack for the return value. Call the subroutine. After you return from the function, deallocate all variables from the stack. Provide a drawing of the stack frame and a snapshot of of the stack before, during and after executing the subroutine

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!