Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to accept user input of a three digit number and convert it to an int. This is my code so far but it

I need to accept user input of a three digit number and convert it to an int. This is my code so far but it is not working.

the program is for x86 nasm on gl server (64 bit linux)

;accept input

mov eax, 3 mov ebx, 0 mov ecx, num mov edx, 6 int 0x80

;converting three digit number:

mov eax, [num] and eax, 0xff sub eax, '0' mov ebx, 10 mul ebx mov [num], eax

mov eax, [num+1] and eax, 0xff sub eax, '0' add eax, [num] mov ebx, 10 mul ebx mov [num], eax

mov eax, [num+2] and eax, 0xff sub eax, '0' add eax, [num] mov ebx, 10 mul ebx mov [num], eax

; print to screen

mov ebx,1 mov eax,4 mov ecx, num mov edx, 6 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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago