Saturday, July 31, 2010

Data Alignment Question Interview - PowerPC

What happens when you try to read an integer value from memory address 0x000003?
 assume: ANSI C standards
Things to look for:
Does the candidate know
  1.  what is the size of integer in PowerPC EABI  ANSI C
         4 bytes
  2.  what happens when a read from a non aligned address and how to handle it
         causes an exception / using exception handler / software intervention to add multiple cycles
If the candidate has answered these questions then I will be impressed.

I may further ask why and how can we cover rule alignment options in the compiler?
use pack option --specific to compiler --/to save memory