Question: Please answer in assembly code (not mips) thank you Write a program that can evaluate ONE mathematical expression. The mathematical expression could be addition, subtraction,
Please answer in assembly code (not mips) thank you
Write a program that can evaluate ONE mathematical expression. The mathematical expression could be addition, subtraction, multiplication or division. The input is just 1 line. The output is the result of that line. Look below for examples: for the input: 1 + 1 The program should output 2 for input 2*2 the program should output 4 for input 4/2 the program should output 2 For invalid operators, you should display "Invalid Operator" message. So for this input: 5$ 6 Invalid Operator ASSUMPTIONS YOU MUST FOLLOW: . When applying division, only division that results in NO REMAINDER will be used. So do NOT worry about remainder. For example, I'll test your code with 5/1 or 6/2 or 8/2 Output is ALWAYS 9 or less. I will NOT test your code with any numbers that result in a number higher than 9 . Always read numbers in 2 bytes. with multiplication, I will only test small numbers where the result is 9 or less. So I will only multiply 2*2 or at most 4*2. I will NOT test multiplication where the result is more than 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
