I would like to know the limitations in declaration. I would like to declare an array of floats for some geometry purposes to:
.data
kostka real4 -1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,
1.0,0.0 ...etc. etc.
but after 36th element of array I get error A2042: statement too complex. And the question is if is there a way to handle this without
storing these values in a file and read it from it ...
thanks ...
Same rule for db same for any type
.data
kostka real4 -1.0,-1.0,......,-1.0
real4 -1.0,-1.0,......,-1.0
real4 -1.0,-1.0,......,-1.0
real4 -1.0,-1.0,......,-1.0
real4 -1.0,-1.0,......,-1.0
thank you .. actually I tried this before, but there is another problem. I would to use SIZEOF and when I declare:
kostka1 real4 -1.0,-1.0,1.0,1.0,-1.0,1.0,1.0,1.0,1.0
real4 -1.0,1.0,1.0,-1.0,-1.0,-1.0,-1.0,1.0,-1.0
real4 1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,-1.0
real4 -1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,-1.0
real4 -1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0,1.0
real4 -1.0,-1.0,1.0,1.0,-1.0,-1.0,1.0,1.0,-1.0
real4 1.0,1.0,1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0
real4 -1.0,-1.0,1.0,-1.0,1.0,1.0,-1.0,1.0,-1.0
then SIZEOF kostka1 returns 36 instead .. and I of course need 9x8x4=288 ...
any redeclarations available ? :)) .. (Hope I understand well SIZEOF)
You are out of luck with SIZEOF as it is designed to work on a single line. There is a trick though, put a dummy variable after your 32 bit float data and subtract the start address of your data from the dummy variable. That will give you the byte count.
:U thank you very much Hutch--, this is perfect...
This will set a numeric equate and a dword variable to the total number of bytes allocated.
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.data
kostka1 real4 -1.0,-1.0, 1.0, 1.0,-1.0, 1.0, 1.0, 1.0, 1.0
real4 -1.0, 1.0, 1.0,-1.0,-1.0,-1.0,-1.0, 1.0,-1.0
real4 1.0, 1.0,-1.0, 1.0,-1.0,-1.0,-1.0, 1.0,-1.0
real4 -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,-1.0
real4 -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0,-1.0, 1.0
real4 -1.0,-1.0, 1.0, 1.0,-1.0,-1.0, 1.0, 1.0,-1.0
real4 1.0, 1.0, 1.0, 1.0,-1.0, 1.0,-1.0,-1.0,-1.0
real4 -1.0,-1.0, 1.0,-1.0, 1.0, 1.0,-1.0, 1.0,-1.0
_SIZEOF_kostka1 = ($ - kostka1)
dd_SIZEOF_kostka1 dd ($ - kostka1)
tmp TEXTEQU %_SIZEOF_kostka1
% echo _SIZEOF_kostka1 = tmp
.code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
print ustr$(dd_SIZEOF_kostka1),13,10
mov eax, input(13,10,"Press enter to exit...")
exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
:U :dazzled: :))) thank you MichaelW