汇编:3个数排序(从大到小)
;三个数排序(从大到小) DATAS SEGMENT array db 12,250,123 DATAS ends CODES SEGMENT ASSUME CS:CODES, DS:DATAS START: mov AX,DATAS mov DS,AX mov si,offset array mov al,[si] mov bl,[si+1] mov cl,[si+2] cmp al,bl jae flag1 ;大于等于跳转 xchg al,bl ;交换 flag1: cmp al,cl jae flag2 ;大于等于跳转 xchg al,cl ;交换 flag2: cmp bl,cl jae flag3 xchg bl,cl ;交换 flag3: ;重新放入缓冲区 mov [si],al mov [si+1],bl mov [si+2],cl mov ah,4ch int 21H CODES ends end START
"你的指尖,拥有改变世界的力量! "
欢迎关注我的个人博客:https://sugarat.top