Understading assembly code created by gcc

This is a discussion on Understading assembly code created by gcc within the C Programming forums, part of the General Programming Boards category; I'm supposed to get the assembly code from some C file with -S switch and then perform some tasks with ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >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
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638

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, 02:14 PM
  4. C,C++,Perl,Java
    By brusli in forum C Programming
    Replies: 9
    Last Post: 12-31-2001, 02: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, 09:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21