Code Comments
Programming Forum and web based access to our favorite programming groups.I'm new to programming c; and have few questions. hope could get answers from here. My question is ( I read some post) when a function called the frame pointer would be pushed onto the stack and then the previously stack pointer becomes the new frame pointer. I'm not very sure how? or you can say i don't understand this activities at all. Therefore, I hope someone, if possible, can give me more detail illustration (if please, with pic is better; my english understanding is not very well; ) or tell me where I am able to find the related resource. I appreciate it, sincerely. Jason
Post Follow-up to this messageOn 11 Jan 2005 17:01:40 -0800, newbie_tw@yahoo.com.tw (anonymous) wrote: >I'm new to programming c; and have few questions. hope could get >answers from here. >My question is ( I read some post) when a function called the frame >pointer would be pushed onto the stack and then the previously stack >pointer becomes the new frame pointer. I'm not very sure how? or you >can say i don't understand this activities at all. I'm not sure which posting you are referring to, but it certainly doesn't look like the poster explained it correctly. It was also a case where the poster was trying to describe assembly language on this newsgroup, which is basically off-topic. >Therefore, I hope >someone, if possible, can give me more detail illustration (if please, >with pic is better; my english understanding is not very well; ) or >tell me where I am able to find the related resource. You should take a look at the newsgroups referenced here: http://www.ungerhu.com/jxh/clc.welcome.txt
Post Follow-up to this messagenewbie_tw@yahoo.com.tw (anonymous) wrote: > My question is ( I read some post) when a function called the frame > pointer would be pushed onto the stack and then the previously stack > pointer becomes the new frame pointer. That depends on the implementation. If you just want to program in C, you typically don't need to know how your implementation handles function calls, as long as the result is in accord with the Standard. Richard
Post Follow-up to this messageStack frames and things are about how a function call is implemented by a specific compiler, not necessarily a C compiler, and as such is OT in clc. However, I believe that understanding these practical aspects of life often helps better understand (the design of) a language itself (...and people both from clc and csc as well). I hope a general answer to this question is not much inappropriate here. anonymous <newbie_tw@yahoo.com.tw> wrote: > I'm new to programming c; and have few questions. hope could get > answers from here. > My question is ( I read some post) when a function called the frame > pointer would be pushed onto the stack and then the previously stack > pointer becomes the new frame pointer. I'm not very sure how? Your description doesn't make much sense. Next time supply some pointers to the article you read, it'll be easier to answer your query. > or you > can say i don't understand this activities at all. I suspect you don't understand what as stack frame is. First try to read: http://en.wikipedia.org/wiki/Stack_frame (this is not a particularly good description, but you have to start somewhere). Then try to google for web pages with these keywords: stack frame function call convention Then if you have more questions, come back here, and I'll prepare a longer answer. -- Stan Tobias mailx `echo siXtY@FamOuS.BedBuG.pAlS.INVALID | sed s/[[:upper:]]//g`
Post Follow-up to this messagenewbie_tw@yahoo.com.tw (anonymous) wrote: > My question is ( I read some post) when a function called the frame > pointer would be pushed onto the stack and then the previously stack > pointer becomes the new frame pointer. That depends on the implementation. If you just want to program in C, you typically don't need to know how your implementation handles function calls, as long as the result is in accord with the Standard. Richard
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.