Match each of the assembler routines with the equivalent C
functions. Note: shrq is the logical right shift instruction,
and sarq is the arithmetic right shift instruction.
Question 3 options:
|
|
|
foo5: |
|
foo2: |
|
foo3: |
|
foo4: |
|
|
1-1 [foo5 - choice1] because leaq will add -4 to x and shrq will check <0
2-4[foo2 -choice4] 4 time left shift means multiply by 16
3-3[foo3-choice3] right shift
4-5 [foo4-choice5] leaq will add 4 to x
5-2 [foo1-choice2] leaq will add as 0 + 4*x
PLEASE UPVOTE
Match each of the assembler routines with the equivalent C functions. Note: shrq is the logical...
Suppose we have C program, int foo(long s, long d) { char arr_a[11]; int i; arr_a[10] = 0; arr_s[10] = 0; for (i = 0; i < 5; i++) { if ((s == 1) && (d == 2)) { arr_a[i] = hello[4-i]; arr_s[i] = hello[4-i]; arr_a[i+5] = world[i]; arr_s[i+5] = world[i]; } else { arr_a[i+5] = hello[4-i]; arr_s[i+5] = hello[4-i]; arr_a[i] = world[i]; arr_s[i] =...
Question 4 (2 points)
Consider the C statements below. Assume x has been assigned a
value.
int mask = 0xFF000000;
y = x ^ mask;
Which one of the following best describes the value computed for
variable y?
Question 4 options:
y contains the most significant byte of x complemented, with the
rest of the bits unchanged
y contains the most significant byte of x unchanged, with the
rest of the bits 0
y contains the most significant byte of...