As the table shows there are many different

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: unix> gcc -O2 -c code.c This will generate an object code file code.o that is in binary format and hence cannot be viewed directly. Embedded within the 852 bytes of the file code.o is a 19 byte sequence having hexadecimal representation: 55 89 e5 8b 45 0c 03 45 08 01 05 00 00 00 00 89 ec 5d c3 3.2. PROGRAM ENCODINGS 95 This is the object code corresponding to the assembly instructions listed above. A key lesson to learn from this is that the program actually executed by the machine is simply a sequence of bytes encoding a series of instructions. The machine has very little information about the source code from which these instructions were generated. Aside: How do I find the byte representation of a program? First we used a disassembler (to be described shortly) to determine that the code for sum is 19 bytes long. Then we ran the GNU debugging tool GDB on file code.o and gave it the command: (gdb) x/19xb sum telling it to examine (abbreviated ‘x’) 19 hex-formatted (also abbre...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online