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

X86 ASSEMBLY PROGRAMMING make one procedure, called getString that receives: esi

ID: 3719380 • Letter: X

Question

X86 ASSEMBLY PROGRAMMING

make one procedure, called getString that receives:

esi - the address of a prompt (asks the user for something)

edi - the address of the buffer where to put the string (from the user)

ecx - the size of the buffer returns:

eax - number of char read have it restore the values of all register (except eax)

make another procedure that prints two strings, called DisplayStrings that receives:

esi - the address of a prompt or description

edi - the address the second string with some info returns: nothing have it restore the values of any register it uses

Explanation / Answer

getString:

; display the prompt, service code for syscall is 9

mov                 ah, 09h

lea                    dx, esi

int                    21h

;input string from keyboard

mov                 ah, 0Ah

lea                    dx, dsi

int                    21h

displayString:

; display prompt

mov                 ah, 09h

lea                    dx, esi

int                    21h

;display string

mov                 ah, 09h

lea                    dx, edi

int                    21h