Skip to contentSkip to conversation

variables

DISCUSSION RCS 2 participants 2 messages Aug 23, 2002 – Aug 24, 2002

lore
Share & tools
lore

RCS

author
#0 lore raw

Hi all,

Can anyone explain me how global and local variables from C are treated in
assembler?
Is that write that local variables are storage in the stack?

Thanks,

RCS.

_________________________________________________________
Oi! Você quer um iG-mail gratuito?
Então clique aqui: http://registro.ig.com.br/

#1 lore raw
Quoted 6 lines · RCS

Hi all,

Can anyone explain me how global and local variables from C are treated in
assembler?
Is that write that local variables are storage in the stack?

Global variables are likely to be placed in data segment and all local - pushed on the stack. But i think it really depends on C compiler how it handles all Your data. If the program is tiny, a C compiler may all Your data push on the stack - i don't know that C standard says that all Your global data must be placed in data segment (i suppose it doesn't say) but it seems that it works in that way for most of programs (not hello-like).

Signature · 1 line
Maciej Hrebien