1.假定全局short型數組a的起始地址爲0x804908c,則a[2]的地址是( )。數組
<div> <input disabled type="radio" name="choice1">A.0x8049092<br> <input disabled type="radio" name="choice1">B.0x8049094<br> <input disabled checked type="radio" name="choice1">C.0x8049090<br> <input disabled type="radio" name="choice1">D.0x804908e<br> </div>post
2.假定全局數組a的聲明爲char *a[8],a的首地址爲0x80498c0,i 在ECX中,現要將a[i]取到EAX相應寬度的寄存器中,則所用的彙編指 令是( )。ui
<div> <input disabled type="radio" name="choice2">A.mov (0x80498c0, %ecx, 4), %eax<br> <input disabled type="radio" name="choice2">B.mov (0x80498c0, %ecx), %ah<br> <input disabled type="radio" name="choice2">C.mov 0x80498c0( , %ecx), %ah<br> <input disabled checked type="radio" name="choice2">D.mov 0x80498c0( , %ecx, 4), %eax<br> </div>操作系統
3.假定全局數組a的聲明爲double *a[8],a的首地址爲0x80498c0,i 在ECX中,現要將a[i]取到EAX相應寬度的寄存器中,則所用的彙編 指令是( )。指針
<div> <input disabled checked type="radio" name="choice3">A.mov 0x80498c0( , %ecx, 4), %eax 0.50/0.50<br> <input disabled type="radio" name="choice3">B.mov (0x80498c0, %ecx, 8), %eax<br> <input disabled type="radio" name="choice3">C.mov (0x80498c0, %ecx, 4), %eax<br> <input disabled type="radio" name="choice3">D.mov 0x80498c0( , %ecx, 8), %eax<br> </div>code
4.假定局部數組a的聲明爲int a[4]={0, -1, 300, 20},a的首地址爲R[ebp]-16,則將a的首地址取到EDX的彙編指令是( )。input
<div> <input disabled checked type="radio" name="choice4">A.leal -16(%ebp), %edx<br> <input disabled type="radio" name="choice4">B.leal -16(%ebp, 4), %edx<br> <input disabled type="radio" name="choice4">C.movl -16(%ebp, 4), %edx<br> <input disabled type="radio" name="choice4">D.movl -16(%ebp ), %edx<br> </div>io
5.某C語言程序中有如下兩個變量聲明:編譯
int a[10]; int *ptr=&a[0];
則ptr+i的值爲( )。class
<div> <input disabled checked type="radio" name="choice5">A.&a[0]+4<br> <input disabled type="radio" name="choice5">B.&a[0]+8<br> <input disabled type="radio" name="choice5">C.&a[0]+2<br> <input disabled type="radio" name="choice5">D.&a[0]+i<br> </div>
6.假定靜態short型二維數組b的聲明以下:
static short b[2][4]={ {2, 9, -1, 5}, {3, 8, 2, -6}};
若b的首地址爲0x8049820,則按行優先存儲方式下,數組元素"8"的地址是( )。
<div> <input disabled checked type="radio" name="choice6">A.0x804982a<br> <input disabled type="radio" name="choice6">B.0x8049825 <br> <input disabled type="radio" name="choice6">C.0x8049824<br> <input disabled type="radio" name="choice6">D.0x8049828<br> </div>
7.假定靜態short型二維數組b和指針數組pb的聲明以下:
static short b[2][4]={ {2, 9, -1, 5}, {3, 1, -6, 2 }}; static short *pb[2]={b[0], b[1]};
若b的首地址爲0x8049820,則pb[1]的值是( )。
<div> <input disabled type="radio" name="choice7">A.0x8049820<br> <input disabled type="radio" name="choice7">B.0x8049824<br> <input disabled type="radio" name="choice7">C.0x8049822<br> <input disabled checked type="radio" name="choice7">D.0x8049828<br> </div>
8.假定靜態short型二維數組b和指針數組pb的聲明以下:
static short b[2][4]={ {2, 9, -1, 5}, {3, 1, -6, 2 }}; static short *pb[2]={b[0], b[1]};
若b的首地址爲0x8049820,則&pb[1]的值是( )。
<div> <input disabled checked type="radio" name="choice8">A.0x8049834<br> <input disabled type="radio" name="choice8">B.0x8049832<br> <input disabled type="radio" name="choice8">C.0x8049830<br> <input disabled type="radio" name="choice8">D.0x8049838<br> </div>
9.假定結構體類型cont_info的聲明以下:
struct cont_info { char id[8]; char name [16]; unsigned post; char address[100]; char phone[20]; } ;
若結構體變量x初始化定義爲struct cont_info x={"00000010", "ZhangS", 210022, "273 long street, High Building #3015", "12345678"},x的首地址在EDX中,則"unsigned xpost=x.post;"對應彙編指令爲( )。
<div> <input disabled type="radio" name="choice9">A.leal 0x24(%edx), %eax<br> <input disabled type="radio" name="choice9">B.movl 0x24(%edx), %eax<br> <input disabled checked type="radio" name="choice9">C.movl 0x18(%edx), %eax<br> <input disabled type="radio" name="choice9">D.leal 0x18(%edx), %eax<br> </div>
10.如下是關於IA-32處理器對齊方式的敘述,其中錯誤的是( )。
<div> <input disabled checked type="radio" name="choice10">A.老是按其數據寬度進行對齊,例如,double型變量的地址老是8的倍數<br> <input disabled type="radio" name="choice10">B.不一樣操做系統採用的對齊策略可能不一樣<br> <input disabled type="radio" name="choice10">C.對於同一個struct型變量,在不一樣對齊方式下可能會佔用不一樣大小的存儲區<br> <input disabled type="radio" name="choice10">D.能夠用編譯指導語句(如#pragma pack)設置對齊方式<br> </div>