Question: Write an Intel assembly language program in a file named greet.asm that will prompt the user to enter their name, and then respond with the

Write an Intel assembly language program in a file named greet.asm that will prompt the user to
enter their name, and then respond with the greeting "Nice to meet you," followed by the name that
the user entered.
A sample execution of the program should look exactly like this, where the italicized text represents
user input:
Please enter your name: Spatula
Nice to meet you, Spatula
In other words, your program should be functionally identical to the following Python 3 program:
name = input(Pleaseenteryourname:)
print(Nicetomeetyou+ name)
You'll have to use Linux syscalls. You will need syscall 4(write) to print messages on the screen (via
file descriptor 1), and syscall 3(read) to accept data input from the keyboard (via file descriptor 0).
Your program should then halt normally, using the syscall 1(exit).
The messages you display should be represented as strings in your program's . data section. Data you
read in from the keyboard should be stored in a region in your program's . bss or . data section. To
simplify the problem, you may assume that user input does not exceed 20 characters.
To assemble and link your greet.asm file, use these commands:
nasm -f elf greet.asm
ld -o greet -m elf_i386 greet.o
If you don't get any errors, the result will be an executable file named greet that you can run like
this:
./ greet
Submit your completed greet. asm file.
Hint: you will need to use the read syscall to accept keyboard input from the user. Consult the
syscall table in the slides and ?bar(here). Note that the read syscall is number 3, and expects the following
arguments: ebx will contain the file handle to read from (should be stdin); ecx will contain a pointer
to a buffer where the user input will be stored; and edx will contain the maximum number of bytes to
read. After the syscall completes, eax will contain the number of bytes that were actually read.
Write an Intel assembly language program in a

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 Programming Questions!