asm实现双循环
我们用dx,实现cx数据的临时存储
;dx be used for double loops, it can save the value of cx
;double loop
assume cs:code
code segment
mov cx,2h
mov ax,0h
s:
mov dx,cx
mov cx,5h
s0:
inc ax
loop s0
mov cx,dx
loop s ;cx=cx-1
code ends
end
由于cx会受两个循环同时影响,所以我们用dx储存外层loop的cx,总共10次循环