assume cs:codesg,ds:datasg
datasg segment
db '1975','1976','1977','1978','1979','1980','1981','1982','1983'
db '1984','1985','1986','1987','1988','1989','1990','1991','1992'
db '1993','1994','1995'
;以上是表示21年的21个字符串
dd 10H,16H,17EH,54CH,956H,1F40H,3E80H,5FA6H,0C391H,17CC7H,22481H,3038AH
dd 5477CH,903EH,0C42CAH,120D18H,1C1F38H,2A1958H,394428H,46F028H,5A9768H
;以上是表示21年公司总收入的21个dword型数据
dw 3H,7H,9H,0DH,1CH,26H,82H,0DCH,1DCH,30AH,3E9H,5A2H,8D2H,0AE9H,0FC5H,1615H,2022H
dw 2D16H,385EH,3B99H,4588H
;以上是表示21年公司雇员人数的21个word型数据
datasg ends
table segment
db 21 dup ('year summ ne ??')
table ends
codesg segment
start: mov ax,datasg
mov ds,ax
mov bx,0
mov si,0
mov di,0
mov cx,15H
s: ;移入年份
mov ax,ds:[si]
mov ds:[0D2H+bx],ax
mov ax,ds:[si+2]
mov ds:[0D2H+bx+2],ax
mov al,20H
mov ds:[0D2H+bx+4],al
;移入收入
mov ax,ds:[54H+si]
mov ds:[0D2H+bx+5],ax
mov ax,ds:[54H+si+2]
mov ds:[0D2H+bx+7],ax
mov al,20H
mov ds:[0D2H+bx+9H],al
;移入雇员数
mov ax,ds:[0a8H+di]
mov ds:[0D2H+bx+0aH],ax
mov al,20H
mov ds:[0D2H+bx+0cH],al
;计算人均收入
mov ax,ds:[0D2H+bx+5]
mov dx,ds:[0D2H+bx+7]
div word ptr ds:[0D2H+bx+0aH]
mov ds:[0D2H+bx+0dH],ax
mov al,20H
mov ds:[0D2H+bx+0fH],al
add bx,10H
add si,4
add di,2
loop s
mov ax,4c00h
int 21h
codesg ends
end start