Write a complete assembly program code that implements the following algorithm (
ID: 3605591 • Letter: W
Question
Write a complete assembly program code that implements the following algorithm (in pseudo- code). 4. a. Display a greeting to the user. b. Ask for user's Name c. Ask for user's ld d. Display a customized greeting to user, incorporating Name and ld e. Ask user for two integers and store in memory f. Multiply the two integers and store result in memory g. Divide the two integers from each other, store the results in memory h. Display the original integers and the three computations results to the userExplanation / Answer
section .data
; Declare/store the information
prompt db 'What is your name,userId User? '
helloMsg dq 'Hello Good Day'
name db ' ' ; space characters
endOfLine db '!' ;for exclamation
section .text
global _start
_start:
; Output that information 'What is your name,userId User? '
mov eax, 4
mov ebx, 1
mov ecx, prompt
mov edx, 30
int 0x80 ; invoke an interrupt
; Accept input and store the user's name and userId
mov eax, 3
mov ebx, 1
mov ecx, name
mov edx, 23
int 0x80
; Output that information "Hello…"
mov eax, 4
mov ebx, 1
mov ecx, helloMsg
mov edx, 23 ; according to size of name
int 0x80
; Exit
mov eax, 1
mov ebx, 0
int 0x80
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.