;九九乘法口诀表
;作者:神vLinux飘飘
stack segment stack
stack ends
data segment
 author db "Write by vlinux$"
data ends
code segment
 assume cs:code,ds:data,ss:stack
 _main: 
   mov ch,1d
 _main_next_1:
   call _print_crlf
   mov cl,1d
 _main_next_2:
   mov ah,0d
   mov al,cl
   call _print_int
   mov dl,42
   mov ah,2
   int 21h
   mov ah,0d
   mov al,ch
   call _print_int
   mov dl,61
   mov ah,2
   int 21h
   mov ah,0d
   mov al,cl
   mul ch
   call _print_int
   call _print_tab
   mov dl,ch
   inc dl
   inc cl
   cmp cl,dl
   jne _main_next_2
   inc ch
   cmp ch,10d
   jne _main_next_1
   call _print_crlf
   call _print_crlf
   mov ax,data
   mov ds,ax
   mov dx,offset author
   mov ah,9
   int 21h
   mov ah,4ch
   int 21h
 
 _print_int: 
   push ax
   push bx
   push cx
   push dx
   pushf
   mov cx,10000d
   mov bl,0d
 _print_int_next_1: 
   cwd
   div cx
   push ax
   push dx
   cmp al,0d
   jne _print_int_flag_1
   cmp bl,0d
   je _print_int_flag_2
 _print_int_flag_1: 
   mov ah,2
   mov dl,al
   add dl,48
   int 21h
   mov bl,1d
 _print_int_flag_2: 
   mov ax,cx
   mov cx,10d
   cwd
   div cx
   mov cx,ax
   pop ax
   pop dx
   cmp cx,1d
   jne _print_int_next_1
   mov dl,al
   add dl,48
   mov ah,2
   int 21h
   popf
   pop dx
   pop cx
   pop bx
   pop ax
   ret
   
 _print_tab:
   push ax
   push dx
   mov dl,9
   mov ah,2
   int 21h
   pop dx
   pop ax
   ret
   
 _print_crlf:
   push ax
   push dx
   mov dl,10
   mov ah,2
   int 21h
   pop dx
   pop ax
   ret
code ends
 end _main

 
											






