Hello I want to declare a local data:

How its posible to declare it so ?: 190 DUP (0) ???
If there isn't a way how to it ?

Thanks + Bye !
Posted on 2003-04-18 08:57:00 by Forginforcer
LOCAL PathStr[190]:BYTE

; you'll have to fill it with zeroes if you wish.
Posted on 2003-04-18 09:06:51 by bitRAKE
Hi thanks for you quick response !

What means you have to fill...if you wish ? - Isn't there a way do inizialisate it wich zeros ?

How to declare a string while inizialsiasting ?

By the way, its possible to make a variable du declaration ?

guguck DB 150
guguckback DB DUP(0)

P.S. DUP exaclty means duplicate, doesn't ?

PPS whats that ? h_u_h_u doesnt work anymore ! :eek: Whats about my beloved h_u_h_u ! :confused: :mad: :mad: :mad: :mad: :o :( :confused:
Posted on 2003-04-18 09:17:35 by Forginforcer

myproc proc
LOCAL string[64]:BYTE
mov ecx, 16
lea esi,
mov DWORD PTR[esi], 0
add esi,4
dec ecx
jnz @B
myproc endp

Warning the code takes time. Anyway, there is no need to make the string full of zeros, just terminate your string with a zero would be sufficient.
Posted on 2003-04-18 09:23:21 by roticv
Hello @

After inizialisation a BYTE as LOCAL, its possible to declare it as a 200Byte long string ? :confused:
But where I can gat the string, when i cant inizisialisate one ?

Gr??eAlle PROTO
INVOKE lstrcpy, ADDR Gru?1, :confused:

I dont know further
Posted on 2003-04-18 09:30:57 by Forginforcer
No. You have to declare it as 200 bytes before you can use it. Go do some reading up on esp and stack.
Posted on 2003-04-18 09:34:32 by roticv
Year but, how to declare it after iniziasiating, when I'm not allowed to declare a sting ?:confused:
Then I need to decare it in .data but i dont want to that.

Deep Regards !
Posted on 2003-04-18 09:42:45 by Forginforcer
String constants cannot be stored on the stack before the program starts. (There is no space on the stack when the program starts.) You must copy it from global (.data) storage. Any HLL that allows string initialization in a local declaration must do this.

I believe the masm32 package has macros for doing this.
Posted on 2003-04-18 14:08:14 by tenkey

Tenkey is right, what you are asking for is "initialised" data when you want memory on the stack filling with zeros and this can only be stored in the .DATA section.

With a "LOCAL" value, the space is allocated on the stack and it is your responsibility to put what you need in it. A zero fill of memory is easy enough to do with "REP STOSD".

You can dynamically allocate zero filled memory with GlobalAlloc if you need larger amounts than you would normally do on the stack so you have enough options to get the job done that you want.


Posted on 2003-04-18 22:19:56 by hutch--
THK hutch-- +
now I know, thats only possible to stoare data at .data / .data.

Thanks again ! I learn much ! :cool:

DeeP Regards !
Posted on 2003-04-19 02:40:54 by Forginforcer