最近在学习汇编,也发现自己好长时间没写博客了,就更新一个昨天用汇编写的冒泡排序吧
上个星期五开始学的汇编,写的较挫,望见谅
代码有bug还望提出,一起讨论
data segment buf db 10,-4,-6,55,30,90,78,88,69 n = $-buf data ends code segment assume cs:code,ds:data start: mov ax , data mov ds , ax mov cx , 0 outter: cmp cx , n je final inc cx mov dx , 0 lea di , buf mov si , 0 inner: mov di , si cmp dx , n-1 je outter inc dx mov si , di inc si mov al , [di] cmp al , [si] jge inner mov bl , [si] mov [si] , al mov [di] , bl jmp inner final: mov ah , 4ch int 21h code ends end start
原文地址:http://blog.csdn.net/lionel_d/article/details/45688627