

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Machine-Level Programming II: Arithmetic & Control - Study Notes
Typology: Study notes
1 / 2
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: