Homework problem 340 category 2 the fscale

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: nd %edx holding the high-order bytes. We then use register %edx to construct the return value. As this example illustrates, comma (‘,’) characters are used to separate pairs of operands in the input and output lists, and register names in the overwrite list. Note that we were able to specify *dest as an output of the second movl instruction, since this is an assignable value. The compiler then generates the correct machine code to store the value in %eax at this memory location. Although the syntax of the asm statement is somewhat arcane, and its use makes the code less portable, this statement can be very useful for writing programs that accesses machine-level features using a minimal amount of assembly code. We have found that a certain amount of trial and error is required to get code that works. The best strategy is to compile the code with the -S switch and then examine the generated assembly code to see if it will have the desired effect. The code should be tested with different settings of switches such as with and without the -O flag. 3.16 Summary In this chapter, we have peered bene...
View Full Document

Ask a homework question - tutors are online