Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
31 halyavin 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   ;tekoff
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
 
35
macro compmas masoff1,masoff2,obroff
36
{
37
local loo,loo2
38
    mov esi,masoff2
39
    add esi,8
40
    mov ecx,[masoff2]
41
    mov ebx,[masoff2+4]
42
    mov eax,0
43
 
44
loo2:
45
    push eax
46
 
47
    mov edi,masoff1   ;tekoff
48
    add edi,8
49
    mov ebp,[masoff1]   ;elements1
50
    mov edx,[masoff1+4] ;elemsize1
51
    mov eax,0 ;count
52
loo:
53
    pushad
54
    call obroff
55
    popad
56
    add  edi,edx
57
    inc  eax
58
    cmp  eax,ebp
59
    jne  loo
60
 
61
    add  esi,ebx
62
    pop  eax
63
    inc  eax
64
    cmp  eax,ecx
65
    jne  loo2
66
}
67
 
68
 
69
macro findmas masoff,obroff
70
{
71
local loo,looend,lend
72
    mov edi,masoff   ;tekoff
73
    add edi,8
74
    mov ebp,[masoff]   ;elements
75
    mov edx,[masoff+4] ;elemsize
76
    mov eax,0 ;count
77
loo:
78
    pushad
79
    mov  eax,0
80
    call obroff
81
    cmp  eax,1
82
    je   looend
83
    popad
84
    add  edi,edx
85
    inc  eax
86
    cmp  eax,ebp
87
    jne  loo
88
    stc
89
    jmp  lend
90
looend:
91
    popad
92
    clc
93
lend:
94
}