王爽老师汇编语言3实验7
实验7终于做完了。也不知道对不对,不过程序能顺利执行完,抽查了里面五、六组数据没问题。其实也是边用debug调试边改,稀里糊涂的做完了。留个贴,鼓励下自己。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:
mov ds:,ax
mov ax,ds:
mov ds:,ax
mov al,20H
mov ds:,al
;移入收入
mov ax,ds:
mov ds:,ax
mov ax,ds:
mov ds:,ax
mov al,20H
mov ds:,al
;移入雇员数
mov ax,ds:
mov ds:,ax
mov al,20H
mov ds:,al
;计算人均收入
mov ax,ds:
mov dx,ds:
div word ptr ds:
mov ds:,ax
mov al,20H
mov ds:,al
add bx,10H
add si,4
add di,2
loop s
mov ax,4c00h
int 21h
codesg ends
end start
页:
[1]