Weekly Quiz Analysis Summary

Source: Internet
Author: User
Tags mul truncated

Quiz One:
 fill in the blanks: all the default system user names and Passwords are (Shiyanlou) in the lab building environment. Fill in the blanks: in Linux bash, CTRL + A shortcut key is (move the cursor to the input outfit, equivalent to the home key). Judgment: The man printf and man 1 printf functions are equivalent in Linux bash. OK fill in the blanks: in Linux You can use the (groups) command to know which user groups you belong to. Fill in the blanks: in Linux You can use the (chmod) command to modify a file's permissions. Fill in the blanks: Linux does not have C drive, D drive, its file system directory is set by (FHS) standard. Judging: In Linux Bash, CD-commands can be switched to the ' home ' directory. X should be CD ~, CD-Switch to previous directory: in Linux Bash, the command to force delete test files is (rm-f test). Judgment: the Cat-n and NL command functions are equivalent in Linux bash. OK to judge: Linux Bash, source and. The command function is equivalent. OK fill in the blanks: in Linux Bash, the command to find files created in the home directory the day before yesterday is (find ~-ctime 2). Distinguish 2 +2-2 significance, three kinds of time reference study elder sister Li Bing Qing's research judgment: in Linux bash, the command that uses the TAR command to package the home directory into Home.tar is (TAR-CF home.tar ~) Fill in the blanks: the ZIP command uses (-e) in Linux bash parameter to create an encrypted compressed package. Judgment: the DF and du command functions are equivalent in Linux bash. X-fill: ls in Linux bash. | The function of the Sort command is (show current directory contents and sort) fill in the blanks: in Linux bash, use grep to find the command in that file for the main function in *.C in the current directory (grep main *.c) in the blanks: Linux bash, The command that uses the WC statistic hello.c a few lines of code is (Wc-l hello.c) judgment: The-H parameter of the col command can be used to build the tab to the equivalent number of spaces. x, Space tab fill in the Blanks: Linux bash, the LS command displays the results of the current directory ls.txt command output redirect command is (ls > ls.txt) fill in the blanks: in Linux bash, the (tee) command can be redirected to multiple files at the same time. 
quiz two:
Man-k fill in the blanks: there is a linear lookup algorithm in the data structure, the C standard library does not have this function function, but in Linux, this function is (lfind or lsearch) cheat fill in the blanks: to list the content of/path/to/foo.tgz Archive using tar (tar-jtvf/path/to/foo.tgz) Find the Fill: Find command for all directories under the current directory is (find. -type d) grep fill in the blanks: the command to find the value of a macro Stdin_fileno is (grep-nr xxx/usr/include) CH01 fill in the blanks: all information in a computer system is a bit-string representation, so-called (information) is a bit + context. CH01 fill in the blanks: the main idea of the memory hierarchy is that the upper memory is used as the underlying memory (cache). CH01 fill in the blanks: the most basic four abstractions in the operating system are (virtual machines, processes, virtual storage, files). CH07 fill in the blanks: the two main tasks of the linker are (symbolic parsing and relocation). CH07 selection: Textbook p449 in Swap.c BUFP1 is (a) a global symbol B external symbol c local symbol D above is not the CH07 judgment: C language, global variables are strong symbols. (X) CH07 fill in the Blanks: (loader) Map the contents of the executable file to the memory and run the program. CH07 selection: In Linux, disassembly. The binary instruction in the text section uses a tool that is (d) A ar B strings C readelf D objdump Code title: 1. In VI, the commands for viewing the scanf and printf man pages (Help document) are respectively? (2 min) K 3k2. commands to compile and run the above code (2 points) gcc *.c-o main./main3. Debug the above code with GDB: What is the command to compile the code? How do I set a breakpoint for the main function in MAIN.C? How do I set breakpoints on line sixth? (3 points) Gcc-g *.c-o main B main B 64. In addition to MAIN.C, the other 4 modules (ADD.C SUB.C mul.c div.c) of the source code does not want to give others, how to make a mymath.a static library? Main.c How to use MYMATH.A? (3 points) gcc-c add.c sub.c mul.c div.car rcvs libmymath.a add.o sub.o mul.o div.ogcc main.c-o main-l.-lm Ymath (or GCC main.c./libmymath.a-o main) 5. In addition to MAIN.C, the other 4 modules (ADD.C SUB.C mul.c div.c) of the source code does not want to give others, how to make a mymath.so shared library?  Main.c How to use mymath.so? (4 points) gcc-fpic-c add.c sub.c mul.c div.cgcc-shared-o libmymath.so add.o sub.o MUL.O div.ogcc-o Main Main.c-l.-lmymathlibmymath.so to be copied to/lib Or/usr/lib6. Write out the makefile to compile the above code, compile the target file is Testmymath, only with explicit rules can. (4 points) testmymath:main.o add.o sub.o mul.o div.o gcc main.o add.o sub.o m UL.O div.o-o testmymathmain.o:main.c head.hgcc-c main.cadd.o:add.c head.hgcc-c add.csub.o:sub.c head.hgcc-c SUB.CMU L.O:MUL.C head.hgcc-c mul.cdiv.o:div.c head.hgcc-c div.c
quiz three:
Man-k fill in the blanks: the command to display file attributes (status) in Linux is (stat) cheat fill in the blanks: commands that use the DU command to sort directories or files under the current directory are (Du-sk *| sort-rn) grep in the blanks: ~/test Folder has a lot of C source files, find the main function in which file of the command (grep main *.c) VI fill in the blanks: VI View the function qsort the shortcut key for the Help document is (K) gdb judgment: GdB in the next and step can be single-step tracking, Priority should be given to step based on the top-down principle. (X) ch01 fill in the blanks: abstraction is an important concept in CS, and in the out-of-box, the (instruction set structure) provides an abstraction of the actual processor. CH01 selection: Three levels in parallel do not contain (C).  A thread-level concurrency B instruction-level parallel C process-level concurrency D SIMDch07 fill in the blanks: gcc-f pic xxx.c in pic means (location-independent code or position-independent code) 2.4 Fill in the blanks: Calculate 0x503c + 100  = (0x50a0), the result is a 16 binary representation 2.6 Fill in the blanks: Exercise 2.6 matches the binary total 21 bits, the 16 notation is (0x159141) 2.8 Fill in the blanks: A, b length is a byte, a=1,b=6, a|b = (7 or [00000111]) 2.11 Judgment: The code in line fourth "<=" replaced by ">=" can solve the code problem. (X) 2.13 judgment:/*compute X&y, only calls to functions bis and bic*/int bool_and (int X, int y) {int result = BIC (X, y); re turn result;} (X) 2.14 Fill in the blanks: A, b length is a byte, a=1,b=6, a| | b = (1 or true) 2.18 fill in the blanks: 16-bit machine, complement 0x8004 conversion equivalent decimal is (-2044) 2.19 judgment: T2u4 ( -8) + 8 = + (OK) 2.21 judgment: C: -2147483647-1u &lt ; -2147483647 (OK) 2.23 fill in the blanks: fun2 (0xed005380) = (0xffffff80) 2.24 fill in the blanks: four digits 0xC truncated to 3 digits, and the truncated value interpreted as an unsigned number is(4) 2.25 judgment: Code for medium condition i<= (int) length-1 can eliminate program bug (OK) 2.27 Judge: function code can be ruturn x+y >= y; (OK) 2.29 fill in the blanks: [11000] + [11000] = ([110000]) 2.33 fill in the blanks: for four-digit complement 8, the complement of the non-representation of the decimal is (-8) 2.34 fill in the blanks: complement [100] * [101] = ([001100]) 2.40 fill in the blanks: K=31 Shift 2, plus/minus 1, expression ((x<<5)-X) 2.44 judgment: for title: (x>0) | | ((x-1) <0) The value is True (x) 2.45 fill in the blanks: binary decimal 1.101 is converted to decimal (1.625) 2.47 judgment: floating-point number 00111 is converted to decimal for 1.5 (x) 2.50 Fill in the blanks: binary number 10.110 rounds to the nearest One-second decimal value for (2.5) 2.54 judgment: f==-(-f) (OK)
Test Four:
Regex judgment: The regular expression r.t can match Rt. (x) Regex judgment: the regular R-expression zo* can match Z. (OK) CH03 fill in the blanks: starting with I386, the x86 architecture expands to 32 bits, adding a (flat) addressing mode CH03 fill in the blanks: on 64-bit machines, to compile 32-bit machine code with GCC, you need to use the (-m32) option to CH03 the blanks: for machine-level programming, Two important abstractions are (ISA, virtual address) CH03 fill in the blanks: in Linux, the command to disassemble the target code CODE.O is (objdump-d code.o) CH03 fill in the blanks: the three types of operands in the IA32 instruction are (immediate count, register, memory) 3.1 Fill in the blanks: for the figure in Exercise 3.1, the value of operand 8 (%eax,%ecx,4) is (0x11) CH03 judgment: Copy the word in memory where the address is 0x4050 to 0x405c (MOVW), ($0x4050) (x) $0x405c Judgment: The value of%esp is 0x10c, PUSHL%eax,%esp value is 0x108. (OK) 3.3 judge: Movb $0xf, (%eax) is the correct assembly statement. (OK) 3.5 fill in the blanks: the function of the DECODE1 function is (data exchange) 3.6 fill in the blanks: Instruction Leal 3 (%eax,%ecx,4),%edx the value stored in%edx is (3+X+4Y) 3.9 Fill in the blanks: the function of the Arith function is (~ (x^y) ; >3)-Z) 3.14 judgment: The assembly code does not log the type of the program value. (OK) CH03 fill in the blanks: conditional expressions in C are combined (conditional jumps and unconditional jumps) in the assembly. CH03 fill in the blanks: the loop structure in C can be implemented with (conditional test and jump combination). CH03 Select: Stack Used (ABCD) A to pass the parameter B to store the return information C save Register D local storage. CH03 fill in the blanks: in the Linux assembly, the statement that forms the stack frame for air conditioning is (push%ebp movl%esp%ebp) CH03 fill in the blanks: in the Linux assembly, the function has a return value in the presence (%EAX) register.

  

Weekly Quiz Analysis Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.