News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Statement too complex question ..

Started by shaldan, December 13, 2005, 11:00:17 AM

Previous topic - Next topic

shaldan

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 ...

ramguru

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

shaldan

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)

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

shaldan

 :U thank you very much Hutch--, this is perfect...

MichaelW

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




eschew obfuscation

shaldan

 :U :dazzled: :))) thank you MichaelW