代码如下(由于emu8086对中文代码的注释支持不好,会让程序出现莫名其妙的bug,所以最终运行成功的代码我还没有写注释)
assume cs:code,ss:stack,ds:data
data segment
db '1975',0,'1976',0,'1977',0,'1978',0,'1979',0,'1980',0,'1981',0,'1982',0,'1983',0
db '1984',0,'1985',0,'1986',0,'1987',0,'1988',0,'1989',0,'1990',0,'1991',0,'1992',0
db '1993',0,'1994',0,'1995',0
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226
dw 11542,14430,15257,17800
dw 0
db 10 dup (0)
dw 0,105,189
data ends
stack segment
dw 24 dup (0)
stack ends
code segment
start:mov cx,21
mov dh,3
mov dl,22
mov ax,data
mov ds,ax
mov ax,0
mov bx,105
mov si,0
mov di,233
l: push cx
mov ch,dh
mov si,ds:[243]
mov ax,ds:[si]
mov ds:[di],ax
mov ax,ds:2[si]
mov ds:2[di],ax
mov al,ds:4[si]
mov ds:4[di],al
mov cl,7
call show_str
add si,5
mov ds:[243],si
add dl,9
mov si,ds:[245]
call dd_dtoc
call show_str
add si,4
mov ds:[245],si
add dl,9
mov si,ds:[247]
call dw_dtoc
call show_str
mov ax,ds:[bx]
mov dx,ds:[bx+2]
mov si,ds:[247]
div word ptr ds:[si]
add si,2
mov ds:[247],si
mov ds:[231],ax
mov si,231
call dw_dtoc
mov dh,ch
mov dl,49
call show_str
inc dh
mov dl,22
add bx,4
pop cx
loop l
mov ax,4c00h
int 21h
dw_dtoc:push ax
push bx
push cx
push dx
push si
push di
mov dx,0
mov ax,ds:[si]
jmp short s0
dd_dtoc:push ax
push bx
push cx
push dx
push si
push di
mov dx,ds:[si+2]
mov ax,ds:[si]
s0:mov cx,dx
jcxz else0
else0:mov cx,ax
jcxz s1
mov cx,10
call divdw
push cx
jmp short s0
s1:mov cx,20H
sub cx,sp
jcxz ok0
pop ds:[di]
add byte ptr ds:[di],30H
inc di
jmp short s1
ok0:mov byte ptr ds:[di],20H
mov byte ptr ds:[di+1],00H
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
divdw:push bx
mov bx,ax
mov ax,dx
mov dx,0
div cx
push ax
mov ax,bx
div cx
mov cx,dx
pop dx
pop bx
ret
show_str: push ax
push bx
push cx
push dx
push si
push di
mov ax,0b800h
mov es,ax
mov al,160
dec dh
mul dh
mov bx,ax
add dl,dl
mov dh,0
mov si,dx
sub si,2
mov al,cl
mov ch,0
s2: mov cl,ds:[di]
jcxz ok1
mov es:[bx+si],cl
mov es:[bx+si+1],al
inc di
add si,2
loop s2
ok1:pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
code ends
end start
assume cs:code,ss:stack,ds:data
data segment
db '1975',0,'1976',0,'1977',0,'1978',0,'1979',0,'1980',0,'1981',0,'1982',0,'1983',0
db '1984',0,'1985',0,'1986',0,'1987',0,'1988',0,'1989',0,'1990',0,'1991',0,'1992',0
db '1993',0,'1994',0,'1995',0
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226
dw 11542,14430,15257,17800
dw 0
db 10 dup (0)
dw 0,105,189
data ends
stack segment
dw 24 dup (0)
stack ends
code segment
start:mov cx,21
mov dh,3
mov dl,22
mov ax,data
mov ds,ax
mov ax,0
mov bx,105
mov si,0
mov di,233
l: push cx
mov ch,dh
mov si,ds:[243]
mov ax,ds:[si]
mov ds:[di],ax
mov ax,ds:2[si]
mov ds:2[di],ax
mov al,ds:4[si]
mov ds:4[di],al
mov cl,7
call show_str
add si,5
mov ds:[243],si
add dl,9
mov si,ds:[245]
call dd_dtoc
call show_str
add si,4
mov ds:[245],si
add dl,9
mov si,ds:[247]
call dw_dtoc
call show_str
mov ax,ds:[bx]
mov dx,ds:[bx+2]
mov si,ds:[247]
div word ptr ds:[si]
add si,2
mov ds:[247],si
mov ds:[231],ax
mov si,231
call dw_dtoc
mov dh,ch
mov dl,49
call show_str
inc dh
mov dl,22
add bx,4
pop cx
loop l
mov ax,4c00h
int 21h
dw_dtoc:push ax
push bx
push cx
push dx
push si
push di
mov dx,0
mov ax,ds:[si]
jmp short s0
dd_dtoc:push ax
push bx
push cx
push dx
push si
push di
mov dx,ds:[si+2]
mov ax,ds:[si]
s0:mov cx,dx
jcxz else0
else0:mov cx,ax
jcxz s1
mov cx,10
call divdw
push cx
jmp short s0
s1:mov cx,20H
sub cx,sp
jcxz ok0
pop ds:[di]
add byte ptr ds:[di],30H
inc di
jmp short s1
ok0:mov byte ptr ds:[di],20H
mov byte ptr ds:[di+1],00H
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
divdw:push bx
mov bx,ax
mov ax,dx
mov dx,0
div cx
push ax
mov ax,bx
div cx
mov cx,dx
pop dx
pop bx
ret
show_str: push ax
push bx
push cx
push dx
push si
push di
mov ax,0b800h
mov es,ax
mov al,160
dec dh
mul dh
mov bx,ax
add dl,dl
mov dh,0
mov si,dx
sub si,2
mov al,cl
mov ch,0
s2: mov cl,ds:[di]
jcxz ok1
mov es:[bx+si],cl
mov es:[bx+si+1],al
inc di
add si,2
loop s2
ok1:pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
code ends
end start