I am self studying computer architecture offer at Michigan university. I do not understand why the memory layout for d starts at 312 to 319 instead of 308 http://www.flickr.com/photos/45412920@N03/4442695706/. ( http://www.flickr.com/photos/45412920@N03/4442695706/ )
Maybe I did not understanding the Golden rule specified http://www.flickr.com/photos/45412920@N03/4441916461/sizes/l/ here( http://www.flickr.com/photos/45412920@N03/4441916461/sizes/l/ ) well.
I am self studying computer architecture offer at Michigan university. I do not understand
Share
The second link shows that MIPS cannot pack variables, therefore the addresses they take up must fall on word boundaries.
if short is half word aligned, it takes up two bytes, int, is word aligned so it takes up 4 bytes, double must be doubleword aligned so it takes up 8 bytes.
In order to align at these places..
A zero in the Least Significant bit (LSB) would indicate every other or every 2 bytes (half word aligned), 2 Zeros indicates every 4th byte, and 3 zeros every 8th byte.
The double must be double word aligned so it can not start at 308 (100110100) because it is only word aligned (2 LSBs = 0) it must start at the next double word alignment 312 (100111000)