I 'm trying to build an 2 KB array containing double-words in Masm32, by storing it in an include file (.data). The linker rejects the array because of a "line too long" error even if the "\" is used. How can I build arrays bigger that the 512 line limit in Masm32 without resorting to reading from a file ? Thank you in advance.
I'm not a big user of masm, but I'm assuming you're using a built in feature to work with arrays that requires the whole array to be on one line. Assuming the above, don't tell masm that you are creating an array. Instead use something like below:
Access your array by:
Array dd 0, 5, 7, 8 dd 9, 0xffe45234, 32423, 4054734786
rol esi, 2 ;esi contains element. esi *= 4 mov eax,
It is probably because you are using "\" too much. Masm's limit on the length of such lines is pretty small (512?) but you can easily get around it: MyTable DWORD 1,2,3, \ 4,5,6 ;no backslash here DWORD 7,8,9, \ 10,11,12 DWORD 13, etc.
A static array is probably not a good way to do what you are after anyway, setting a global handle in the .DATA? section and allocating a dynamic array attached to that handle would be a much better way to do what you are after and your file is smaller for doing it. GlobalAlloc(), OLE string memory, VirtualAlloc() etc.. can all be used for doing this and it does not have any real size limit apart from the amount of memory you have on the machine. Regards, firstname.lastname@example.org