The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: BrWarburto on January 30, 2006, 05:55:11 PM

Title: Data Declaration: Local or Global?
Post by: BrWarburto on January 30, 2006, 05:55:11 PM
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
Title: Re: Data Declaration: Local or Global?
Post by: donkey on January 30, 2006, 07:45:01 PM
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.
Title: Re: Data Declaration: Local or Global?
Post by: BrWarburto on February 01, 2006, 09:36:51 AM
Many thanks for this info, Donkey. I must explore........

brwarburto   :U