SIZEOF, sizeof() and parenthesis 
Author Message
 SIZEOF, sizeof() and parenthesis

>T1 TextEqu %(sizeof(s))         ;;Gets A2009: syntax error in expression
>T2 TextEqu %(sizeof(SelRecord)) ;;Produces 0FFFFh!
>T3 TextEqu %(SIZEOF s)          ;;Gets the right answer
>T4 TextEqu %(SIZEOF SelRecord)  ;;Gets the right answer

In the manual parens are never used for SIZEOF.  Unlike C, where sizeof() is
optional ("sizeof STRUC" works fine in C) and where things are very well
defined, masm can work or not work depending on...well, anything it seems.  The
only place I use parens is at expressions, such as "HIGHWORD (380+960)".  That
it worked in other versions, or does for certain data types, isn't surprising,
but it would probably be mentioned in a readme, or at least the mskb.  It's
easy to 'workaround', of course (seems to always work without parens).  My
favorite masm oddity is the line too long error.  That's fun.

 cornel huth    mixers - all sb, wss, cs423x, opl3sax, at-3dxg, xg-dsp
 ~~~~~~~~~~~       *wave - direct-disk play/rec, cd/dae, mpeg audio
  http://www.*-*-*.com/ ;     midi db - the ultimate midi player
 ~~~~~~~~~~~~~~~~           bullet - database toolkits

Wed, 02 May 2001 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 


2. VAST: sizeof() equivalent

3. API problem: sizeof(struct)<>size(GROUP)?

4. C sizeof equivalent in modula 3?

5. "sizeof" a record

6. sizeof, smsw

7. sizeof

8. Help: sizeof in Win32Ada?

9. Booelan Function and sizeof operator

10. portable 'sizeof' solution

11. using sizeof do get the number of bytes used by a type

12. Q: sizeof() in F90?


Powered by phpBB® Forum Software