Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;2. Se da un sir de dublucuvinte. Sa se ordoneze descrescator sirul cuvintelor inferioare ale acestor dublucuvinte. Cuvintele superioare raman neschimbate.
- code segment
- start:
- mov ax,data
- mov ds,ax
- mov es,ax
- mov si,offset sir
- mov cx,l-1
- repeta:
- mov di,si
- add di,4
- do:
- mov ax,word ptr [di]
- mov bx, word ptr [si]
- cmp word ptr [si],ax
- ja final
- movsw
- sub di,2
- sub si,2
- mov word ptr [si],ax
- final:
- add di,4
- cmp di,l*4-1
- jl do
- add si,4
- loop repeta
- ;dec cx
- ;cmp cx,0
- ;jne repeta
- mov ax,4c00h
- int 21h
- code ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement