weixin_43625345
彭志远
2018-11-29 02:41

汇编语言中出现 ATTEMPT TO ACCESS DATA OUTSIDE SEGMENT BOUNDS的link错误,求大神帮助

  • access
  • 汇编语言

本人初学汇编语言,有很多错误,该问题是讲al中的二进制数转化成16进制数并输出,可是出现了错误说我在范围外调用data segment
代码如下:
DATA SEGMENT
RESULT DB 2 DUP(?)
DATA ENDS
STACK SEGMENT
DB 200(?)
CODE SEGMENT
MAIN PROC FAR
ASSUME CS:CODE, DS:DATA
START:
PUSH DS
SUB AX,AX
PUSH AX

MOV AX,DATA
MOV DS,AX

MOV BL,0FH
AND BL,AL
PUSH BL
CALL TRANSFER
MOV AH,BL

MOV BL,11110000B
AND BL,AL
MOV CL,4
SHR BL,CL
PUSH BL
CALL TRANSFER
SHL BL,CL

MOV RESULT,AH
MOV RESULT+1,BL

MOV AH,09H
MOV DX,RESULT

INT 21H
RET
MAIN ENDP

TRANSFER:
POP BL
PUSH AX
PUSH CX
PUSH DX

CMP BL,0AH
JB PROCESS1
JNB PROCESS2
PROCESS1:
ADD BL,30H
PUSH BL
JMP QUIT
PROCESS2:
ADD BL,37H
POP AX
POP CX
POP DX
PUSH BL
QUIT:
RET
END TRANSFER

CODE EDNS
END START

报错信息如下:
fatal error : attemp to access data outside the segment

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换