Question: Assignment: Calculator Description: Write a calculator program in assembly. It should handle the following functions: addition (+), subtraction (-), multiplication (*), integer division (), modulo
Assignment: Calculator
Description: Write a calculator program in assembly. It should handle the following functions: addition (+), subtraction (-), multiplication (*), integer division (), modulo division (%), and exponentiation (). Your program should...
1. Read an integer from the user.
2. Read a character from the user, representing the function. (+,-*,/,%,^)
3. Read another integer from the user.
4. Print an equals sign E).
5. Print the result. Please comment your code, and format it so that it looks clean! (examples on next page) asm main: push mov ebp ebp, esp *** CODE STARTS HERE ******* ; eax call mov call read int esi, eax read char ; al call mov call read char bi, al read_char i in eax call mov call read_int edi, eax read_char ; In mov mov pop ret CODE ENDS HERE eax, 0 esp, ebp ebp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
