Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

here is the assembly lanaguage code: section .data prompt db 'What is your name? ',0xa lenp equ $ - prompt ;length of prompt stringstring helloMsg

here is the assembly lanaguage code:

section .data

prompt db 'What is your name? ',0xa

lenp equ $ - prompt ;length of prompt stringstring

helloMsg dq 'Hello '

name db ' ' ; space characters

endOfLine db '!'

section .text

global _start

_start:

; Output that information 'What is your name? '

mov eax, 4 ; write?

mov ebx, 1 ; to the standard output ?

mov ecx, prompt ; the information at memory address prompt

mov edx, lenp ; 19 bytes (characters) of that information

int 0x80 ; invoke an interrupt

; Accept input and store the user's name

mov eax, 3 ; read?

mov ebx, 1 ; from the standard input

mov ecx, name ; storing at memory location name?

mov edx, 23 ; 23 bytes (characters) is ok for my name

int 0x80

; Output that information "Hello?

mov eax, 4 ; write?

mov ebx, 1 ; to the standard output (screen/console)?

mov ecx, helloMsg ; the information at helloMsg?

mov edx, 23 ; 23 bytes (characters) is ok for my name

int 0x80

; Exit

mov eax, 1 ; sys_exit

mov ebx, 0 ; exit status. 0 means "normal", while 1 means "error"

int 0x80

I tested this program in coding ground and I cannot type anything in. what is the problem?

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Discuss the key roles for training professionals.

Answered: 1 week ago