3.


2.
:
y0 = x0 + xn-1;
y1 = x1 + xn-2;
...
yn/2 = xn/2 + xn/2+1;
for (i=0, j=n-1; i<n/2; i++, j--){
y[i] = x[i] + x[j];
}
mov ecx, [n]
mov edx, ecx
shr ecx, 1
jecxz m1
mov eax, 0
for1:
mov ebx, [x+eax*4]; x[i]
add ebx, [x+ecx*4-4]
mov [y+eax*4], ebx
inc eax
dec edx
loop for1
m1:
3. 32 .
For (max = x[nom = 0], i=1; i<n; i++ )
if (x[i] >max){
max = x[i]; nom = i;
}
mov eax, 0; nom
mov ebx, [x]; max
mov ecx, [n]
dec ecx
jecxz m1
mov edx, 1; i
for3:
mov esi, [x+edx*4]
cmp esi, ebx
jle short next
mov ebx, esi
mov eax, edx
next:
inc edx
loop for3
mov [max], ebx
mov [nom], eax
ECX ,
for (i=n-2, max = x[nom = n-1]; i>=0; i-- ){
if (x[i]>max) {max= x[i]; nom = i;}
}
mov ecx, [n]
dec ecx
jecxz m1
mov eax, ecx
mov ebx, [x+ecx*4]
for4:
mov esi, [x+ecx * 4 - 4]
cmp esi, ebx
jle short next1
mov eax, ecx
mov ebx, esi
loop for4
mov [max], ebx
mov [nom], eax
.
5. .
For (i=0; str1[i]; i++) str3[i] = str1[i];
for (j=0; str3[i+j=str2[j]; j++);
; For (i=0; str1[i]; i++) str3[i] = str1[i];
mov eax, 0; i=0
for6:
mov bl, [str1+eax]
test bl, bl
je next5
mov [str3+eax], bl
inc eax
jmp for6
next5:
mov ecx, 0
for7:
mov bl, [str2+ecx]
mov [str3+ecx+eax], bl
test bl, bl
je short mmm
inc ecx
jmp for7
mmm: