Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone help me with this problem. We\'re using microsoft visual studios and

ID: 3701482 • Letter: C

Question

Can someone help me with this problem. We're using microsoft visual studios and its from my assembly code language class.

we're using this template in class from the lecture slides

Write a program and verify it using visual studio that does the following: Use type, lengthof, and size to make your program more independent of the data type. 3) Write a program that first reads the message entered by the user and stores it in Myname. Then it prints the content of cl on the screen. Myname byte 45 dup(?)

Explanation / Answer

;code.asm

;This codes serves the function of the problem to display the name entered by the user

section .data

prompt db ‘What is your name? ‘
; do not change the order of the following three lines!
Myname dq ‘Hello ‘
name db ‘ ‘ ; space characters
endOfLine db ‘!’
; do not change the order of the previous three lines!
section .text
global _start
_start:
; Output the information ‘What is your name? ‘
mov eax, 4 ; write…
mov ebx, 1 ; to the standard output (screen/console)…
mov ecx, prompt ; the information at memory address prompt
mov edx, 19 ; 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 (keyboard/console)…
mov ecx, name ; storing at memory location name…
mov edx, 23 ; 23 bytes (characters) is ok for myName
int 0x80
; Output that information
mov eax, 4 ; write…
mov ebx, 1 ; to the standard output (screen/console)…
mov ecx, Myname; the information at Myname
mov edx, 23 ; 23 bytes (characters) is ok for myName
int 0x80
; Exit