永发信息网

程序汇编出错,显示缺少END文件,求高手更正?

答案:3  悬赏:30  手机版
解决时间 2021-06-06 20:05
  • 提问者网友:绫月
  • 2021-06-06 04:10

stack segment stack 'stack'
dw 256H dup(0)
TOP LABEL WORD
stack ends
N=45
data segment
SOURCE MACRO
X=17
REPT 225
X=(X+97)mod50
DB X
ENDM
AVG DW N DUP(0)
NUM DW N
EN DW 6 DUP(0)
LETTER DB 'Total$'
LETA DB 'A:$'
LETB DB 'B:$'
LETC DB 'C:$'
LETD DB 'D:$'
LETE DB 'E:$'
LETF DB 'F:$'
data ends
code segment
begin proc far
assume ss:stack,cs:code,ds:data,ES:DATA
MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV AX,STACK
MOV SS,AX
LEA SP,TOP
LEA SI,SOURCE
LEA DI ,AVG
LEA BX,EN
PUSH SI
PUSH DI
PUSH BX
MOV CX,225
SOURC :
MOV AX ,51
ADD [SI],AX
ADD SI,2
LOOP SOURC
MOV CX,N
COMAVG:
MOV CX,5
XOR AX,AX
MOV AX,[SI]
AVG1:
XOR DX,DX
MOV DX,[SI+2]
ADD AX,DX
LOOP AVG1
DIV BYTE PTR 5
MOV [BX],AL
ADD SI,10
ADD BX,2
LOOP COMAVG
XOR AX,AX
POP BX
POP DI
PUSH DI
PUSH BX
MOV CX,N
COUNT:
MOV AX,[DI]
CMP AX,90
JAE COUNTA
CMP AX,80
JAE COUNTB
CMP AX,70
JAE COUNTC
CMP AX ,66
JAE COUNTD
CMP AX,60
JAE COUNTE
MOV [BX+10],1
JAE COUNTP
COUNTA:
MOV [BX],1
JMP COUNTP
COUNTB:
MOV [BX+2],1
JMP COUNTP
COUNTC:
MOV [BX+4],1
JMP COUNTP
COUNTD:
MOV [BX+6],1
JMP COUNTP
COUNTE:
MOV [BX+8],1
JMP COUNTP
COUNTF:
MOV [BX+10],1
JMP COUNTP
COUNTP:
LOOP COUNT
POP BX
LEA DX,LETTER
MOV AH ,9
INT 21H
XOR AX ,AX
MOV AX ,45
CALL DISPCR
LEA DX,LETA
MOV AH ,9
INT 21H
XOR AX ,AX
MOV AX,DS:[BX]
CALL DISP
CALL DISPCR
LEA DX,LETB
MOV AH ,9
INT 21H
XOR AX ,AX
MOV AX,DS:[BX+2]
CALL DISP
CALL DISPCR
LEA DX,LETC
MOV AH ,9
INT 21H
XOR AX ,AX
MOV AX,DS:[BX+4]
CALL DISP
CALL DISPCR
LEA DX,LETD
MOV AH ,9
INT 21H
XOR AX ,AX
MOV AX,DS:[BX+6]
CALL DISP
CALL DISPCR
LEA DX,LETE
MOV AH ,9
INT 21H
XOR AX ,AX
MOV AX,DS:[BX+8]
CALL DISP
CALL DISPCR
LEA DX,LETF
MOV AH ,9
INT 21H
MOV AX,DS:[BX+10]
CALL DISP
MOV AH,4CH
INT 21H
DISPCR PROC NEAR
PUSH AX
PUSH DX
MOV AH,2
MOV DL,0AH
INT 21H
MOV AH,2
MOV DL ,0DH
INT 21H
POP DX
POP AX
RET
DISPCR ENDP
DISP PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
LEA DI,EN
CALL TRANS
MOV CX,6
LEA DI,EN+5
MOV AH,2
DISP2:
MOV AL, DL
ADD AL,30H
DEC DI
INT 21H
LOOP DISP2
POP DI
POP DX
POP CX
POP BX
POP AX
RET
DISP ENDP
TRANS PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
MOV BX,10
MOV CX,5
TRANS1:
XOR DX,DX
DIV BX
MOV [DI],DL
INC DI
LOOP TRANS1
POP DI
POP DX
POP CX
POP BX
POP AX
RET
TRANS ENDP
code ends
RET
end begin
汇编后显示

Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.

End of file encountered on input file
438.asm(210): warning A4085: End of file, no END directive
Open segments: DATA
End of file encountered on input file
438.asm(210): warning A4085: End of file, no END directive

49996 + 380788 Bytes symbol space free

1 Warning Errors
1 Severe Errors

最佳答案
  • 五星知识达人网友:春色三分
  • 2021-06-06 04:55
宏定义错误
全部回答
  • 1楼网友:一秋
  • 2021-06-06 07:31
这是你从哪里找来的代码哦,我试了下错误一大堆。。
  • 2楼网友:掌灯师
  • 2021-06-06 05:52

不知道你写的什么,

SOURCE MACRO X=17 REPT 225 X=(X+97)mod50 DB X ENDM

宏定义不能放在数据段里,要放在程序的一开始,再者宏定义是执行某些固定操作的,

不能用来定义数据,还有你的这个是什么汇编的表示方法,怎么直接用公式算术符进行运算?

汇编或者汇编的编译器应该没有这么高级吧?能帮我们做这么多事?不太现实~

程序的最后end begin连程序的入口begin:标签都没有!

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯