flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Global variables (should I put them on the stack?)

Author
Thread Post new topic Reply to topic
Plue



Joined: 15 Dec 2005
Posts: 151
Plue
In a basic-like language, should I put global variables on the stack or reserve data for them in the file? (I'm talking about fundamental types like int.)

_________________
Roses are red
Violets are blue
Some poems rhyme
And some don't.
Post 29 Jan 2006, 11:29
View user's profile Send private message Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
I would reserve space for them in the file; if you put them on the stack, you have a harder time keeping track of their exact depth when a deeply nested subroutine needs to use them. Local variables are fine on the stack though, since only the most recently called routine needs to access them.

_________________
Charles Childers, Programmer
Post 29 Jan 2006, 20:12
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.