Sunday, May 10, 2009

Where can i find assembly code of c functio like printf(),getchar() etc. ?

is there c code for above c function ?


where can i find ?

Where can i find assembly code of c functio like printf(),getchar() etc. ?
try this link





http://www.cs.wisc.edu/~david/courses/cs...
Reply:Use a search engine to find free downloads of GNU c compilers. They all include the source code for the library functions. Some primitive functions will be written in assembler for various processors. Most functions will be written in c for portability.





An easy place to start would be a free Linux download or a Linux CD. They almost always include a GNU c compiler.
Reply:As the link Joe provided above mentions, the c code for printf() and getchar() etc are all on the header files that come with you c development environment. Find the header files, e.g. stdio.h in this case and you will find your code. Assuming you are on a Linux/Unix or similar system you will most likely find in under /usr/include. If not then install glibc-headers.


The assembly code is something different and will only be available once you have compiled your code. Check utilities like gdb (Gnome debugger (I'm assuming you are on a Linux/Unix or similar system again) that will allow you to step through a program as it runs and see all the code and anything else relevant that is available.


No comments:

Post a Comment