u013487601
鬼义II虎神
2015-12-23 08:41

汇编语言习题求解给个答案,谢谢了

  • 汇编语言

认真阅读以下代码,请判断该程序的功能及运算完成后数据区的数据排列。

DATA SEGMENT
BUF DB 0AH,8F,15H,36H,0A6,20H,12H
N = $-BUF

DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
BEGIN: MOV AX,DATA
MOV DS,AX
MOV SI,1

NEXT1: MOV DI,SI

INC DI
MOV AL,[BUF+SI-1]

NEXT2: CMP AL,[BUF+DI-1]

JAE NEXT3

XCHG [BUF+DI-1],AL

MOV [BUF+SI-1],AL
NEXT3: INC DI

CMP DI,N

JBE NEXT2

INC SI

CMP SI,N-1

JBE NEXT1

MOV AH,4CH
INT 21H
CODE ENDS
END BEGIN

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答