Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve in ARM Assembly language CS413 Lab 2 ARM Stack Program Simple Stack Calculator The purpose of this program is to get the student

Please solve in ARM Assembly language image text in transcribed
CS413 Lab 2 ARM Stack Program Simple Stack Calculator The purpose of this program is to get the student to use the stack to pass parameters to and from their own defined subroutines/functions in ARM Assembly Implement a simple four function integer calculator (addition, subtraction, multiplication and division) that meet the following requirements 1. Each function must be accessed as a subroutine/function (ARM instruction BL) 2. The operands are passed to the function via the stack. Use the ARM pseudo instructions PUSH and POP. To ensure you are properly implementing the stack the registers used in your main routine to hold the operands must be different than those used in the subroutines. For example, your calling routine will push r4 and r5 on the stack but the called routine will pop into registers r10 and rll. 3. The function returns the results on the top of the stack. 4. Your program is to print a welcome/instruction messages to the user 5. The user is prompted to enter positive integers and the operation to be performed. 6. The program shall verify the user input is valid and report any entry 7. The program shall perform the calculation and report any overflow 8. Since the ARM Assembly does not have a division instruction the errors. Ensure your program checks for division by zero. errors program will implement a subtraction algorithm to perform division. The quotient and remainder will be return by the division function. 9. Display the results of the operation. Ask the user if they want to continue with another calculation or quit the program. CS413 Lab 2 ARM Stack Program Simple Stack Calculator The purpose of this program is to get the student to use the stack to pass parameters to and from their own defined subroutines/functions in ARM Assembly Implement a simple four function integer calculator (addition, subtraction, multiplication and division) that meet the following requirements 1. Each function must be accessed as a subroutine/function (ARM instruction BL) 2. The operands are passed to the function via the stack. Use the ARM pseudo instructions PUSH and POP. To ensure you are properly implementing the stack the registers used in your main routine to hold the operands must be different than those used in the subroutines. For example, your calling routine will push r4 and r5 on the stack but the called routine will pop into registers r10 and rll. 3. The function returns the results on the top of the stack. 4. Your program is to print a welcome/instruction messages to the user 5. The user is prompted to enter positive integers and the operation to be performed. 6. The program shall verify the user input is valid and report any entry 7. The program shall perform the calculation and report any overflow 8. Since the ARM Assembly does not have a division instruction the errors. Ensure your program checks for division by zero. errors program will implement a subtraction algorithm to perform division. The quotient and remainder will be return by the division function. 9. Display the results of the operation. Ask the user if they want to continue with another calculation or quit the program

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