MASM macro use local label for each callers, when it called, the local label is replaced by a unique label. such like ??0001
Now I write a macro uses serval local labels,Once I use it for many times the error occured.Then I use /EP option to output preprocessed code,I find the unique label scroll back to ??0000。
I known the maximum number of unique label now in MASM32 is 0xFFFF,How can I solve this problem?
PS: I'm sorry for my poor English!!
Try using two global variables:
include \masm32\include\masm32rt.inc
TheCt = 0
ManyVars MACRO
TheCt = TheCt +1
tmp$ CATSTR <MyLabel>, %TheCt
ENDM
.code
AppName db "Masm32:", 0
start:
REPEAT 100000
ManyVars
ENDM
% echo tmp$
MsgBox 0, "Hello World", addr AppName, MB_OK
exit
end start
You will see MyLabel100000 in the output window.
Oh,That's seems to be a good idea!
Thank you very much!!
Well, I find another problem, such label $tmp can not be used for its CATSTR operation.(i mean what label the $tmp stand for)
Quote from: gabalwto on September 03, 2010, 03:06:10 PM
Well, I find another problem, such label $tmp can not be used for its CATSTR operation.(i mean what label the $tmp stand for)
Can you post example code please?
Well,I have solved my problem. A global label that represented another label can not join the CATSTR SUBSTR expression calculate,finally,I use a for statement to make the calculation enabled.