assume cs:code,ds:data,es:table data 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' ;定义年份完成,byte类型 dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514 dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000 ;定义收入完成,dword类型 dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226 dw 11542,14430,15257,17800 ;定义21年雇佣人数 data ends table segment db 21 dup ('year summ ne ?? ') table ends code segment kaishi: mov ax,data mov ds,ax mov ax,table mov es,ax mov ax,0 mov bx,0 mov si,0 mov di,0 mov cx,21 ;年份开始复制 nfw: push cx mov cx,2 nfn: mov ax,ds:[si] mov es:[bx+di],ax add si,2 add di,2 loop nfn mov di,0 add bx,10H pop cx loop nfw ;年份结束完毕 ;收入开始复制 mov di,5H mov cx,21 mov bx,0 srw: push cx mov cx,2 srn: mov ax,ds:[si] mov es:[bx+di],ax add si,2 add di,2 loop srn mov di,5H add bx,16 pop cx loop srw ;收入结束复制 ;人数开始复制 mov di,0AH mov bx,0 mov cx,21 rs: mov ax,ds:[si] mov es:[bx+di],ax add si,2 add bx,16 loop rs ;人数结束复制 ;计算人均开始,因除数为字型数据即16位除非运算,所有被除数被32位,并且取整 mov bx,0 mov cx,21 rj: mov dx,es:[bx+7H] mov ax,es:[bx+5H] div word ptr es:[bx+0AH] mov es:[bx+0DH],ax add bx,16 loop rj ;计算人均结束 mov ax,4c00h int 21h code ends end kaishi
与您一同分享精彩的网络世界
-486174组织成员