Advertisement
meta1211

Untitled

May 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <random>
  2. #include <iostream>
  3. #include <bitset>
  4. #include <string>
  5. const int sizeSeq = 4;
  6.  
  7. int main()
  8. {
  9.  
  10.  
  11. //счетчики (НЕ ТРОГАТЬ!)
  12. //задай sizeSeq - размер матрицы
  13.     int i = 0;
  14.     int j = 0;
  15.  
  16.     _asm
  17.     {
  18.         LEA edi, m;
  19.     forRow:
  20.         //For loop
  21.         mov eax, i;
  22.         cmp eax, sizeSeq;
  23.         JE end;
  24.         //---body---//
  25.        
  26.         //---end---//
  27.         mov j, 0;
  28.     forCol:
  29.         //For loop
  30.         mov eax, j;
  31.         cmp eax, sizeSeq;
  32.         JE endIter;
  33.         mov ebx, j;
  34.         imul ebx, 4;
  35.         //---body---//
  36.  
  37.         //-------------------
  38.         //ebx is second index
  39.         //edi is the first
  40.         //[edi][ebx] <==> matrix[edi][ebx]
  41.         //using eax as bool var
  42.         //edx is result to save in matrix
  43.         //-------------------
  44.  
  45.         //---end---//
  46.         inc j;
  47.         JMP forCol;
  48.     endIter:
  49.         mov eax, sizeSeq;
  50.         imul eax, 4;
  51.         add edi, eax;
  52.         inc i;
  53.         JMP forRow;
  54.     end:
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement