irvine16

Cannot access label through segment registers, error in assembly

混江龙づ霸主 提交于 2019-12-02 01:28:46
问题 INCLUDE Irvine16.inc .data byteArray BYTE 6 DUP(?) listSize = ($ - byteArray) aSum WORD 0 soffset = 0 .code main PROC mov ax, @data mov ds, ax mov cx, listSize Loop1: mov ax, 0 movzx ax, [byteArray + soffset] add aSum, ax soffset = soffset + 1 loop Loop1 exit main ENDP END main The error I'm getting is error "A2074:cannot access label through segment registers" I'm trying to use the soffset to loop through the byteArray. 回答1: I'm not sure what's in Irvine16.inc, but I bet it is saying .model

Cannot access label through segment registers, error in assembly

大兔子大兔子 提交于 2019-12-01 22:49:58
INCLUDE Irvine16.inc .data byteArray BYTE 6 DUP(?) listSize = ($ - byteArray) aSum WORD 0 soffset = 0 .code main PROC mov ax, @data mov ds, ax mov cx, listSize Loop1: mov ax, 0 movzx ax, [byteArray + soffset] add aSum, ax soffset = soffset + 1 loop Loop1 exit main ENDP END main The error I'm getting is error "A2074:cannot access label through segment registers" I'm trying to use the soffset to loop through the byteArray. I'm not sure what's in Irvine16.inc, but I bet it is saying .model small,... at some point. If you add ASSUME DS:_DATA then your error messages will go away, although I doubt