code segment
assume cs:code
org 100h
start:
push cs
pop ds
push cs
pop es
mov si,1
m0: mov di,1
m1: mov ax,si
call dispnum
call dispstar
mov ax,di
call dispnum
call dispequ
mov ax,si
mov bx,di
mul bl
call dispmul
mov dl,' '
mov ah,2
int 21h
mov dl,' '
mov ah,2
int 21h
inc di
cmp di,9
jle m1
call lfcr
call lfcr
inc si
cmp si,9
jle m0
mov ah,4ch
int 21h
;=================
lfcr proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
lfcr endp
;======================
dispstar proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,'*'
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispstar endp
;===================
dispequ proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,'='
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispequ endp
;====================
dispnum proc near
; 将要显示的数据放入AL中
push ax
push bx
push cx
push dx
push si
push di
pushf
add al,30h
mov dl,al
mov ah,2
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispnum endp
;===============
dispmul proc near
; 将要显示的数据放入AL中
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,0
mov cl,10
div cl
mov byte ptr[yy+1],ah ;保存个位
mov byte ptr[yy],al ;保存十位
mov al,byte ptr[yy]
add al,30h ;十位转ASC2
cmp al,30h
jne @2
mov al,' '
@2: mov byte ptr[yy],al
mov al,byte ptr[yy+1]
add al,30h ;个位转ASC2
mov byte ptr[yy+1],al
mov ah,9
lea dx,yy
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
yy db 0,0,'$'
dispmul endp
;===============
code ends
end start