|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
代码如下:
assume cs:codesg
data segment
db '1975','1976','1977','1978','1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989','1990','1991','1992','1993','1994','1995'
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514,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,11542,14430,15257,17800
data ends
codesg segment
start:mov ax,data
mov ds,ax
mov ax,0b80ah
mov es,ax
mov cx,3360 ;先将预显示数据的区域腾出来
mov bx,0
c:mov al,0
mov es:[bx],al
inc bx
loop c
mov si,0
mov di,0
mov bp,0
mov cx,21
push ax
push bx
push dx
push si
push bp
push di
s: push cx
mov cx,4;先将为字符串的年号显示出来
mov bx,0
push bp
mov bp,0
s1:mov al,[si+bp]
mov es:[di+bx],al
mov al,07h
mov es:[di+bx+1],al
inc bp
add bx,2
loop s1
pop bp
mov ax,[bp+0a8h] ;显示收入
mov dx,0
mov bx,0
call s2
mov ax,[si+54h] ; 显示雇员数
mov dx,[si+56h]
mov bx,0
call s3
mov ax,[si+54h] ;显示人均收入
mov dx,[si+56h]
mov bx,0
mov cx,[bp+0a8h]
call divdw
call s4
add bp,2h
add si,4h
add di,0a0h
pop cx
loop s
pop di
pop bp
pop si
pop dx
pop bx
pop ax
mov ax,4c00h
int 21h
s2:mov cx,10
call divdw
add cl,30h
push cx
inc bx
mov cx,ax
or cx,dx
add cx,1
loop s2
mov cx,bx
mov bx,0
sa:pop ax
mov es:[di+bx+50h],al
mov al,07h
mov es:[di+bx+51h],al
add bx,2
loop sa
ret
s3:mov cx,10
call divdw
add cl,30h
push cx
inc bx
mov cx,ax
or cx,dx
add cx,1
loop s3
mov cx,bx
mov bx,0
sb:pop ax
mov es:[di+bx+28h],al
mov al,07h
mov es:[di+bx+29h],al
add bx,2
loop sb
ret
s4:mov cx,10
call divdw
add cl,30h
push cx
inc bx
mov cx,ax
or cx,dx
add cx,1
loop s4
mov cx,bx
mov bx,0
sc:pop ax
mov es:[di+bx+78h],al
mov al,07h
mov es:[di+bx+79h],al
add bx,2
loop sc
ret
divdw: ;该子程序用于DW型除法计算
push bx ;将BX入栈保存
;因为要用AX、DX传商,CX传余数,所以无须入栈保存
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
codesg ends
end start |
|