Advertisement
Guest User

№15

a guest
Jun 5th, 2019
110
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. EchoWait:
  7.         mov     ax, 0c08h       ;like "readln;" in delphi
  8.         int     21h
  9.         test    al,al
  10.         jnz     Skip
  11.         mov     ah, 08h
  12.         int     21h
  13. Skip:
  14.         ret
  15.  
  16. ;===================================
  17. ourArr  db      6, 1,2,3,4,5,6
  18.  
  19. OurProc:
  20.         push    bp
  21.         mov     bp, sp
  22.         push    di
  23.         push    si
  24.  
  25.         xor     cx, cx
  26.         xor     ax, ax
  27.         mov     di, [bp+4]
  28.         mov     cl, byte[di]
  29.         inc     di
  30.         mov     si, [bp+4]
  31.         add     si, cx
  32.  
  33. .Cycle:
  34.         mov     ah, byte[di]
  35.         xchg    ah, byte[si]
  36.         mov     byte[di], ah
  37.         inc     di
  38.         dec     si
  39.         cmp     si, di
  40.         jns     .Cycle
  41.  
  42.  
  43.         pop     si
  44.         pop     di
  45.         pop     bp
  46. ret 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement