花了些时间琢磨如何合理的分开子函数和主函数的功能最后把代码从两百多行减少到了170来行
assume cs:code
data segment
d1 db 5,10,00001010b
d2 dw 0,2,0
d3 db '1975','1976','1977','1978','1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989','1990','1991','1992','1993','1994','1995'
d4 dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514,345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
d5 dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226,11542,14430,15257,17800
data ends
stack segment
db 32 dup(0)
stack ends
code segment
start:
mov ax,data ;将地址寄存器指向数据段
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,32 ;初始化栈
call initial ;初始化表格行列指针
mov di,ds:[3]
mov cx,21
mov bx,offset d3