31046040系统级编程_A-.pdf
《31046040系统级编程_A-.pdf》由会员分享,可在线阅读,更多相关《31046040系统级编程_A-.pdf(13页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、311046040 系统级编程(A 闭)2013-2014-11/8一、单项选择题(本大题共30 小题,每小题1 分,共 30 分)提示:在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在下表中。错选、多选或未选均无分。1.In Visual C+,a Win32 Console Application is A.the status window of the Visual C+environment B.the simplest type of application Visual C+can generate C.a program that is able to co
2、ntrol the operating system of a windows computer D.built by using sophisticated Application Wizards 2.When using a debugger to find the cause of a programs incorrect behavior,A.it is often necessary to start the program multiple times under the debuggerB.the program is usually executed to the point
3、at which the behavior occurs and then executed backwards to find the cause C.the faulty code fragment must first be identified D.it is fastest to start by stopping the debugger long before the behavior appears 3.how is-11(decimal)represented in an 8-bit 2s complement binary format?A.10001011 B.11110
4、100 C.11110101D.11111011 4.What is the output of this C code?#include void main()int x=4;int*p=&x;int*k=p+;int r=p-k;printf(%d,r);A.4 B.8 C.1D.Run time error 5.Explain the feature of stack.A.stack cannot reuse its memory B.All elements are of different data types C.All operations are at one endD.Any
5、 element can be accessed from it directly 6.a jump instruction A.changes a pointer to point to the next element of an array B.unconditionally sets the program counter to its operandC.increases the program counter D.changes the program counter only if its operand is equal to zero 7.in c,assuming that
6、 an int takes 4 bytes,how many bytes are required to represent the following array?int a12;A.44 B.52 C.12 D.488.given the following declaration and initialization of s,what is the value of the expression s6?char s=string;(10.0 分)A.g B.0C.n D.an unpredictable value 311046040 系统级编程(A 闭)2013-2014-12/89
7、.activation records are organized in stacks because?311046040 系统级编程(A 闭)2013-2014-13/8A.stacks allow activation records to be pushed and popped in any order.B.stacks are simple enough for the hardware to manage.C.functions need to access all the variables of the functions that call them.D.they are s
8、eldm needed during program execution.10.when executing a function callee(),which of the following are true regarding the value of the frame pointer?i.it marks the top of the stack frame of the function that invoked callee().ii.it marks the bottom of the stack frame of callee()iii.it is the top of th
9、e stack.A.iii only B.ii only C.i only D.i and ii only 11.consider the malloc()function.which one of the following sentences is correct?A.the malloc()returns the amount of memory allocated B.the malloc()allocates the desired amount of memory on the stack C.the malloc()allocates the desired amount of
10、memory on the heap D.the allocated memory is only local to the function 12.which statement is true?A.Using the?rst-?t algorithm on a free list that is ordered according to decreasing block sizes results in low performance for allocations,but avoids external fragmentation.B.For the best-?t method,the
11、 list of free blocks should be ordered according to increasing memory addresses C.The best-?t method chooses the largest free block into which the requested segment?ts.D.Using the?rst-?t algorithm on a free list that is ordered according to increasing block sizes is equivalent to using the best-?t a
12、lgorithm.13.for which of the following applications are threads well suited?i.background processing such as data compression or spell-checking ii.displaying a web page on the screen before it has fully arrived from the server iii.fetching a page of a web document while the user scrolls through the p
13、revious one A.i and ii only B.i only C.i,ii,and iiiD.ii only 14.threads differ from processes in that threads A.cannot make system calls.B.exist only in the operating system kernel.C.cannot be preempted.D.share a single virtual address space.15.in IA32 or x86,which exception is used to implement dem
14、and paging i.interrupt ii.trap iii.fault iv.abort A.iv B.iii.C.ii.D.i.16.which variable will be put into bss?int printf(const char*format,.);int global_init_var=84;int global_uninit_var;void func1(int i)printf(%dn,i);311046040 系统级编程(A 闭)2013-2014-14/8int main(void)311046040 系统级编程(A 闭)2013-2014-15/8s
15、tatic int static_var=85;static int static_var2;int a=1;int b;func1(static_var+static_var2+a+b);return a;i a and b ii static_var iii global_init_var iv global_uninit_var A.i only B.ii only C.iii only D.iv only17.what can loader do?i.translate the c code into machine code ii.resolution iii.load or map
16、 the executable object file from the disk to memory A.i and ii only.B.i and iii only.C.i,ii and iii.D.iii only.18.about the cache in a computer system,which is true(a)every computer system has 3 level cache,that is l1,l2,l3 cache(b)every computer systems cache system have data cache and instruction
17、cache(c)every computer systems cache system has 2 level cache,that is l1,and l2 cache(d)every computer systems cache system has l1 and l2 cache inside cpu chip A.ii and iii only B.i only C.noneD.i and iii only 19.which of the following manages the transfer of data between the cpu registers and the c
18、ache?A.hardware.B.registry.C.compiler.D.operating system.20.which of the following levels of a typical memory hierarchy transfers data in chunks of biggest size?A.they all transfer one byte at a time.B.main memory disk.C.cpu registers cache.D.cache main memory.21.which of the following is likely to
19、offer the best performance improvement for programs that spend 50%of their time comparing strings?A.be sure to use hardware string-comparison instructions.B.store strings uniquely so that pointer comparison can be used.C.write in-line code for string comparison to eliminate a procedure call.D.call a
20、 library function for string comparison.22.which of the following approaches towards optimizing programs is most advisable?A.optimize after all functions are written and debugged.B.optimize main()first.C.optimize as you go:make sure every function is optimized before writing the next one.D.optimize
21、the more complex functions first.23.cpu time measures 311046040 系统级编程(A 闭)2013-2014-16/8A.the percentage utilization of the cpu by the system.B.wall time 311046040 系统级编程(A 闭)2013-2014-17/8C.the time spent executing system functions.D.the time spent by a program executing program instructions.24.to r
22、esolve memory leaks in c,one common approach is A.to ensure that memory blocks are allocated only on word boundaries.B.to check whether the number of calls to malloc()is greater than the number of calls to free().C.to add padding before and after allocated memory blocks and to fill that memory with
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 31046040 系统 编程 _A
限制150内