Question 1 Not yet answered Points out of 100 Flag question
Question 1
Not yet answered
Points out of 1.00
Flag question
Question text
Which x86-64 register is the program counter?
Select one:
a. %rip
b. %rsp
c. %rsi
d. %rbp
e. %rax
Question 2
Not yet answered
Points out of 1.00
Flag question
Question text
Provide a matching between the mov instruction and the number of bytes of data that get moved.
movq
movw
movb
movl
Question 3
Not yet answered
Points out of 1.00
Flag question
Question text
Provide a matching between the C data type and the number of bytes allocated for that data type on an Intel x86-64 machine.
char
int
char *
short int
Question 4
Not yet answered
Points out of 1.00
Flag question
Question text
Provide a matching between the C data type and the number of bytes allocated for that data type on an Intel x86-64 machine.
long
unsigned short int
float
char
Question 5
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
%rdx
Select one:
a. 0xAC
b. 0x10C
c. 0x25
d. 0x14
e. 0x104
f. 0x37
Question 6
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
(%rdx)
Select one:
a. 0xAC
b. 0x25
c. 0x10C
d. 0x104
e. 0x14
f. 0x37
Question 7
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
8(%rdx)
Select one:
a. 0x14
b. 0x104
c. 0x25
d. 0xAC
e. 0x37
f. 0x10C
Question 8
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
$0x10C
Select one:
a. 0x10C
b. 0x14
c. 0x104
d. 0xAC
e. 0x25
f. 0x37
Question 9
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
0x100
Select one:
a. 0x25
b. 0x10C
c. 0xAC
d. 0x37
e. 0x104
f. 0x14
Question 10
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
(%rbx, %rax)
Select one:
a. 0x37
b. 0x14
c. 0x104
d. 0x25
e. 0xAC
f. 0x10C
Question 11
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
(%rdx,%rcx,2)
Select one:
a. 0x25
b. 0xAC
c. 0x14
d. 0x104
e. 0x37
f. 0x10C
Question 12
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
2(%rbx,%rcx)
Select one:
a. 0x10C
b. 0x25
c. 0x104
d. 0xAC
e. 0x37
f. 0x14
Question 13
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
0xFC(,%rax,4)
Select one:
a. 0x14
b. 0x37
c. 0x104
d. 0xAC
e. 0x10C
f. 0x25
Question 14
Not yet answered
Points out of 1.00
Flag question
Question text
This problem is similar to practice problem 3.1. Please complete that problem before this one.
Assuming the operand is a double word, what is the value of an instruction\'s operand if the operand is:
236(,%rax,8)
Select one:
a. 0xAC
b. 0x104
c. 0x10C
d. 0x14
e. 0x25
f. 0x37
Question 15
Not yet answered
Points out of 1.00
Flag question
Question text
Using the following variable declarations:
char ch;
int in;
long ln;
short sn;
Provide a matching between the C statement and the corresponding X86-64 assembly instruction.
movw $3, -18(%rbp)
movb $3, -1(%rbp)
movq $3, -16(%rbp)
movl $3, -8(%rbp)
Question 16
Not yet answered
Points out of 1.00
Flag question
Question text
Using the following C type declarations:
char * cp1, * cp2;
int * ip;
long * lp;
unsigned short * usp;
unsigned int * uip;
Provide a matching between the C statements and the equivalent X86-64 assembly.
movb (%rax), %r11b
movb %r11b, (%rbx)
movsbl (%rcx), %r10d
movl %r10d, (%rbx)
movq (%rax), %rax
movl %eax, %r14d
movl %r14d, (%rbx)
movzwl (%rax), %r14d
movl %r14d, %eax
movq %rax, (%rcx)
movsbq (%rax), %rax
movq %rax, (%rcx)
movzwl (%rax), %r14d
movl %r14d, (%rbx)
Question 17
Not yet answered
Points out of 1.00
Flag question
Question text
Given the following initial register values:
%rsp: 0x100
%rdx: 0x25
and these values in memory:
0xf8: 0x25
0x100: 0xfc
0x108: 0x44
which of these is true after executing the statement:
popq %rdx
Select one:
a. %rsp = 0xf8, %rdx = 0x44
b. %rsp = 0x100, %rdx = 0xfc
c. %rsp = 0x100, %rdx = 0x25
d. %rsp = 0x108, %rdx = 0xfc
e. %rsp = 0x108, %rdx = 0x25
Question 18
Not yet answered
Points out of 1.00
Flag question
Question text
Given the following initial register values:
%rsp: 0x100
%rdx: 0x25
which of these is true after executing the statement:
pushq %rdx
Select one:
a. %rsp = 0xf8, %rdx = 0x25, mem[0x100] = 0x25
b. %rsp = 0x100, %rdx = 0x25, mem[0x100] = 0x25
c. %rsp = 0x100, %rdx = 0x25, mem[0xf8] = 0x25
d. %rsp = 0xf8, %rdx = 0x25, mem[0xf8] = 0x25
e. %rsp = 0x108, %rdx = 0x25, mem[0x108] = 0x25
| movq | Answer 1Choose...1248 |
| movw | Answer 2Choose...1248 |
| movb | Answer 3Choose...1248 |
| movl | Answer 4Choose...1248 |
Solution
1 ans) a. %rip
2 ans) mov q
3 ans) char *
4ans) long
5 ans) c. 0x25
6ans) d.0x104
7 ans) d. 0xAC
8 ans) a. 0x10C
9 ans) c. 0x14
10 ans) e. 0xAC
11 ans) c. 0x14
12ns) e. 0x37
13ans) d. 0xAC
14 ans) b. 0x104
15ans) movb $3, -1(%rbp)
16 ans)
movq (%rax),
%rax
movl %eax,
%r14d
movl %r14d,
(%rbx)
17ans) b. %rsp = 0x100, %rdx = 0xfc
18 ans) e. %rsp = 0x108, %rdx = 0x25, mem[0x108] = 0x25








