Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello I have to write program that takes 2 numbers from user sum them and display back to user in GNU Assembler intel_syntax . So

Hello

I have to write program that takes 2 numbers from user sum them and display back to user in GNU Assembler intel_syntax .

So far I've got part taking input but have no idea how to realise adding them up correctly (3 digits per number)

Task is to not use any kind of standard library or external functions just pure assembly + sys_calls to read and write

```

.intel_syntax noprefix .global main .data msg: .asciz "Enter a number:" msg1: .asciz "Number:" msg2: .asciz "Sum:" .lcomm num,5 .lcomm num1,5 .lcomm res,5 .text main: mov eax, 4 mov ebx, 1 mov ecx, OFFSET msg mov edx, 15 int 0x80

mov eax, 3 mov ebx, 1 mov ecx,OFFSET num mov edx, 5 int 0x80 push OFFSET num

mov eax, 4 mov ebx, 1 mov ecx, OFFSET msg mov edx, 15 int 0x80

mov eax, 3 mov ebx, 1 mov ecx,OFFSET num1 mov edx, 5 int 0x80

mov eax, 4 mov ebx, 1 mov ecx, OFFSET msg1 mov edx, 7 int 0x80

mov eax, 4 mov ebx, 1 mov ecx, OFFSET num mov edx, 5 int 0x80

mov eax, 4 mov ebx, 1 mov ecx, OFFSET msg1 mov edx, 7 int 0x80

mov eax, 4 mov ebx, 1 mov ecx, OFFSET num1 mov edx, 5 int 0x80

mov eax, 1 mov ebx, 0 int 0x80

```

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

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions

Question

LO4 Specify how to design a training program for adult learners.

Answered: 1 week ago