Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. lang equ ru
  2.  
  3. ;
  4. ;   Assembler
  5. ;     SMALL
  6. ;       CODE
  7. ;         Massive operation
  8. ;           Libary
  9. ;
  10. ;   Ver 0.1 By Pavlushin Evgeni (RUSSIA)
  11. ;   www.waptap@mail.ru
  12.  
  13. ;InfoList
  14. ;0.01 readmas,compmas,findmas
  15.  
  16. macro readmas masoff,obroff
  17. {
  18. local loo
  19.     mov edi,masoff  
  20.     add edi,8
  21.     mov ebp,[masoff]   ;elements
  22.     mov edx,[masoff+4] ;elemsize
  23.     mov eax,0 ;count
  24. loo:
  25.     pushad
  26.     call obroff
  27.     popad
  28.     add  edi,edx
  29.     inc  eax
  30.     cmp  eax,ebp
  31.     jne  loo
  32. }
  33.  
  34. macro compmas masoff1,masoff2,obroff
  35. {
  36. local loo,loo2
  37.     mov esi,masoff2
  38.     add esi,8
  39.     mov ecx,[masoff2]
  40.     mov ebx,[masoff2+4]
  41.     mov eax,0
  42.  
  43. loo2:
  44.     push eax
  45.  
  46.     mov edi,masoff1  
  47.     add edi,8
  48.     mov ebp,[masoff1]   ;elements1
  49.     mov edx,[masoff1+4] ;elemsize1
  50.     mov eax,0 ;count
  51. loo:
  52.     pushad
  53.     call obroff
  54.     popad
  55.     add  edi,edx
  56.     inc  eax
  57.     cmp  eax,ebp
  58.     jne  loo
  59.  
  60.     add  esi,ebx
  61.     pop  eax
  62.     inc  eax
  63.     cmp  eax,ecx
  64.     jne  loo2
  65. }
  66.  
  67.  
  68. macro findmas masoff,obroff
  69. {
  70. local loo,looend,lend
  71.     mov edi,masoff  
  72.     add edi,8
  73.     mov ebp,[masoff]   ;elements
  74.     mov edx,[masoff+4] ;elemsize
  75.     mov eax,0 ;count
  76. loo:
  77.     pushad
  78.     mov  eax,0
  79.     call obroff
  80.     cmp  eax,1
  81.     je   looend
  82.     popad
  83.     add  edi,edx
  84.     inc  eax
  85.     cmp  eax,ebp
  86.     jne  loo
  87.     stc
  88.     jmp  lend
  89. looend:
  90.     popad
  91.     clc
  92. lend:
  93. }