Sample Exercises for Quiz 4

Subroutines, IEEE Floating Point

Describe the differences between open, closed, and leaf subroutines.  What
are the advantages and disadvantages of each?


What is recursion?


Describe the general calling convention of general architectures with
regards to building and breaking down the Stack Frame, passing parameters,
etc.  Who (the calling function or the called function) is responsible for
building and breaking down the various parts of the Stack Frame? Caller
Pre-Call, Call instr, Callee Prologue, Callee Epilogue, Caller Post-Return
responsibilities.


Describe the calling convention of the SPARC architecture, in particular,
and how the SPARC architecture does something similar.


Describe each of the following SPARC instructions (what do they do?
what registers do they access/modify?).

	call
	save
	restore
	ret
	retl


Describe how you would pass more than 6 arguments to a function in the
SPARC architecture.  How are they accessed from both the calling and the
called functions?


What register do you use to access local variables allocated on the Stack?
With what relative offset do you access these local variables?


Why is it "a bad thing" to return a pointer to a local Stack variable? Why
are you "unlucky" if you do this and your program seems to work?


Describe the internal format for single- and double-precision IEEE floating
point values.


What is normalization?  Hidden bit operation?


Why is the stored exponent in biased/excess notation of the real exponent?


Convert the following decimal values to single-precision IEEE floating
point representation (expressed in hex) showing the binary fixed-point
intermediate value __________ x 20.

13.75				0x415C0000
-99.125				0xC2C64000
-1.5				0xBFC00000
0.5				0x3F000000



Convert the following single-precision IEEE floating point representations
to fixed-point decimal values.

0x42060000			33.5
0xC22E8000			-43.625
0xBF400000			-0.75
0x42F68000			123.25


Rt-Lt Rule!