刚刚开始接触汇编,有很多地方都不是很明白,希望大家可以多给意见,下面是我的源代码:
DATAS SEGMENT
BU DB 16,?,16 DUP ('0') ,'$'
TIP DB 10,10,"PLEASE INPUT A NUMBER: $"
SHU DB 10D
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS
START:
MOV AX,DATAS
MOV DS,AX
LEA DX,TIP
MOV AH,09H
INT 21H
LEA DX,BU
MOV AH,0AH
INT 21H
LEA BX,BU+1
MOV CH,[BX]
XOR DX,DX
INC BX
AA:
XOR AX,AX
MOV AX,[BX]
MOV CL,CH
DEC CL
.WHILE CL!=0
MUL SHU
DEC CL
.ENDW
ADD DX,AX
INC BX
DEC CH
LOOP AA
MOV AX,DX
;SUB AX,30H
CALL CRLF
XOR CX,CX
MOV CX,02D
LEA BX,BU
MOV BX,17
AGAIN:
XOR DX,DX
DIV CX
;ADD DL,30H
MOV [BX],DL
DEC BX
.IF AX!=1
JMP AGAIN
.ENDIF
LEA DX,BU+2
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
CRLF PROC
PUSH AX
PUSH DX
MOV DL,0DH
MOV AH,2
INT 21H
MOV DL,0AH
MOV AH,2
INT 21H
POP DX
POP AX
RET
CRLF ENDP
CODES ENDS
END START
不知怎么的,总之运行不了,而自己又发现不到问题,请求大家帮忙...谢谢!
------解决方案--------------------------------------------------------