程序代码:
; ;This Program Compiled Sucess by Masm 6.15 ; assume cs:code code segment start: mov ah,2 mov dl,09h int 21h mov al,1 mov cx,9 t: call show inc al loop t xor ax,ax mov al,1 mov bl,1 mov cx,9 b: call show push bx push cx mov cx,ax a: push ax mul bl call show pop ax inc bl loop a call crlf pop cx pop bx inc al loop b mov ah,4ch int 21h ; crlf proc uses ax bx cx dx mov ah,2 mov dl,0dh int 21h mov dl,0ah int 21h ret crlf endp ; show proc uses ax bx cx dx mov cx,0 s: cmp al,9 ja _div add al,30h push ax inc cx jmp ok _div: inc cx mov bl,10 div bl add ah,30h mov dl,ah push dx and ax,0ffh jmp s ok: pop dx mov ah,2 int 21h loop ok mov ah,2 mov dl,09h int 21h ret show endp ; code ends end start
没法上传图片啦,
运行效果
D:\MASM>command
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.
D:\MASM>99
程序代码:
1 2 3 4 5 6 7 8 9 1 1 2 2 4 3 3 6 9 4 4 8 12 16 5 5 10 15 20 25 6 6 12 18 24 30 36 7 7 14 21 28 35 42 49 8 8 16 24 32 40 48 56 64 9 9 18 27 36 45 54 63 72 81
D:\MASM>
[ 本帖最后由 ansic 于 2011-2-15 16:41 编辑 ]