Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. ;2. Se da un sir de dublucuvinte. Sa se ordoneze descrescator sirul cuvintelor inferioare ale acestor dublucuvinte. Cuvintele superioare raman neschimbate.
  2.  
  3. code segment
  4. start:
  5. mov ax,data
  6. mov ds,ax
  7. mov es,ax
  8. mov si,offset sir
  9. mov cx,l-1
  10. repeta:
  11. mov di,si
  12. add di,4
  13. do:
  14. mov ax,word ptr [di]
  15. mov bx, word ptr [si]
  16. cmp word ptr [si],ax
  17. ja final
  18. movsw
  19. sub di,2
  20. sub si,2
  21. mov word ptr [si],ax
  22. final:
  23. add di,4
  24. cmp di,l*4-1
  25. jl do
  26. add si,4
  27. loop repeta
  28. ;dec cx
  29. ;cmp cx,0
  30. ;jne repeta
  31. mov ax,4c00h
  32. int 21h
  33. code ends
  34. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement