请老师指正,不胜感谢!代码如下
assume cs:code
data segment
dw 1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985
dw 1986,1987,1988,1989,1990,1991,1992,1993,1994,1995
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514,345980
dd 590827,803503,1183000,1843000,2759000,3753000,4649000,5937000
dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635
dw 8226,11542,14430,15257,17800
data ends
stack segment
db 16 bup(0)
stack ends
data1 segment
dw 10 bup(0)
data1 ends
code sengment
stert: mov ax,stack
mov ss,ax
mov sp,10h
mov ax,data
mov ds,ax
mov si,0
mov di,0
mov bp,0
mov bx,0
mov cx,21
s: push cx
mov ax,[si]
mov dx,0
coll dtoc
mov dl,0
mov dh,0
mov cl,2
coll show_str
inc si
inc si
mov ax,[di+2ah]
add di,2
mov dx,[di+2ah]
add di,2
mov cx,[bp+7eh]
coll divo
mov dx,0
coll dtoc
mov dl,0
mov dh,30
mov cl,2
coll show_str
mov ax,[di+2ah]
add di,2
mov dx,[di+2ah]
add di,2
coll dtoc
mov dl,8
mov dh,0
mov cl,2
coll show_str
mov ax,[bp+7eh]
mov dx,0
add bp,2
cool dtoc
mov dl,20
mov dh,0
mov cl,2
coll show_str
add dh,1
pop cx
loop s
mov ax,4c00h
int 21h
dtoc: push ds
push bx
push cx
mov bx,data1
mov ds,bx
mov bx,15
s2: coll divo
add cx,30h
mov ds:[bx],cx
mov cx,ax
fcxz ok2
mov cx,dx
fcxz ok2
dec bx
inc cx
loop s2
ok2:
pop cx
pop bx
pop ds
ret
divo: push bx
push di
mov bx,ax
mov ax,dx
mov dx,0
div cx
mov di,ax
mov ax,bx
div cx
mov cx,bx
mov dx,di
pop di
pop bx
ret
show_str: push ds
push ax
push si
push cx
push bp
mov ax,0b8000h
mov ds,ax
mov bp,0
mov bl,cl
mov al,160
mul dh
mov bp,ax
mov al,2
mul dl
add bp,ax
s3: mov cl,es:[si]
mov ch,0
fcxz ok1
mov ds:[bp],cl
mov ds:[bp+1],bl
add bp,2
inc si
inc cx
loop s3
ok1: pop bp
pop cx
pop si
pop ax
pop ds
ret
|