I am reading http://www.cs.utexas.edu/users/lavender/courses/cs345/lectures/CS345-Lecture-07.pdf to try to understand how does Stack Activation Frame for Variable arguments functions works?
Specifically how can the called function knows how many arguments are being passed?
The slide said: The va_start procedure computes the fp+offset value following the argument past the last known argument (e.g., const char format). The rest of the arguments are then computed by calling va_arg, where the ‘ap’ argument to va_arg is some fp+offset value.*
My question is what is fp (frame point)? how does va_start computes the 'fp+offset' values? and how does va_arg get 'some fp+offset values? and what does va_end supposed to do with stack?