-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab.Work 2.cpp
More file actions
43 lines (38 loc) · 986 Bytes
/
Copy pathLab.Work 2.cpp
File metadata and controls
43 lines (38 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ConsoleApplication1.cpp: îïðåäåëÿåò òî÷êó âõîäà äëÿ êîíñîëüíîãî ïðèëîæåíèÿ.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
int b[7] = { -1,2,3,1 ,2,3,-4 };
int n = 7;
int i = 0;
int main()
{
setlocale(LC_ALL, "Russian");
_asm {
lea eax, b
mov ebx, dword ptr[eax]
mov ecx, dword ptr[n]
oncemore:
cmp ebx, 0
jle addition
add eax, 4
mov ebx, dword ptr[eax]
loop oncemore
jmp fquit
addition:
inc i
add eax, 4
mov ebx, dword ptr[eax]
loop oncemore
}
fquit:
printf("Çàäàíèå ¹8. Ïîñ÷èòàòü êîëè÷åñòâî îòðèöàòåëüíûõ ÷èñåë â ìàññèâå.\n");
printf("Ìàññèâ: ");
for (int j=0; j < 7; j++) {
printf("%d, ", b[j]);
}
printf("\nÎòâåò: Êîë-âî îòðèöàòåëüíûõ ÷èñåë = %d", i);
getchar();
return 0;
}