Registers Flashcards

learn about Registers

1
Q

Questions 6, 7, 8and 9 all refer to the following values in registers and memory of an Intel computer.

Registers
%rax 0x800
%rbx 0x410
%rdx 0x004
%rsi0xFFFFFFFFFFFFFFFF
Memory
Address - Value
0x800 -----0xFF
0x804 -----0x41
0x808 -----0x04
0x80c ------0xFFFFFFFFFFFFFFF
  1. For the assembly instruction movq 0x8(%rax, %rdx), %r8 what value is placed in %r8?
A

Answer: -1

movq 0x8(%rax, %rdx), %r8

movq means move quadword to register %r8.

%r8 = M[Imm + %rax + %rdx] 
%r8 = M[0x8 + 0x800 + 0x004]
%r8 = M[ 0x80c ]
%r8 = 0xFFFFFFFFFFFFFFF or -1
0x 008
0x 800
0x 004
--------------
0x   80c
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Questions 6, 7, 8and 9 all refer to the following values in registers and memory of an Intel computer.

Registers
%rax 0x800
%rbx 0x410
%rdx 0x004
%rsi0xFFFFFFFFFFFFFFFF
Memory
Address - Value
0x800 -----0xFF
0x804 -----0x41
0x808 -----0x04
0x80c ------0xFFFFFFFFFFFFFFF
7. For the assembly instruction movq -0x18(, %rbx, 2), %r8 what value is placed in %r8?
A

Answer: 0x04

movq -0x18(, %rbx, 2), %r8 what value is placed in %r8?
means move quadword to register %r8

%r8 = M[Imm + (%rbx * 2)]
%r8 = M[-0x18 + (0x410 * 2)] 
%r8 = M[-0x18 + 0x820]
%r8 = M[0x 808]
%r8 = 0x04
    0x 410
x           2
-------------
  0x  820
- 0x  018
--------------
   0x 808
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Questions 6, 7, 8and 9 all refer to the following values in registers and memory of an Intel computer.

Registers
%rax 0x800
%rbx 0x410
%rdx 0x004
%rsi0xFFFFFFFFFFFFFFFF
Memory
Address - Value
0x800 -----0xFF
0x804 -----0x41
0x808 -----0x04
0x80c ------0xFFFFFFFFFFFFFFF
  1. For the assembly instruction movq 0x804(%rdx), %r8 what value is placed in %r8
A

Answer: 0x04

movq 0x804(%rdx), %r8
means move quadword to register %r8
%r8 = M[Imm + %rdx]
%r8 = M[0x804 + 0x004] 
%r8 = M[0x808]
%r8 = 0x04
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Questions 6, 7, 8and 9 all refer to the following values in registers and memory of an Intel computer.

Registers
%rax 0x800
%rbx 0x410
%rdx 0x004
%rsi   0xFFFFFFFFFFFFFFFF
Memory
Address - Value
0x800 -----0xFF
0x804 -----0x41
0x808 -----0x04
0x80c ------0xFFFFFFFFFFFFFFF
  1. For the assembly instruction leaq-0xC(%rax, %rsi, 4), %r8 what value is placed in %r8?
A

Answer: 0x7F0

leaq-0xC(%rax, %rsi, 4), %r8
means “load effective address” value

%r8 = M[-0xC + %rax + (%rsi * 4)]

   -0x 001
 x          4
--------------
   -0x 004
\+ -0x 00C
--------------
   0x 010

0x 800
- 0x 010
————-
0x 7F0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly