COMP 280 Quiz: Quiz #4 Notes

47 views3 pages

Document Summary

#r[rbx] & r[rax: given c code that assigns a comparison to a variable (e. g. int x = a > b), determine the set of cmp, test, and set instructions that will be used. Sete %al (when %eax = 0xa1f0, %ecx = 0x05, %edx = 0x22, %ebx = 0xc0ffee) %c integer unsigned integer floating point hexadecimal rep. of unsigned int string. #r[al] = (r[ebx] == 0) ? 0x01 : 0x00 short integer short unsigned integer character (or %hhd) void setgpa(student *std, gpa){ *std. gpa = gpa; struct student abby; double gpa = 3. 7; setgpa(&abby, gpa); return 0: convert between if-else statements & the equivalent x86-64 assembly code. Guided practice 3: given x86-64 code, identify those instructions that correspond to if-else statements and those that correspond to loops, convert between c code that contains do-while, while, and for loops and the equivalent x86-64 assembly code. Jump-to-middle goto test; body-statement loop: test: t = test-expr; if(t) goto loop;

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents