why undefined symbol : START error in masm32 in window 7 64 bit?-Collection of common programming errors

after remove start, it left error at line 16, why error at Mov AX, DATA

Microsoft (R) Macro Assembler Version 6.14.8444 Copyright (C) Microsoft Corp 1981-1997. All rights reserved.

Assembling: D:\Linux\test1.asm D:\Linux\test1.asm(16) : error A2004: symbol type conflict _ Assembly Error

Edited:

        TITLE EXAMPLE
DATA    SEGMENT
VARX    DW          6
VARY    DW          7
RESULT  DW          ?
DATA    ENDS
STACK1  SEGMENT PARA STACK
        DW          20H DUP(0)
STACK1  ENDS
COSEG   SEGMENT
PROC1   PROC    FAR
        ASSUME  CS:COSEG, DS:DATA, SS:STACK1
        PUSH    DS
        MOV     AX, 0
        PUSH    AX
        MOV     AX, DATA
        MOV     DS, AX
        MOV     DX, VARX
        MOV     DX, VARY
        MOV     CL, 3
        SAL     DX, CL
        SUB     DX, VARX
        SAR     DX, 1
        MOV     RESULT, DX
        RET
PROC1   ENDP
COSEG   ENDS
        END
  1. Because START is defined inside a procedure, it is not a valid identifier outside it.

    Also, if it did work you would be creating a bug. PROC is a macro that expands to setup a stack frame, so your label START is not actually at the start of the code, while END START indicates that the entry point for your program is START. If you want your program to start with a main procedure you should just use the name of that procedure after END, like END PROC1.

    If it really was your intent to set the entry point to somewhere in your procedure, you could surround the label with OPTION NOSCOPED and OPTION SCOPED, so the label will be public, and not just visible inside the procedure.

Originally posted 2013-11-09 23:12:09.