Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- void compute(int*, int)
- {
- _asm {
- mov ebx,[ebp+8]
- mov esi,0
- fori:cmp esi,[ebp+12]
- jae stopfori
- mov edi,0
- forj:cmp edi,[ebp+12]
- jae stopforj
- mov eax,[ebp+12]
- mul esi
- add eax,edi
- mov ecx,esi
- add ecx,edi
- mov [ebx+4*eax],ecx
- inc edi
- jmp forj
- stopforj:inc esi
- jmp fori
- stopfori:
- }
- }
- int main()
- {
- int a[3][3], n;
- scanf_s("%d", &n);
- compute((int *)a, 3);
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- printf("%d ", a[i][j]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement