开发者

Long code length bug in MASM?

I'm currently working on a rather big assembly program it's a chatter bot. It spans currently well over 700 lines of code. In my program I've two labels, my program uses these labels to keep tr开发者_StackOverflow中文版ack of certain data that gets moved around in a random manner.

Let me explain to you what happened. The job the program has to do is big, so what I tend to do is I chop these bits of code in pieces. I create separate projects for all the functions my program needs, and when they're working I include them in the main program.

I had one of these functions completed just now, and I integrated it into my program. The function came between the two labels I told you about before.

When I tried to compile the program I got an error saying:

ChatterBot.asm<22>: Unidentified symbol: EEEndLenght (which is the name of the 2nd label)

The label is 633 lines further away on line 655, if I remove the function again, the error disappears, I'm sure the same label doesn't occur in the new function and I've changed it's name several times

Does anyone know why this is happening and how I can fix it?

Overview:

.386
.model flat,stdcall
option casemap:none
include \masm32\include\masm32rt.inc
include \masm32\include\masm32.inc
include \masm32\include\wsock32.inc
includelib \masm32\lib\wsock32.lib

system PROTO C, :PTR BYTE  
SavePoly PROTO 
       .code

Start:
...
...
mov ecx, (EEEdnLength - Startl) ; line 22, with the label 
...
...

Startl
...
...
GetNumb1And8 PROTO
Filleax PROTO
...
...
FSTR PROTO
recv PROTO
GetData PROTO, nread:DWORD
...
main proc
...
...
Rand proc  
...
Rand endp 
...
...
main endp
...
...
FSTR proc
...
...
FSTR endp 
...
...
GetData proc nread:DWORD
...
...
GetData endp
...
...
end main
...
...
EEEdnLength:
...
...
ret
SavePoly endp
EndForError:
edd:
ret ; kthxbai
end Start

Edit: now I look at it like this, I think I've already found what's wrong, end main - that's wrong. I'm sorry for wasting your time guys, it was indeed the :end main that messed up.


It's really hard to guess without even an extract from your code, but one possibility is that if you use a .mode" statement, MASM will default to exporting only names ofprocs -- a "normal" label defined like:mylabel:` is visible only inside that source file.

If that's the problem, you can add export EEEdnLength, or (if memory serves) you can define it like: EEEndLength:: (two colons instead of one).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜