实验七,求解!
assume cs:codesgdata segment
db '1975','1976','1977','1978','1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989','1990','1991','1992'
db '1993','1994','1995'
dd 16,22,382,1356,2930,8000,16000,24886,50065,97479,140417,197514,345980,590827,803530,1183000,2759000
dd 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
table segment
db 21 dup ('year summ ne ??')
table ends
codesg 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:
mov es:,ax
add si,2
mov ax,ds:
mov es:,ax
mov ax,ds:
mov es:,ax
mov ax,ds:
mov es:,ax
mov ax,ds:
mov es:,ax
mov ax,ds:
mov dx,ds:
div word ptr ds:
mov es:,ax
add di,2
add bx,16
loop s
mov ax,4c00h
int 21h
codesg ends
end start 这是个有问题的代码,有无大佬指点指点 本帖最后由 jackz007 于 2020-11-4 11:30 编辑
ASSUME CS:CODE,DS:DATA,ES:TABLE,SS:STACK
DATA SEGMENT PARA PUBLIC 'DATA'
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,184300,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 PARA PUBLIC 'TABLE'
DB 21 DUP ('year summ ne ?? ')
TABLE ENDS
STACK SEGMENT STACK
DW 0800H DUP(00)
STACK ENDS
CODE SEGMENT
MAIN PROC FAR
MOV AX,DATA
MOV DS,AX
MOV AX,TABLE
MOV ES,AX
XOR SI,SI
XOR BX,BX
MOV CX,21
CLD
M1: PUSH CX ; 传递年份
XOR DI,DI
ADD DI,BX
MOV CX,4
REP MOVSB
ADD BX,16
POP CX
LOOP M1
XOR BX,BX ; 传递雇员数
MOV CX,21
M2: MOV DI,5
ADD DI,BX
MOVSW
MOVSW
ADD BX,16
LOOP M2
XOR BX,BX ; 传递收入
MOV CX,21
M3: MOV DI,10
ADD DI,BX
MOVSW
ADD BX,16
LOOP M3
XOR BX,BX ; 计算人均收入
MOV CX,21
M4: MOV SI,5
ADD SI,BX
MOV AX,ES:
MOV DX,ES:
DIV WORD PTR ES:
MOV ES:,AX
ADD BX,16
LOOP M4
XOR AX,AX
INT 016H
MOV AX,04C00H
INT 021H
MAIN ENDP
CODE ENDS
END MAIN jackz007 发表于 2020-11-4 11:24
码了!中午回宿舍试试看! jackz007 发表于 2020-11-4 11:24
你可以看一下我写的那个错误在哪儿吗?
页:
[1]