Instead the compiler inserts a 3 byte gap shown below

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: edx jnz .L37 Get B Get *Aptr Increment Aptr Multiply by B[nTjPk] Add to result Add n to nTjPk Decrement cnt If cnt <> 0, goto loop Observe that in the above code, variables B and n must be retrieved from memory on each iteration. This is an example of register spilling. There are not enough registers to hold all of the needed temporary data, and hence the compiler must keep some local variables in memory. In this case the compiler chose to spill variables B and n because they are read only—they do not change value within the loop. Spilling is a common problem for IA32, since the processor has so few registers. 3.9 Heterogeneous Data Structures C provides two mechanisms for creating data types by combining objects of different types. Structures, declared using the keyword struct, aggregate multiple objects into a single one. Unions, declared using the keyword union, allow an object to be referenced using any of a number of different types. 3.9.1 Structures The C struct declaration creates a data type that groups objects of possibly different types into a single object. The different components of a structure are referenced by names. The implementation of structures is similar t...
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