大家帮我看看这个哪里错了
找出buf数据块里最小的偶数(带符号字节数),以16进制形式输出.DATA SEGMENT
SAVEREG DB 50 DUP(?);
BUF DB 66H,84H,94H,7AH,70H,69H;
COUNT EQU ($-BUF)/1;
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MAIN PROC FAR;
MOV AX,DATA
MOV DS,AX
;此处输入代码段代码
LEA SI,BUF; 首地址;
MOV CX,COUNT; 个数;
PUSH SI;
PUSH CX;
CALL MINPROC;
CALL OUTPUT;
MOV AH,4CH;
INT 21H;
;寻找最小元素。
MINPROC PROC NEAR
LEA DI,SAVEREG;
MOV [DI],AX;
MOV [DI+2],BX;
MOV [DI+4],CX;
MOV [DI+6],DX;
POP DX;
POP SI;数组首地址;
POP CX;个数;
PUSH DX;
MOV AL,[SI];
SEARCH:
MOV DL,[SI];
TEST DL,01H;
JZ AA1;
JMP AA2;
AA1:
CMP DL,AL;
JL AA3;
JMP AA2;
AA3:
MOV AL,DL; 改变al
AA2:
INC SI;
LOOP SEARCH;
MOV AH,0;
POP CX;
PUSH AX;
PUSH CX;
LEA DI,SAVEREG
MOV AX,[DI];
MOV BX,[DI+2];
MOV CX,[DI+4];
MOV DX,[DI+6];
RET
MINPROC ENDP;
;寻找最小元素函数结束
;最小元素存在栈区里,下面的函数为从栈中取元素,然后以16进制输出。
OUTPUT PROC NEAR;
LEA DI,SAVEREG;
MOV [DI],AX;
MOV [DI+2],BX;
MOV [DI+4],CX;
MOV [DI+6],DX;
POP AX;
POP BX; 最小元素在栈里
PUSH AX;
MOV CH,4;
MOV CL,4;
RLL:
ROL BX,CL;
MOV DL,BL;
AND DL,0FH;
ADD DL,30H;
CMP DL,3AH;
JB SKIP;
ADD DL,7;
SKIP:
MOV AH,2;
INT 21H;
DEC CH;
JNZ RLL;
MOV DL,'H';
MOV AH,2;
INT 21H;
LEA DI,SAVEREG
MOV AX,[DI];
MOV BX,[DI+2];
MOV CX,[DI+4];
MOV DX,[DI+6];
RET
OUTPUT ENDP;
;16进制输出函数结束
MAIN ENDP;
CODE ENDS;
END