Advertisement
Guest User

Untitled

a guest
Jun 7th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         org 100h
  2.         use16
  3.  
  4. Start:
  5.         push    array
  6.         push    length
  7.  
  8.         call    Procee
  9.  
  10.         ; res in address 'array'
  11.  
  12.         ret
  13.  
  14. Procee:
  15.         push    BP
  16.         mov     BP, SP
  17.  
  18.         mov     DI, word[BP + 6]
  19.         mov     AX, word[BP + 4]
  20.  
  21.         mov     SI, DI
  22.         add     SI, AX
  23.         dec     SI
  24.  
  25.         mov     BH, 2
  26.         div     BH
  27.  
  28.         xor     CX, CX
  29.         mov     CL, AL
  30.  
  31. zaLoop:
  32.         mov     AL, byte[DI]
  33.         mov     AH, byte[SI]
  34.  
  35.         mov     byte[DI], AH
  36.         mov     byte[SI], AL
  37.  
  38.         inc     DI
  39.         dec     SI
  40.  
  41.         loop    zaLoop
  42.  
  43.         pop     BP
  44.         ret     4
  45.  
  46. array   db      4, 9, 0, 5, 2, 6, 3
  47. length  = $ - array
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement