Question: /* ASSEMBLY LANGUAGE : Need NASM Assembly help. I just need help getting this code to compile. Please post working code. Not sure what Im

/*ASSEMBLY LANGUAGE: Need NASM Assembly help. I just need help getting this code to compile. Please post working code. Not sure what I"m doing wrong here. I also attached my compiler errors. The code is supposed to be a calculate take inputs and a symbol +,-,*,%, and then with the '=' perform the calculation and spit out the answer. 6 + 5 = 11*//*ASSEMBLY LANGUAGE: Need NASM Assembly help. I just need help getting this

segment .data line byte "Enter Integer: " num1 byte num2 byte

button byte segment .bss

segment .text global asm_main

asm_main: push ebp mov ebp, esp ; ********** CODE STARTS HERE ********** mov edx, offset line call write_string

start:

call read_int mov num1, eax

call read_char mov button, eax

call read_int mov num2, eax

cmp button, '+' JE addition

cmp button, '-' JE subtraction

cmp 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: exit main end end main

; *********** CODE ENDS HERE *********** mov eax, 0 mov esp, ebp pop ebp ret

nasm -f elf -F dwarf -g calc.asm 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.asm: 37: error: invalid combination of opcode and operands calc.asm: 40 error: invalid combination of opcode and operands calc.asm: 43 error: invalid combination of opcode and operands Makefile:9: recipe for target calc' failed make : [calc] Error 1 nasm -f elf -F dwarf -g calc.asm 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.asm: 37: error: invalid combination of opcode and operands calc.asm: 40 error: invalid combination of opcode and operands calc.asm: 43 error: invalid combination of opcode and operands Makefile:9: recipe for target calc' failed make : [calc] Error 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!