主题:高手指点,程序运行不理想
count equ 2
data segment
str1 db 0dh,0ah,'please enter the multipicand: $'
str2 db 0dh,0ah,'please enter the multiplier: $'
str3 db 0dh,0ah,'the product is: $'
mcand dw ?
dw 4 dup (?)
mcato dw ?
dw 4 dup (?)
prot dw 6 dup(?)
data ends
STACK segment STACK
db 100 dup(?)
stack ends
code segment
assume cs:code,ds:data,es:data,ss:stack
main proc far
start:push ds
mov ax,0
push ax
mov ax,data
mov ds,ax
mov es,ax
lea dx,str1
mov ah,09
int 21h
lea si,mcand
mov ah,0ah
int 21h
lea dx,str2
mov ah,09
int 21h
lea bx,mcato
mov ah,0ah
int 21h
lea dx,str3
mov ah,09
int 21h
lea di,prot
push di
mov ax,0
mov cx,2*count
cld
rep stosw
pop di
mov cx,count
exter:push cx
mov dx,[bx]
inc bx
inc bx
push di
push si
mov cx,count
inter:push cx
push dx
lodsw
mul dx
add [di],ax
inc di
inc di
adc [di],dx
mov ah,02h
int 21h
pop dx
pop cx
loop inter
pop si
pop di
inc di
inc di
pop cx
loop exter
ret
main endp
code ends
end start
运行之后不会在屏幕上显示结果
data segment
str1 db 0dh,0ah,'please enter the multipicand: $'
str2 db 0dh,0ah,'please enter the multiplier: $'
str3 db 0dh,0ah,'the product is: $'
mcand dw ?
dw 4 dup (?)
mcato dw ?
dw 4 dup (?)
prot dw 6 dup(?)
data ends
STACK segment STACK
db 100 dup(?)
stack ends
code segment
assume cs:code,ds:data,es:data,ss:stack
main proc far
start:push ds
mov ax,0
push ax
mov ax,data
mov ds,ax
mov es,ax
lea dx,str1
mov ah,09
int 21h
lea si,mcand
mov ah,0ah
int 21h
lea dx,str2
mov ah,09
int 21h
lea bx,mcato
mov ah,0ah
int 21h
lea dx,str3
mov ah,09
int 21h
lea di,prot
push di
mov ax,0
mov cx,2*count
cld
rep stosw
pop di
mov cx,count
exter:push cx
mov dx,[bx]
inc bx
inc bx
push di
push si
mov cx,count
inter:push cx
push dx
lodsw
mul dx
add [di],ax
inc di
inc di
adc [di],dx
mov ah,02h
int 21h
pop dx
pop cx
loop inter
pop si
pop di
inc di
inc di
pop cx
loop exter
ret
main endp
code ends
end start
运行之后不会在屏幕上显示结果