News:

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

Data Declaration: Local or Global?

Started by BrWarburto, January 30, 2006, 05:55:11 PM

Previous topic - Next topic

BrWarburto

In Goasm is it possible to make a distinction between local and global data as in 'C' language
or is this a meaningless question ?
Brwarburto

donkey

LOCAL data in any language is stored on the stack, when you create a stack frame you declare it using the LOCAL directive....

MyProc FRAME
LOCAL hHandle :D

RET
ENDF

Global data is declared in the DATA SECTION of your program. For the most part in multithreaded applications, you want to stick with LOCAL declarations as they are thread safe, that is that multiple threads in the same process can run the procedure without overwriting each others data.
"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

BrWarburto

Many thanks for this info, Donkey. I must explore........

brwarburto   :U