CS计算机代考程序代写 assembly Hive 8/5/2020 Quiz: Final_Exam_2421

8/5/2020 Quiz: Final_Exam_2421
Final_Exam_2421 Started: Aug 5 at 4pm
Quiz Instructions
Question 1 1 pts
For the C statement int x = 5, y; the variable(s) ___________ is/are going to be relocated in .data section and the variable(s) _________ is/are going to be relocated in .bss section in the linking phase.
y, x
x, y
None of x and y, None of x, y Both of x and y, Both of x and y
Question 2 1 pts
The result of linking multiple relocatable object files is _______.
Relocatable object file Assembly file Executable object file Loadable file
Question 3 1 pts
In x86_64, multiplication instructions can work directly with data of length between __________ and __________ bits.
https://osu.instructure.com/courses/80744/quizzes/340154/take
1/10

8/5/2020 Quiz: Final_Exam_2421
Question 4 1 pts
When accessing elements in a structure we use movslq and movzlq to ensure that we:
access the element with the correct size.
reset the value for the operand to zero.
match the structure definition regardless of the structure allocation.. None of Above.
Question 5 1 pts
If we have two strong variables with the same name in two separate C files, then the linker is going to allocate both of them in the .data section.
True False
4, 64 32, 128 8, 128 8, 64
Question 6 1 pts
One possible method to generate assembly code for while loops is:
[ Select ]
https://osu.instructure.com/courses/80744/quizzes/340154/take
2/10

8/5/2020 Quiz: Final_Exam_2421
Question 7 1 pts
__________ in the ELF object file is optional in linking time but required in loading or execution time.
Section header table .data section
.code section Segment header table
Question 8 1 pts
For movl instruction, both operands must be of 4-bytes size.
True False
Question 9 3 pts
What is the gcc option that facilitates the following: 1) Generates do-while translation of while statement.
2) Generates the debugging section in the ELF object file.
3) Generates an executable object file with the specific file name Fname.
https://osu.instructure.com/courses/80744/quizzes/340154/take
3/10

8/5/2020 Quiz: Final_Exam_2421
Question 10 3 pts
List three instructions that affect the value of the rsp register:
*write gcc and then the option in the blank.
Question 11 4 pts
In an array of structures Arr_S in which each structure contains an array of primitive data types Arr_int, what are the two main possible approaches that we can use to access the data elements in Arr_int?
HTML Editor

         15pt Paragrap
https://osu.instructure.com/courses/80744/quizzes/340154/take
4/10

8/5/2020 Quiz: Final_Exam_2421
Question 12 4 pts
Below is a floating-point number represented in IEEE-754 format in hexadecimal: 0xBFA00000 find:
1) The binary representation of the number: 2) The decimal representation of the number:
0 words
Question 13 4 pts
For x*y where, int x = 0xE2E1E000000000000 and int y = 0x100, The contents of rax:
The contents of rdx:
https://osu.instructure.com/courses/80744/quizzes/340154/take
5/10

8/5/2020 Quiz: Final_Exam_2421
Question 14 4 pts
For the structure below, assume the array of structure S1_array starts at address P:
What will be the alignment for m1, m2, and m3, respectively:
,,
What will be the alignment for the first element of structure S1_array:
Question 15 4 pts
How does the linker work with archive files? and how that is different from working with individual .o files?
HTML Editor

         15pt Paragrap
https://osu.instructure.com/courses/80744/quizzes/340154/take
6/10

8/5/2020 Quiz: Final_Exam_2421
0 words
Question 16 8 pts
For the C code below:
Answer the following questions:
1) What will be printed as a result of this program?
2) What is the purpose of the statement free(data);
3) What is the difference between the two statements:
https://osu.instructure.com/courses/80744/quizzes/340154/take
7/10

8/5/2020 Quiz: Final_Exam_2421
malloc(n * sizeof(char));
and
(char *) malloc(n * sizeof(char));
HTML Editor 
         15pt Paragrap
0 words
Question 17 8 pts
For the code below:
https://osu.instructure.com/courses/80744/quizzes/340154/take
8/10

8/5/2020 Quiz: Final_Exam_2421
Answer the following questions:
1) What are the values of rax, rbx, and rdx after executing the code?
2) What do the .align and .text mean?
3) What is the functionality of the pushq %rbp, movq %rsp, %rbp, and leave instructions?
HTML Editor 
         15pt Paragrap
0 words
https://osu.instructure.com/courses/80744/quizzes/340154/take
9/10

8/5/2020 Quiz: Final_Exam_2421
Quiz saved at 4:00pm
Submit Quiz
https://osu.instructure.com/courses/80744/quizzes/340154/take
10/10