;调试时需要把中文标点符号改为英文标点符号,否则会出现OUT OF MEMORY的提示信息
DATA SEGMENT;定义数据段
ADR DB 10,-31,-45,67,80,46,0,-31,0,77
NUM EQU $-ADR;NUM是数据个数
DA1 DB 0;DA1用来存放正数的个数,初值为0
DA2 DB 0;DA2用来存放负数的个数,初值为0
DA3 DB 0;DA3用来存放0的个数,初值为0
DATA ENDS
CODE SEGMENT;定义代码段
ASSUME DS:DATA,CS:CODE
START: MOV AX,DATA;数据段地址装入
MOV DS,AX
LEA SI,ADR
MOV CX,NUM
MOV AL,0;AL清零
DON1:MOV AL,[SI]
CMP AL,0
JGE DON2
INC DA2
JMP END0
DON2:CMP AL,0
JZ DON3
INC DA1
JMP END0
DON3:INC DA3
END0:INC SI
DEC CX
JNZ DON1
MOV AH,4CH
INT 21H
CODE ENDS
END START