大家看看这个汇编程序哪儿错了?
设数据区的第一单元存放单元数的个数,从第二单元开始存放数据,在区内最后单元存放结果.先是求负数的个数,然后求零的个数,最后求正数的个数.
CODE SEGMENT
ASSUME CS:CODE
START: MOV DI,3000H
MOV CL,[DI]
XOR CH,CH
MOV BL,CH
MOV BH,CH
INC DI
A1: MOV AL,[DI]
TEST AL,80H
JE A2
INC BL
A2: TEST AL,OFFH
JNE A3
INC BH
A3: INC DI
LOOP A1
MOV [DI],BL
INC DI
MOV [DI],BH
MOV AL,CL
SUB AL,BL
SUB AL,BH
INC DI
MOV [DI],AL
MOV AH,4CH
INT 21H
CODE ENDS
END START
CODE SEGMENT
ASSUME CS:CODE
START: MOV DI,3000H
MOV CL,[DI]
XOR CH,CH
MOV BL,CH
MOV BH,CH
INC DI
A1: MOV AL,[DI]
TEST AL,80H
JE A2
INC BL
A2: TEST AL,OFFH
JNE A3
INC BH
A3: INC DI
LOOP A1
MOV [DI],BL
INC DI
MOV [DI],BH
MOV AL,CL
SUB AL,BL
SUB AL,BH
INC DI
MOV [DI],AL
MOV AH,4CH
INT 21H
CODE ENDS
END START