Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- PUBLIC @arrays@8
- .model flat
- .data
- sum dd 10 dup(?)
- d10 dd 10
- minSum dd 0
- num dd 0
- .code
- @arrays@8 proc
- mov edi, edx;
- xor esi, esi;
- begin_:
- cmp esi,edi ; заполняем массив сумм
- je nextpoint;
- xor ebx, ebx
- mov eax, [ecx][esi * 4];
- cmp eax,0
- jl l
- jmp b
- l:
- neg eax
- b :
- cmp eax, 0
- je end_
- xor edx,edx
- div d10
- add ebx, edx
- jmp b
- end_:
- mov sum[esi*4], ebx;
- inc esi;
- jmp begin_;
- nextpoint:
- mov eax, sum[0];
- mov minSum, eax;
- xor esi, esi;
- begin2:
- cmp esi, edi; находим минимальную сумму
- je end_end;
- mov eax, sum[esi*4];
- cmp eax, minSum;
- jg notchange;
- mov minSum, eax;
- mov num, esi;
- notchange:
- inc esi;
- jmp begin2;
- end_end:
- mov esi,num;
- mov eax,[ecx][esi*4];
- ret
- @arrays@8 endp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement