+ -
当前位置:首页 → 问答吧 → masm出错啊 error A2074: cannot access label through segment

masm出错啊 error A2074: cannot access label through segment

时间:2011-08-19

来源:互联网

E:\masm5\profile\无标题1.ASM(8) : error A2074: cannot access label through segment registers
E:\masm5\profile\无标题1.ASM(9) : error A2074: cannot access label through segment registers
E:\masm5\profile\无标题1.ASM(12) : error A2074: cannot access label through segment registers
E:\masm5\profile\无标题1.ASM(18) : error A2074: cannot access label through segment registers
E:\masm5\profile\无标题1.ASM(22) : error A2074: cannot access label through segment registers

源代码:

DATAX SEGMENT
X DW 0011H
Y DW 0009H
Z DW 7821H
V DW 8990H
DATAX ENDS
CODEX SEGMENT
MOV AX,X
IMUL Y
MOV CX,AX;存储低16位
MOV BX,DX
MOV AX,Z
CWD
ADD CX,AX
ADC BX,DX
SUB CX,540D
SBB BX,0
MOV AX,V
CWD
SUB AX,CX
SBB DX,BX
IDIV X
CODEX ENDS

ASSUME CS:CODEX,DS:DATAX

END

用masm5.0能编译通过,但是就是不能通过radasm和masmpuls。求解啊??网上搜过一些资料,也不解

作者: No_Crack   发布时间: 2011-08-19

...
assume cs:codex,ds:datax
mov ax,datax
mov ds,ax
moc ax,x
...

作者: Only_phantasy   发布时间: 2011-08-19

引用楼主 no_crack 的回复:
E:\masm5\profile\无标题1.ASM(8) : error A2074: cannot access label through segment registers
E:\masm5\profile\无标题1.ASM(9) : error A2074: cannot access label through segment registers
E:\masm5\profile\无……

这段代码一没有指定入口标号,二没有为DS赋初值,三没有正常退出调用。

作者: gsy999   发布时间: 2011-08-19