Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* 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*/image text in transcribed

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

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago