Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am coding in ARM assembly and C coding languages. I need four functions in Assembly language that I can invoke from my C code.

I am coding in ARM assembly and C coding languages. I need four functions in Assembly language that I can invoke from my C code.

- Addition, Subtraction, Division, and multiplication of two numbers from the users input in c

Here is my C code that these functions will have to be invoked from, thank you.

C:

#include int addition (int var1, int var2); void main() { int loop = 1; //loop var. for the while loop check char operator, input; float num1, num2, result; while(loop == 1) //While loop check to be continuous until loop var. altered { printf("************************************************** "); //Visual representation printf(" The Best Calculator "); //of the calculator on printf("************************************************** "); //the terminal printf("Input:first number|operator|second number|[ENTER]: "); printf("Example: 10+20 [Enter]: "); printf("************************************************** "); scanf(" %f %c %f", &num1,&operator,&num2); printf(" "); if(operator == '+') { result = num1 + num2; printf("Addition: %.2f + %.2f = %.2f", num1, num2, result); } else if (operator == '-') { result = num1 - num2; printf("Subtraction: %.2f - %.2f = %.2f", num1, num2, result); } else if (operator == '*') { result = num1 * num2; printf("Multiplication: %.2f * %.2f = %.2f", num1, num2, result); } else if (operator == '/') { result = num1 / num2; printf("Division: %.2f / %.2f = %.2f", num1, num2, result); } else { printf("Invalid operator please input +, -, *, / "); } printf(" "); //Spacing printf("Continue? "); //Inquiry to continue using the calculator printf("(Y/N): "); scanf(" %c", &input); if (input == 'N' || input == 'n') { loop = 0; } printf(" "); //Extra spacing at end for visual clarity } //end while //return 0; }

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

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions

Question

What are the best practices for managing a large software project?

Answered: 1 week ago

Question

How does clustering in unsupervised learning help in data analysis?

Answered: 1 week ago