Question

What is your name?sam Hello sam What is your age?19 WOW! YOURE, 19 What is your birth month august No way! I was born in aug

I need help creating a code in assembly, requesting at least 2 user inputs and printing it on the screen. ( on Ubuntu)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

section .text

global _start

_start:

mov eax,4       ;sys_write
mov ebx,1      
mov ecx,text1       ;'What is your name? '
mov edx,text1_size  
int 80h      

mov eax,3       ;sys_read. Reads the data entered by user
mov ebx,0      
mov ecx,inp_buf   ;User data -> Buffer
int 80h

push eax

mov eax,4
mov ebx,1
mov ecx,text2       ;'Hello '
mov edx,text2_size
int 80h

mov eax,4      
mov ebx,1  
mov ecx,inp_buf
pop edx
int 80h

mov eax,1
mov ebx,0
int 80h

section .bss

inp_buf resb 256

section .data

text1: db 'What is your name? '
text1_size: equ $-text

text2: db 'Hello '
text2_size: equ $-text2

Note: The above code is for getting an user input and displaying it. The same can be repeated 'n' no. of times to achieve your goal.

Add a comment
Know the answer?
Add Answer to:
I need help creating a code in assembly, requesting at least 2 user inputs and printing it on the screen. ( on Ubuntu) What is your name?sam Hello sam What is your age?19 WOW! YOUR'E, 19 What is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin...

    Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin at the University of Washington, Seattle, who originally wrote this assignment (for their CSE 142, in Java) This program focuses on classes and objects. Turn in two files named Birthday.cs and Date.cs. You will also need the support file Date.dll; it is contained in the starter project for this assignment. The assignment has two parts: a client program that uses Date objects, and a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT