Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getElement macro
- local endRead
- push esi
- push cx
- imul si, WORD_SIZE
- mov cx, si
- and cx, 31
- sub si, cx
- shr si, 3
- mov ebx, [ebp + esi]
- shl ebx, cl
- and ebx, WORD_MASK
- cmp cx, 11
- jl endRead
- push eax
- mov eax, [ebp+esi+4]
- xchg si, cx
- mov cx, 32
- sub cx, si
- shr eax, cl
- or ebx, eax
- and ebx, WORD_MASK
- pop eax
- endRead:
- pop cx
- pop esi
- endm
- setElement macro
- local endWrite
- push di
- push cx
- push dx
- push eax
- and ebx, WORD_MASK
- imul di, WORD_SIZE
- mov cx, di
- and cx, 31
- sub di, cx ; ГЎГЁГІГ»
- shr di, 3 ; áà éòû
- mov eax, WORD_MASK
- shr eax, cl
- not eax
- and eax, [ebp+edi]
- push ebx
- shr ebx, cl
- or eax, ebx
- pop ebx
- mov [ebp+edi], eax
- cmp cx, 11
- jl endWrite
- mov dx, 32
- sub dx, cx
- xchg cx, dx
- mov eax, WORD_MASK
- shl eax, cl
- not eax
- and eax, [ebp+edi+4]
- push ebx
- shl ebx, cl
- or eax, ebx
- pop ebx
- mov [ebp+edi+4], eax
- endWrite:
- pop eax
- pop dx
- pop cx
- pop di
- endm
- changeSign macro
- local COUNT_LOOP, zeroBit
- getElement
- cmp ebx, 0
- jge @greater
- not ebx
- @greater:
- endm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement