求阶乘程序,求帮改改错
DATAS SEGMENTA DB "PLEASE INPUT DATA 0-8",10,13,"$"
B DB 10,13,"CUOWU",10,13,"$"
;此处输入数据段代码
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV DX,OFFSET A
MOV AH,09
INT 21H
L1: MOV AH,1
INT 21H
CMP AL,30H
JZ A6
CMP AL,38H
JNS CUO
CMP AL,30H
JS CUO
SUB AL,30
MOV CL,AL
L2: DEC CL ;cl每次减1乘al再存到al中
MUL CL
CMP CL,1
JNZ L2
JMP L3
A6: MOV AX,1 ;0的情况
JMP L3
CUO:MOV DX,OFFSET B
MOV AH,9
INT 21H
JMP L1;此处输入代码段代码
L3:MOV AH,4CH
INT 21H
CODES ENDS
END START
目的把阶乘的结果存到al中