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

The entire purpose of this question is based off the concept of appending a 0 te

ID: 3718662 • Letter: T

Question

The entire purpose of this question is based off the concept of appending a 0 terminated string to another 0 terminated string in x86 assembly language without using a loop.

example: char str1[] = {'g','r','e,'e','d',0};

; char str2[] = {'l','o','v','e',0};

; after calling function(str1,str2)

the strings produce a combined message 'g' 'r' 'e' 'e' 'd' 'l 'o' 'v' 'e',0

ive been told

Choose 2 instructions from the following string instructions to use:

; rep, repe, repne, movsb,stosb,cmpsb,scasb

and to populate ecx with MAX_LEN EQU 0FFFFFFFFh

I have to get to the end of the first string using 2 instructions and to call a function to copy str 2 to the end of str 1

Thanks

Explanation / Answer

We used repne here.

In case of any doubts, please comment.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote