This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 0) Yes, since multiplication is monotonic. H. (d+f)-d == f No, for example when d is ·½ and f is ½, the left hand side will be Æ Æ , while the right hand side will be ½. 700 APPENDIX B. SOLUTIONS TO PRACTICE PROBLEMS B.3 Machine Level Representation of C Programs
Problem 3.1 Solution: [Pg. 101] This exercise gives you practice with the different operand forms. Operand %eax 0x104 $0x108 (%eax) 4(%eax) 9(%eax,%ecx) 260(%ecx,%edx) 0xFC(,%ecx,4) (%eax,%edx,4) Problem 3.2 Solution: [Pg. 104] Reverse engineering is a good way to understand systems. In this case, we want to reverse the effect of the C compiler to determine what C code gave rise to this assembly code. The best way is to run a “simulation,” starting with values x, y, and z at the locations designated by pointers xp, yp, and zp, respectively. We would then get the following behavior:
1 2 3 4 5 6 7 8 9 Value 0x100 0xAB 0x108 0xFF 0xAB 0x11 0x13 0xFF 0x11 Comment Register Absolute address Immediate Address 0x100 Address 0x104 Addres...
View Full Document
- Spring '10
- The American