|
主题 : : 实验7我的代码出了点小问题 [待解决] |
回复[ 1次 ]
点击[ 452次 ] | |
荣誉值:0
信誉值:0
注册日期:2010-07-13 23:22 |
先贴出代码:
assume cs:code
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'
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
dd 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
dw 11542,14430,15257,17800
data ends
table segment
db 21 dup('Year summ ne ?? ')
table ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,table
mov es,ax
mov bx,0
mov si,0
mov di,0
mov cx,21
s:
mov ax,ds:[si+0]
mov es:[bx],ax
mov ax,ds:[si+2]
mov es:[bx+2],ax ;年份
mov ax,ds:[si+84]
mov es:[bx+5],ax
mov ax,ds:[si+86]
mov es:[bx+7],ax ;收入
mov ax,ds:[di+168]
mov es:[bx+10],ax ;雇员数
;mov dx,ds:[si+86]
mov ax,ds:[si+84] ;被除数
div word ptr ds:[di+168]
mov es:[bx+13],ax
add bx,16
add si,4
add di,2
loop s
mov ax,4c00h
int 21h
code ends
end start
运行结果:
-D 0BC5:0
0BC5:0000 31 39 37 35 20 10 00 00-00 20 03 00 20 05 00 20 1975 .... .. ..
0BC5:0010 31 39 37 36 20 16 00 00-00 20 07 00 20 95 24 20 1976 .... .. .$
0BC5:0020 31 39 37 37 20 7E 01 00-00 20 09 00 20 7F 55 20 1977 ~... .. .U
0BC5:0030 31 39 37 38 20 4C 05 00-00 20 0D 00 20 40 8A 20 1978 L... .. @.
0BC5:0040 31 39 37 39 20 56 09 00-00 20 1C 00 20 0C 6E 20 1979 V... .. .n
0BC5:0050 31 39 38 30 20 40 1F 00-00 20 26 00 20 3E 29 20 1980 @... &. >)
0BC5:0060 31 39 38 31 20 80 3E 00-00 20 82 00 20 1C 18 20 1981 .>.. .. ..
0BC5:0070 31 39 38 32 20 A6 5F 00-00 20 DC 00 20 37 54 20 1982 ._.. .. 7T
-我就郁闷了,就第一个运算结果是正确的,后面的商都是错误的,这是为什么呢?我找了好半天了,还是没找出来啊。哪位大侠帮帮我。 | | |