DATA SEGMENT
INPUT DB 'INPUT A DIGIT : $'
ENTER DB 0DH , 0AH , '$'蔽数
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 AH , 9
LEA DX , INPUT
INT 21H
MOV AH , 1
INT 21H
LEA DX , ENTER
MOV AH , 9
INT 21H
CMP AL ,BYTE PTR 0
JBE BELOW
MOV DL , '宏逗首指链1'
JMP EXIT
BELOW :
MOV DL , AL
EXIT :
MOV AH , 2
INT 21H
MOV AH , 1
INT 21
MOV AH , 4CH
INT 21H
CODE ENDS
END START
原理是,先接收一个数字,让他和0比较。若为真返回0,否则返回.