The pair of registers edx and eax are viewed as

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: from each other in subtle ways. Here is an example: Assume initially that %dh = 8D, %eax %eax %eax %eax = 98765432 = 9876548D = FFFFFF8D = 0000008D 1 2 3 movb %dh,%al movsbl %dh,%eax movzbl %dh,%eax In these examples, all set the low-order byte of register %eax to the second byte of %edx. The movb instruction does not change the other three bytes. The movsbl instruction sets the other three bytes to either all ones or all zeros depending on the high-order bit of the source byte. The movzbl instruction sets the other three bytes to all zeros in any case. End Aside. The final two data movement operations are used to push data onto and pop data from the program stack. As we will see, the stack plays a vital role in the handling of procedure calls. Both the pushl and the popl instructions take a single operand—the data source for pushing and the data destination for popping. The 3.4. ACCESSING INFORMATION code/asm/exchange.c 1 2 3 4 5 6 7 1 2 3 4 5 103 movl movl movl movl movl 8(%ebp),%eax 12(%ebp),%edx (%eax),%ec...
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