

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Lecture Topics:
Address Computation:
Arithmetic Instructions:
Example: Complex Expression int arith(int x, int y, int z) { int rval = (x+y+z) * (x+4+48*y); return rval; }
Assembly: movl 8(%ebp), %ecx movl 12(%ebp), %edx leal (%edx,%edx,2), %eax sall $4, %eax leal 4(%ecx,%eax), %eax addl %ecx, %edx addl 16(%ebp), %edx imull %edx, %eax
Condition Codes:
Read via:
Conditional Branch Example: int absdiff(int x, int y) { if (x > y) return x - y; else return y - x; }
Loops:
Examples:
Summary: