Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I attached NASM assembly code. with the errors. wonder if someone could help me rewrite this so I can write the rest of my code.
I attached NASM assembly code. with the errors. wonder if someone could help me rewrite this so I can write the rest of my code. it's supposed to be a calculator. Please post working code if possible.
Thanks,
segment.data num1 db 4 num2 db 4 button db 2 segment.bss segment.text global asm main asm main: push ebp mov ebp, esp nasm-f elf-F calc.asm:23: error invalid combination of opcode and operands calc.asm: 26: error invalid combination of opcode and operands calc.asm:29: error: invalid combination of opcode and operands calc.asm:31: error: invalid combination of opcode and operands calc.asm:34: error invalid combination of opcode and operands calc.am.: 37: error: invalid combination of opcode and operand calc.asm: 40: error invalid combination of opcode and operands calc.asm: 43: error invalid combination of opcode and operands Makerile:9: recipe for target calc failed make: [calc] Error 1 dwarf-g calc.asm start: call read_int mov numi, eax call read char mov button, eax call read_ int mov num2, eax cmp button, '+ JE addition cmp button, '-' JE subtraction crmp button JE multiplication cmp button, JE division cmp button, % JE modulus addition: JMP start subtraction: JMP start multiplication: JMP start division: JMP start modulus: JMP start stop: segment.data num1 db 4 num2 db 4 button db 2 segment.bss segment.text global asm main asm main: push ebp mov ebp, esp nasm-f elf-F calc.asm:23: error invalid combination of opcode and operands calc.asm: 26: error invalid combination of opcode and operands calc.asm:29: error: invalid combination of opcode and operands calc.asm:31: error: invalid combination of opcode and operands calc.asm:34: error invalid combination of opcode and operands calc.am.: 37: error: invalid combination of opcode and operand calc.asm: 40: error invalid combination of opcode and operands calc.asm: 43: error invalid combination of opcode and operands Makerile:9: recipe for target calc failed make: [calc] Error 1 dwarf-g calc.asm start: call read_int mov numi, eax call read char mov button, eax call read_ int mov num2, eax cmp button, '+ JE addition cmp button, '-' JE subtraction crmp button JE multiplication cmp button, JE division cmp button, % JE modulus addition: JMP start subtraction: JMP start multiplication: JMP start division: JMP start modulus: JMP start stopStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started