Advertisement
LiMIllusion

Invert Array

Mar 31st, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #make_com#
  2. org 100h
  3. jmp start
  4. array db 20 dup(0)
  5. var db ?
  6. c db 0
  7. cc db ?
  8. start:
  9. xor si,si
  10. start1:
  11. cmp si,10
  12. jge continua
  13. mov ah,01h
  14. int 21h
  15. mov array[si],al    
  16. inc si
  17. jmp start1
  18. continua:
  19. xor si,si
  20. continua1:
  21. cmp si,10
  22. jge stampa
  23. mov ah,array[si]
  24. mov cc,ah
  25. push word ptr cc
  26. inc si
  27. jmp continua1
  28.  
  29. stampa:  
  30. xor si,si  
  31. stampa1:    
  32. cmp si,10
  33. jge fine
  34. pop word ptr cc
  35. mov ah,cc
  36. mov array[si],ah
  37.     mov al,array[si]
  38.     mov ah,02h
  39.     int 21h  
  40.    
  41. inc si
  42. jmp stampa1
  43. fine:
  44. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement