Board index » off-topic » About SIZE or LENGTH operators for defined in stack dates.

About SIZE or LENGTH operators for defined in stack dates.


2006-03-13 10:04:52 PM
off-topic5
Hi.
For structures I can use SIZE operator to determine size in bytes of a
structure (IDEAL mode).
For DB dates I can use LENGTH operator to determine the number of DUPlicated
bytes.
But what operator can I use for dates defined in stack?
I mean the following.
Let consider the code
PROC SomeProc
LOCAL @@cString:BYTE:10
mov ax,10 ; I'd like to use something as LENGTH @@cString or something
else instead of the magic 10
Vladimir Grigoriev
 
 

Re:About SIZE or LENGTH operators for defined in stack dates.

Vladimir Grigoriev wrote:
Quote
I'd like to use something as LENGTH @@cString or something
else instead of the magic 10
You probably already know this answer....
DateSize equ 10
PROC SomeProc
LOCAL @@cString:BYTE:DateSize
mov ax,DateSize
Has the added benefit of changing all of your procs with a single
change.
Proc SomeOtherProc
LOCAL @@AlsoChanged:BYTE:DateSize
 

Re:About SIZE or LENGTH operators for defined in stack dates.

Thanks Bob
Of course I know about using equations.
But I don't want to introduce numerous equations. I think that
@@cString:BYTE:10 contains all needed information that might allow to
calculate size (length) of @@cString. It is strange enough that I can use
the following code
DATASEG
SomeBytes db 10 DUP( ? )
CODESEG
mov ax,LENGTH SomeBytes ;as I guess this is equivalent to mov ax,10
but I can not use the same constructions for LOCAL variables.
Vladimir Grigoriev
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>I'd like to use something as LENGTH @@cString or something
>else instead of the magic 10

You probably already know this answer....

DateSize equ 10
PROC SomeProc
LOCAL @@cString:BYTE:DateSize
mov ax,DateSize

Has the added benefit of changing all of your procs with a single
change.

Proc SomeOtherProc
LOCAL @@AlsoChanged:BYTE:DateSize



 

{smallsort}