我的是不软件有问题啊,每次调试loop都不循环
我想用汇编做个求平方根的,可总是不对,而且感觉是不思路偏了,输入一个数整的好麻烦DATA SEGMENT
DA2 DB 10
DB ?
DB 10 DUP(?)
DA3 DW 0
DA4 DB ?
TEN DW 10
SQR DW 0H
DATA ENDS
STACK1 SEGMENT PARA STACK
DW 10H DUP(0)
STACK1 ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK1
START: MOV AX, DATA
MOV DS, AX
MOV DX,OFFSET DA2
MOV AH,0AH
INT 21H
LEA DI,DA2
MOV CL,[DI]+1
MOV CH,0H
MOV BX,CX
L1: MOV AL, [DI]+2
SUB AL,30H
DAS
MOV [DI]+2 ,AL
INC DI
LOOP L1
MOV CX,BX
DEC CX
LEA DI,DA2
L3: MOV BX,CX
L2: MOV AX,01H
MUL TEN
LOOP L2
MOV CX,BX
MOV BL,[DI]+2
MOV DA4,BL
MUL DA4
ADD DA3,AX
INC DI
LOOP L3
MOV BL,[DI]+3
MOV BH,0
ADD DA3,BX
MOV AX ,DA3
MOV CX,0
MOV DX,1
LOP: SUB AX,DX
DAS
JB END0
INC CX
ADD DX,2
JMP LOP
END0: MOV SQR, CX
MOV DX, SQR
MOV AH,02H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START,谁给看下
[ 本帖最后由 liu322 于 2012-10-19 08:51 编辑 ]