N的3次放是这样么?
'masmaster'大神给个话
assume cs:code,ds:datadata segment dw 1,2,3,4,5,6,7,8 dd 0,0,0,0,0,0,0,0data endscode segmentstart: mov ax,data mov ds,ax mov bx,0 mov cx,2 call s mov ax,4c00h int 21hs: mov ax,bx mul bx mul bx mov ds:[bx+12h],ax mov ds:[bx+10h],dx add bx,8 loop s ret
assume cs:code,ds:datadata segment dw 1,2,3,4,5,6,7,8 dd 10 dup(0)data endscode segmentstart: mov ax,data mov ds,ax mov bx,0 mov cx,8 call s mov ax,4c00h int 21hs: ; 栈保护与初始化 push di mov di , 0 s1: mov ax , ds:[ di ] ; 存放乘数 mul word ptr ds:[ di ] ; 第一次乘 add ax , dx ; 得到第一次乘法后的总值(没有溢出保护) mul word ptr ds:[ di ] ; 第二次乘 mov ds:[bx+12h],ax mov ds:[bx+10h],dx add bx,8 add di , 2 loop s1 ; 栈恢复与返回 pop di retcode endsend start