News:

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

Another wish for SIZEOF

Started by donkey, July 09, 2008, 11:38:17 PM

Previous topic - Next topic

donkey

Hi Jeremy,

I was playing around with some ODBC applications today and since I tend to use structures intensively in those types of applications I came up with another one for the wish list. The application requires that I pass the size of each struct member to the binding function and it would be nice not to have to change each occurance of a binding when I adjust the size of the struct member. If possible something like this would be nice...

SOMESTRUCT STRUCT
item1 DB 256 DUP (?)
item2 DB MAX_PATH DUP (?)
item3 DD ?
ENDS

mov eax,SIZEOF SOMESTRUCT.item2 // would return 260 (MAX_PATH)
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Hi Edgar

I've been asked to add this before by other users, so it's obviously a useful feature.

Attached is a version of GoAsm which should do this ok - I've checked it on all my code and it works.



[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

Thanks Jeremy,

It seems to work fine, comes in handy when I am using structures and binding columns using ODBC, this way I can change the size of a field and not have to search out all the places where it is bound to change buffer sizes.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable