Thread: Understading assembly code created by gcc

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    158

    Understading assembly code created by gcc

    I'm supposed to get the assembly code from some C file with -S switch and then perform some tasks with that code, saying where is the start and end of a function including comments on the asm file, identify the records or memory cells where the variables where saved, presente the structure and content of the stack an some other things...

    However, I missed the classes where we were supposed to learn that, and was hoping if there is anyone where that could point me to some documents in the net, easy to understand that could help me out accomplishing these tasks.

    If possible, in a few hours, cause I'm heading on a 2 day vacation to some place I don't have net and I was hoping to study a bit during these 2 days cause I have to submit the work until tuesday.

    TIA

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Start with really simple functions - like void foo ( void ); which does nothing.

    Then add single statements....

    Then add more functions....

    > If possible, in a few hours
    Perhaps the real lesson is learning to plan ahead?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >If possible, in a few hours, cause I'm heading on a 2 day vacation to
    >some place I don't have net and I was hoping to study a bit during
    >these 2 days cause I have to submit the work until tuesday.
    Google a tutorial on GAS (the assembler GCC uses) and print it out.
    My best code is written with the delete key.

  4. #4

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making programms faster
    By deian in forum C Programming
    Replies: 23
    Last Post: 10-09-2004, 12:19 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Linking an assembly routine into a GCC project
    By huh in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2002, 03:14 PM
  4. C,C++,Perl,Java
    By brusli in forum C Programming
    Replies: 9
    Last Post: 12-31-2001, 03:35 AM
  5. How can I incorporate Assembly code in my C++ program.
    By bman1176 in forum C++ Programming
    Replies: 4
    Last Post: 12-22-2001, 10:58 AM