int f(int x, int y, int z) { if (/* missing code here */) return x; else return -x; } f: movl %edi, %eax movl %edi, %ecx negl %ecx cmpl %edx, %esi cmovge %ecx, %eax ret y < z x >= y y >= z x <= y
Added by Amanda H.
Close
Step 1
The function `f` takes three integer parameters: `x`, `y`, and `z`. Show more…
Show all steps
Your feedback will help us improve your experience
Sophia Furfine and 57 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write an assembly program that computes in EAX the value of the following expression Z = (X + 10) * (Y - 20). The values for X, Y, and Z should be double word. Run your program using the following values: a. X = 10, Y = 10 b. X = 10, Y = 20 For each case show the content of the registers and identify if any of the flag registers were set.
Akash M.
Translate the following HLL statement into MIPS Assembly. if (v != w) v = v - w else v = w + 3
Madhur L.
MIPS Assembly Language Translate the following C code to MIPS assembly code. Use a minimum number of instructions. Assume that the values of a, b, i, and j are in registers $s0, $s1, $t0, and $t1, respectively. Also, assume that register $s2 holds the base address of the array D. for (i = 0; i < a; i++) for (j = 0; j < b; j++) D[j] = i + j
Supreeta N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD