4_7.ASM
资源名称:huibian.rar [点击查看]
上传用户:xinbaokeji
上传日期:2022-07-05
资源大小:295k
文件大小:0k
源码类别:
汇编语言
开发平台:
Visual C++
- DATA SEGMENT
- BUF DW 3,-4,6,7,9,2,0,-8,-9,-10,20
- N = ($-BUF)/2
- DATA ENDS
- STACK SEGMENT STACK
- DB 200 DUP(0)
- STACK ENDS
- CODE SEGMENT
- ASSUME CS:CODE,DS:DATA,SS:STACK
- START: MOV AX,DATA
- MOV DS,AX
- MOV CX,N
- DEC CX
- LOOP1: MOV DX,CX
- MOV BX,0
- LOOP2: MOV AX,BUF[BX]
- CMP AX,BUF[BX+2]
- JGE L
- XCHG AX,BUF[BX+2]
- MOV BUF[BX],AX
- L: ADD BX,2
- DEC CX
- JNE LOOP2
- MOV CX,DX
- LOOP LOOP1
- MOV AH,4CH
- INT 21H
- CODE ENDS
- END START