程序代码:
data segment
num dw 1
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov cx,0ffffh ;short int times = 65535;
next:
push cx
mov si,0 ;short int count = 0;
mov cx,10 ;short int k = 10;
mov ax,num ;short int num = 1;
xor bx,bx ;short int tmp = {0};
again:
xor dx,dx
div cx
mov bx,dx ;tmp = num % k;
push bx ;*--sys_stack = tmp;
inc si ;count++;
cmp ax,0
jnz again ;if (num / k != 0) goto again;
exit:
pop bx ;tmp = *sys_stack++;
add bl,30h
mov dl,bl
mov ah,02h ;putchar(tmp + '0');
int 21h
dec si ;count--;
cmp si,0
jnz exit ;if (count != 0) goto exit
mov dl,20h
int 21h ;putchar(' ');
inc word ptr ds:[num] ;num++;
pop cx
loop next ;while (times--);
mov ah,4ch
int 21h ;exit(0);
code ends
end start
有时候也要自己学着调试(走),慢慢的学会编(跑),再学会设计(飞),不管学什么语言如果连调试都不会,将来出去是要被人笑话的.