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

Implement the memset function using inline assembly. The memset function copies

ID: 3865736 • Letter: I

Question

Implement the memset function using inline assembly. The memset function copies "value" starting at the destination address and ending at destination address + nCount -1. It is used to set a block of memory to a specific value, often times initializing a memory block with a value of zero. memset(void *destination, unsigned char value, int nCount). Dst = 0 times 1000, value = 0 times A5, nCount = 5 Void function () { char string[] - "The end is near!";//this is 16 bytes + null printf ("The message is: %s ", string): _asm { move ax, 16: push the length push eax mov eax, 0 times 41: push the value push eax lea eax, string: push the address of string push eax call inline_memset add esp, 12 jmp EXIT inline_memset: : this is where you write the code to implement the memset EXIT: } printf ("Now return message is: %s ", string): return: }//end function Hard copy of your source code WITH COMMENTS and a screenshot of the output of your program running.

Explanation / Answer

inline_memset("mov ecx, [nCount];" "mov edi, [destination];" "mov eax, [value];" "mov ebx, ecx;" "rep stosb;");