Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. getElement macro
  2. local endRead
  3.     push esi
  4.     push cx
  5.    
  6.     imul si, WORD_SIZE
  7.     mov cx, si
  8.     and cx, 31
  9.     sub si, cx 
  10.     shr si, 3  
  11.    
  12.     mov ebx, [ebp + esi]   
  13.     shl ebx, cl        
  14.     and ebx, WORD_MASK 
  15.    
  16.     cmp cx, 11
  17.     jl endRead
  18.     push eax
  19.    
  20.         mov eax, [ebp+esi+4]
  21.         xchg si, cx
  22.         mov cx, 32
  23.         sub cx, si
  24.         shr eax, cl
  25.    
  26.     or ebx, eax
  27.     and ebx, WORD_MASK
  28.    
  29.     pop eax
  30.     endRead:
  31.     pop cx
  32.     pop esi
  33. endm
  34.  
  35. setElement macro
  36. local endWrite
  37.     push di
  38.     push cx
  39.     push dx
  40.     push eax
  41.    
  42.     and ebx, WORD_MASK
  43.    
  44.     imul di, WORD_SIZE
  45.     mov cx, di
  46.     and cx, 31
  47.     sub di, cx  ; ГЎГЁГІГ»
  48.     shr di, 3   ; áàéòû
  49.    
  50.     mov eax, WORD_MASK     
  51.     shr eax, cl        
  52.     not eax
  53.     and eax, [ebp+edi]
  54.    
  55.     push ebx
  56.     shr ebx, cl
  57.     or eax, ebx
  58.     pop ebx
  59.    
  60.     mov [ebp+edi], eax
  61.    
  62.     cmp cx, 11
  63.     jl endWrite
  64.    
  65.         mov dx, 32
  66.         sub dx, cx
  67.         xchg cx, dx
  68.        
  69.         mov eax, WORD_MASK
  70.         shl eax, cl
  71.         not eax
  72.         and eax, [ebp+edi+4]
  73.    
  74.         push ebx
  75.         shl ebx, cl
  76.         or eax, ebx
  77.         pop ebx
  78.    
  79.         mov [ebp+edi+4], eax
  80.    
  81.     endWrite:
  82.     pop eax
  83.     pop dx
  84.     pop cx
  85.     pop di
  86. endm
  87.  
  88. changeSign macro
  89. local COUNT_LOOP, zeroBit
  90.     getElement
  91.     cmp ebx, 0
  92.     jge @greater
  93.     not ebx
  94.     @greater:
  95. endm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement