Advertisement
Guest User

test

a guest
Jun 4th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         org     100h
  2.  
  3.         push    ourArr
  4.         call    OurProc
  5.  
  6.         mov     [result], eax
  7.         call    OPNum
  8.  
  9. EchoWait:
  10.         mov     ax, 0c08h       ;like "readln;" in delphi
  11.         int     21h
  12.         test    al,al
  13.         jnz     Skip
  14.         mov     ah, 08h
  15.         int     21h
  16. Skip:
  17.         ret
  18.  
  19. ;===================================
  20. ourArr  db      6, 7,11,5,2,3,7
  21. result  dd      ?
  22.  
  23. include 'opnum.inc'
  24.  
  25. OurProc:
  26.         push    bp
  27.         mov     bp, sp
  28.         push    di
  29.         mov     di, [bp+4]
  30.         xor     eax, eax
  31.         xor     cx, cx
  32.         mov     cl, byte[di]
  33.         inc     di
  34.  
  35. .Cycle:
  36.         test    byte[di], 00000001b
  37.         jz      .Skip
  38.         test    byte[di], 00000010b
  39.         jz      .Skip
  40.         inc     eax
  41. .Skip:
  42.         inc     di
  43.         loop    .Cycle
  44.         pop     di
  45.         pop     bp
  46. ret 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement