CS 410 Project One Proficiency Test Template
docx
keyboard_arrow_up
School
Southern New Hampshire University *
*We aren’t endorsed by this school
Course
410
Subject
Computer Science
Date
Feb 20, 2024
Type
docx
Pages
16
Uploaded by colossaltitan
CS 410 Project One Proficiency Test Template
Explain the functionality of the blocks of assembly code. “main” function”
Assembly Code Block
Explanation of Functionality
0:
push %rbp
1:
mov %rsp,%rbp
Pushes the base pointer to the stack and moves the stack pointer to the base pointer.
No allocation of bytes for this function
4:
lea 0x0(%rip),%rsi # b <main+0xb>
b:
lea 0x0(%rip),%rdi # 12 <main+0x12>
12:
callq 17 <main+0x17>
Loads the address of the current instruction pointer (b)
to %rsi
Loads the address of the current instruction pointer (12) to %rdi
Calls a function located at 17 with %rdi and %rsi as the 1
st
and 2
nd
arguments (quadword return commonly implemented as 64bits/8bytes)
17:
callq 1c <main+0x1c>
1c:
mov %eax,0x0(%rip) # 22 <main+0x22>
22:
mov 0x0(%rip),%eax # 28 <main+0x28>
28:
cmp $0x1,%eax
2b:
je 40 <main+0x40>
2d:
lea 0x0(%rip),%rsi # 34 <main+0x34>
34:
lea 0x0(%rip),%rdi # 3b <main+0x3b>
3b:
callq 40 <main+0x40>
40:
mov 0x0(%rip),%eax # 46 <main+0x46>
46:
cmp $0x1,%eax
49:
je 4d <main+0x4d>
4b:
jmp 17 <main+0x17>
[START OF 1ST LOOP]
Calls a function located at 1c
Moves %eax (the lower 32 bits of the value returned by the previous function call) to the instruction pointer
Moves the value at the instruction pointer back to %eax
Compares a value of 1 to the value at %eax
if %eax is greater than then the program will jump to 40
otherwise the following indented instructions will run
Loads the address of the current instruction pointer (34) to %rsi
Loads the address of the current instruction pointer (3b) to %rdi
Calls a function located at 40
Moves the value of the current instruction pointer to %eax
Compares the value of 1 to the value at %eax
Jumps to 4d
if they are equal thus ending the 1
st
loop
otherwise jump to 17
[END OF 1ST LOOP]
4d:
lea 0x0(%rip),%rsi # 54 <main+0x54>
[4D: START OF 2ND LOOP]
Loads the address of the current instruction pointer (54) to %rsi
1
54:
lea 0x0(%rip),%rdi # 5b <main+0x5b>
5b:
callq 60 <main+0x60>
60:
lea 0x0(%rip),%rsi # 67 <main+0x67>
67:
lea 0x0(%rip),%rdi # 6e <main+0x6e>
6e:
callq 73 <main+0x73>
73:
lea 0x0(%rip),%rsi # 7a <main+0x7a>
7a:
lea 0x0(%rip),%rdi # 81 <main+0x81>
81:
callq 86 <main+0x86>
86:
lea 0x0(%rip),%rsi # 8d <main+0x8d>
8d:
lea 0x0(%rip),%rdi # 94 <main+0x94>
94:
callq 99 <main+0x99>
99:
lea 0x0(%rip),%rsi # a0 <main+0xa0>
a0:
lea 0x0(%rip),%rdi # a7 <main+0xa7>
a7:
callq ac <main+0xac>
Loads the address of the current instruction pointer (5b) to %rdi
Calls a function located at 60 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the address of the current instruction pointer (67) to %rsi
Loads the address of the current instruction pointer (6e) to %rdi
Calls a function located at 73 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the address of the current instruction pointer (7a) to %rsi
Loads the address of the current instruction pointer (81) to %rdi
Calls a function located at 86 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the address of the current instruction pointer (8d) to %rsi
Loads the address of the current instruction pointer (94) to %rdi
Calls a function located at 99 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the address of the current instruction pointer (a0) to %rsi
Loads the address of the current instruction pointer (a7) to %rdi
Calls a function located at ac with %rdi and %rsi as the 1
st
and 2
nd
arguments
ac:
lea 0x0(%rip),%rsi # b3 <main+0xb3>
b3:
lea 0x0(%rip),%rdi # ba <main+0xba>
ba:
callq bf <main+0xbf>
bf:
mov %rax,%rdx
c2:
mov 0x0(%rip),%eax # c8 <main+0xc8>
c8:
mov %eax,%esi
ca:
mov %rdx,%rdi
cd:
callq d2 <main+0xd2>
d2:
mov %rax,%rdx
d5:
mov 0x0(%rip),%rax # dc <main+0xdc>
Loads the address of the current instruction pointer (b3) to %rsi
Loads the address of the current instruction pointer (ba) to %rdi
Calls a function located at bf with %rdi and %rsi as the 1st and 2nd arguments
Moves %rax (the value of the previous function call) to
%rdx
Moves the value of the current instruction pointer (c8)
to %eax
Moves the value at %eax to %esi
Moves the value at %rdx to %rdi
Calls a function located at d2 with %rdi and %rsi as the
1st and 2nd arguments
Moves %rax (the value of the previous function call) to
%rdx
Moves the value of the current instruction pointer (dc)
to %rax
Moves the value at %rax to %rsi
2
dc:
mov %rax,%rsi
df:
mov %rdx,%rdi
e2:
callq e7 <main+0xe7>
Moves the value at %rdx to %rdi
Calls a function located at e7 with %rdi and %rsi as the
1st and 2nd arguments
e7:
mov 0x0(%rip),%eax # ed <main+0xed>
ed:
cmp $0x1,%eax
f0:
jne f9 <main+0xf9>
f2:
callq f7 <main+0xf7>
f7:
jmp 109 <main+0x109>
f9:
mov 0x0(%rip),%eax # ff <main+0xff>
ff:
cmp $0x2,%eax
102:
jne 109 <main+0x109>
104:
callq 109 <main+0x109>
109
:
mov 0x0(%rip),%eax # 10f <main+0x10f>
10f:
cmp $0x3,%eax
112:
je 119 <main+0x119>
114:
jmpq 4d <main+0x4d>
119:
mov $0x0,%eax
11e:
pop %rbp
11f:
retq
Moves the value of the current instruction pointer (ed)
to %eax
Compares a value of 1 to the valye at %eax
Jumps to f9
if the values are not equal otherwise run the indented instructions
Calls a function located at f7
Jump to 109
Moves the current value of the instruction pointer to %eax
Compares a value of 2 to %eax
Jumps to 109
if the values are not equal otherwise run
the indented instructions
Calls a function located at 109
[109]
Moves the value of the current instruction pointer to %eax
Compares a value of 3 to the value at %eax
Jumps to 119 (escapes loop) i
f the are equal otherwise run the indented instructions
Jump to 4d
[END OF 2ND LOOP]
Moves a value of 0 to %eax
Pops the base pointer off the stack
Returns the function
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
ChangeCustomerChoice function
Assembly Code Block
Explanation of Functionality
42d:
push %rbp
42e:
mov %rsp,%rbp
431:
lea 0x0(%rip),%rsi # 438 <_Z20ChangeCustomerChoicev+0xb>
438:
lea 0x0(%rip),%rdi # 43f <_Z20ChangeCustomerChoicev+0x12>
43f:
callq 444 <_Z20ChangeCustomerChoicev+0x17>
444:
lea 0x0(%rip),%rsi # 44b <_Z20ChangeCustomerChoicev+0x1e>
44b:
lea 0x0(%rip),%rdi # 452 <_Z20ChangeCustomerChoicev+0x25>
452:
callq 457 <_Z20ChangeCustomerChoicev+0x2a>
457:
lea 0x0(%rip),%rsi # 45e <_Z20ChangeCustomerChoicev+0x31>
45e:
lea 0x0(%rip),%rdi # 465 <_Z20ChangeCustomerChoicev+0x38>
465:
callq 46a <_Z20ChangeCustomerChoicev+0x3d>
46a:
lea 0x0(%rip),%rsi # 471 <_Z20ChangeCustomerChoicev+0x44>
471:
lea 0x0(%rip),%rdi # 478 <_Z20ChangeCustomerChoicev+0x4b>
478:
callq 47d <_Z20ChangeCustomerChoicev+0x50>
Pushes the base pointer to the stack
Moves the stack pointer to the base pointer
Loads the current address of the instruction pointer to
%rsi
Loads the current address of the instruction pointer to
%rdi
Calls a function located at 444 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to
%rsi
Loads the current address of the instruction pointer to
%rdi
Calls a function located at 457 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to
%rsi
Loads the current address of the instruction pointer to
%rdi
Calls a function located at 46a with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to
%rsi
Loads the current address of the instruction pointer to
%rdi
Calls a function located at 47d with %rdi and %rsi as the 1
st
and 2
nd
arguments
47d:
mov 0x0(%rip),%eax # 483 <_Z20ChangeCustomerChoicev+0x56>
[START OF MAIN LOOP]
Moves the current value of the instruction pointer to %eax
Compares the value of 1 to the value at %eax
4
Assembly Code Block
Explanation of Functionality
483:
cmp $0x1,%eax
486:
jne 496 <_Z20ChangeCustomerChoicev+0x69>
488:
mov 0x0(%rip),%eax # 48e <_Z20ChangeCustomerChoicev+0x61>
48e:
mov %eax,0x0(%rip) # 494 <_Z20ChangeCustomerChoicev+0x67>
494:
jmp 4f8 <_Z20ChangeCustomerChoicev+0xcb>
Jumps to 496
if they are not equal otherwise the indented instructions will run
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to the current value of the instruction pointer
Jumps to 4f8
(end of main loop)
496:
mov 0x0(%rip),%eax # 49c <_Z20ChangeCustomerChoicev+0x6f>
49c:
cmp $0x2,%eax
49f:
jne 4af <_Z20ChangeCustomerChoicev+0x82>
4a1:
mov 0x0(%rip),%eax # 4a7 <_Z20ChangeCustomerChoicev+0x7a>
4a7:
mov %eax,0x0(%rip) # 4ad <_Z20ChangeCustomerChoicev+0x80>
4ad:
jmp 4f8 <_Z20ChangeCustomerChoicev+0xcb>
Moves the current value of the instruction pointer to %eax
Compares the value of 2 to the value at %eax
Jumps to 4af
if they are not equal otherwise the indented instructions will run
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to the current value of the instruction pointer
Jumps to 4f8
(end of main loop)
4af:
mov 0x0(%rip),%eax # 4b5 <_Z20ChangeCustomerChoicev+0x88>
4b5:
cmp $0x3,%eax
4b8:
jne 4c8 <_Z20ChangeCustomerChoicev+0x9b>
4ba:
mov 0x0(%rip),%eax # 4c0 <_Z20ChangeCustomerChoicev+0x93>
4c0:
mov %eax,0x0(%rip) # 4c6 <_Z20ChangeCustomerChoicev+0x99>
Moves the current value of the instruction pointer to %eax
Compares the value of 3 to the value at %eax
Jumps to 4c8
if they are not equal otherwise the indented instructions will run
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to the current value of the instruction pointer
Jumps to 4f8
(end of main loop)
5
Assembly Code Block
Explanation of Functionality
4c6:
jmp 4f8 <_Z20ChangeCustomerChoicev+0xcb>
4c8:
mov 0x0(%rip),%eax # 4ce <_Z20ChangeCustomerChoicev+0xa1>
4ce:
cmp $0x4,%eax
4d1:
jne 4e1 <_Z20ChangeCustomerChoicev+0xb4>
4d3:
mov 0x0(%rip),%eax # 4d9 <_Z20ChangeCustomerChoicev+0xac>
4d9:
mov %eax,0x0(%rip) # 4df <_Z20ChangeCustomerChoicev+0xb2>
4df:
jmp 4f8 <_Z20ChangeCustomerChoicev+0xcb>
Moves the current value of the instruction pointer to %eax
Compares the value of 4 to the value at %eax
Jumps to 4e1
if they are not equal otherwise the indented instructions will run
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to the current value of the instruction pointer
Jumps to 4f8
(end of main loop)
4e1:
mov 0x0(%rip),%eax # 4e7 <_Z20ChangeCustomerChoicev+0xba>
4e7:
cmp $0x5,%eax
4ea:
jne 4f8 <_Z20ChangeCustomerChoicev+0xcb>
4ec:
mov 0x0(%rip),%eax # 4f2 <_Z20ChangeCustomerChoicev+0xc5>
4f2:
mov %eax,0x0(%rip) # 4f8 <_Z20ChangeCustomerChoicev+0xcb>
4f8:
90 nop
4f9:
pop %rbp
4fa:
retq
Moves the current value of the instruction pointer to %eax
Compares the value of 5 to the value at %eax
Jumps to 4f8
if they are not equal otherwise the indented instructions will run
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to the current value of the instruction pointer
Jumps to 4f8
(end of main loop)
Pops the base pointer off the stack
Returns the function
CheckUserPermissonAccess Function
Assembly Code Block
Explanation of Functionality
120:
push %rbp
Pushes the base pointer on the stack
Moves the stack pointer to the base pointer
6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Assembly Code Block
Explanation of Functionality
121:
mov %rsp,%rbp
124:
push %rbx
125:
sub $0x48,%rsp
129:
mov %fs:0x28,%rax
130:
00 00
132:
mov %rax,-0x18(%rbp)
136:
xor %eax,%eax
Pushes %rbx on the stack
Allocates 0x48 (72) bytes by subtracting it from the stack pointer
Moves the value at %fs:0x28 to %rax and from %rax to
-0x18(%rbp)
Xors %eax to itself effectively setting it to zero
138:
lea -0x45(%rbp),%rax
13c:
mov %rax,%rdi
13f:
callq 144 <_Z25CheckUserPermissionAccessv+0x24>
144:
lea -0x45(%rbp),%rdx
148:
lea -0x40(%rbp),%rax
14c:
lea 0x0(%rip),%rsi # 153 <_Z25CheckUserPermissionAccessv+0x33>
153:
mov %rax,%rdi
156:
callq 15b <_Z25CheckUserPermissionAccessv+0x3b>
15b:
lea -0x45(%rbp),%rax
15f:
mov %rax,%rdi
162:
callq 167 <_Z25CheckUserPermissionAccessv+0x47>
167:
movl $0x0,-0x44(%rbp)
16e:
lea 0x0(%rip),%rsi # 175 <_Z25CheckUserPermissionAccessv+0x55>
175:
lea 0x0(%rip),%rdi # 17c <_Z25CheckUserPermissionAccessv+0x5c>
Loads the effective address of -0x45(%rbp) to %rax
Moves the value at %rax to %rdi
Calls a function at 144 with %rdi as the 1
st
argument
Loads the effective address of -0x45(%rbp) to %rdx
Loads the effective address of -0x40(%rbp) to %rax
Loads the effective address of the current instruction pointer to %rsi
Moves the value at %rax to %rdi
Calls a function located at 15b with %rdi, and %rsi as the 1
st
and 2
nd arguments
Loads the effective address of -45(%rbp) to %rax
Moves the value at %rax to %rdi
Calls a function located at 167 with %rdi as the 1
st
argument
Moves a value of zero to -0x44(%rbp)
Loads the effective address of the current instruction pointer to %rsi
Loads the effective address of the current instruction pointer to %rdi
Calls a function located at 181 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the effective address of the current instruction pointer to %rsi
Loads the effective address of the current instruction pointer to %rdi
Calls a function located at 194 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the effective address of the current instruction pointer to %rsi
Loads the effective address of the current instruction pointer to %rdi
Calls a function located at 1a7 with %rdi and %rsi as the 1
st
and 2
nd
arguments
7
Assembly Code Block
Explanation of Functionality
17c:
callq 181 <_Z25CheckUserPermissionAccessv+0x61>
181:
lea 0x0(%rip),% rsi # 188 <_Z25CheckUserPermissionAccessv+0x68>
188:
lea 0x0(%rip),%rdi # 18f <_Z25CheckUserPermissionAccessv+0x6f>
18f:
callq 194 <_Z25CheckUserPermissionAccessv+0x74>
194:
lea 0x0(%rip),%rsi # 19b <_Z25CheckUserPermissionAccessv+0x7b>
19b:
lea 0x0(%rip),%rdi # 1a2 <_Z25CheckUserPermissionAccessv+0x82>
1a2:
callq 1a7 <_Z25CheckUserPermissionAccessv+0x87>
1a7:
lea -0x40(%rbp),%rax
1ab:
mov %rax,%rsi
1ae:
lea 0x0(%rip),%rdi # 1b5 <_Z25CheckUserPermissionAccessv+0x95>
1b5:
callq 1ba <_Z25CheckUserPermissionAccessv+0x9a>
1ba:
lea -0x40(%rbp),%rax
1be:
lea 0x0(%rip),%rsi # 1c5 <_Z25CheckUserPermissionAccessv+0xa5>
1c5:
mov %rax,%rdi
1c8:
callq 1cd <_Z25CheckUserPermissionAccessv+0xad>
1cd:
mov %eax,-0x44(%rbp)
1d0:
cmpl $0x0,-0x44(%rbp)
1d4:
jne 1dd Loads the effective address of -0x40(%rbp) to %rax
Moves the value at %rax to %rsi
Loads the effective address of the current instruction pointer to %rdi
Calls a function located at 1ba with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the effective address of -0x40(%rbp) to %rax
Loads the effective address of the current instruction pointer to %rsi
Moves the value at %rax to %rdi
Calls a function located at 1cd with %rdi and %rsi as the 1
st
and 2
nd
arguments
Moves %eax (the value returned by the previous function call) to -0x44(%rbp)
Compares the value of 0 to the value at -0x44(%rbp)
If it is not equal jump to 1dd
otherwise run the indented instruction
Moves a value of 2 to %ebx
Loads the effective address of -0x40(%rbp) to %rax
Moves the value at %rax to %rdi
Calls the function located at 1ee
Moves the value at %ebx to %eax
Moves the value at -0x18(%rbp) to %rcx
Xors the value at %fs:0x28 with the value at %rcx
If they are equal (both zero) jump to 23a
(it should since the register or data segment were not modified)
Otherwise it will jump to 235
**(Meaning code before 23a will be skipped)
8
Assembly Code Block
Explanation of Functionality
<_Z25CheckUserPermissionAccessv+0xbd>
1d6:
mov $0x1,%ebx
1db:
jmp 1e2 <_Z25CheckUserPermissionAccessv+0xc2>
1dd:
mov $0x2,%ebx
1e2:
lea -0x40(%rbp),%rax
1e6:
mov %rax,%rdi
1e9:
callq 1ee <_Z25CheckUserPermissionAccessv+0xce>
1ee:
mov %ebx,%eax
1f0:
mov -0x18(%rbp),%rcx
1f4:
xor %fs:0x28,%rcx
1fb:
00 00
1fd:
je 23a <_Z25CheckUserPermissionAccessv+0x11a>
1ff:
jmp 235 <_Z25CheckUserPermissionAccessv+0x115>
201:
mov %rax,%rbx
204:
lea -0x45(%rbp),%rax
208:
mov %rax,%rdi
20b:
callq 210 <_Z25CheckUserPermissionAccessv+0xf0>
210:
mov %rbx,%rax
213:
mov %rax,%rdi
216:
callq 21b <_Z25CheckUserPermissionAccessv+0xfb>
These instructions are jumped over
9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Assembly Code Block
Explanation of Functionality
21b:
mov %rax,%rbx
21e:
lea -0x40(%rbp),%rax
222:
mov %rax,%rdi
225:
callq 22a <_Z25CheckUserPermissionAccessv+0x10a>
22a:
mov %rbx,%rax
22d:
mov %rax,%rdi
230:
callq 235 <_Z25CheckUserPermissionAccessv+0x115>
235:
callq 23a <_Z25CheckUserPermissionAccessv+0x11a>
23a:
add $0x48,%rsp
23e:
pop %rbx
23f:
pop %rbp
240:
retq
Will call the function located at 23a if the data at %fs:0x28 does not match %rcx (it should not run)
Adds 0x48 to the stack pointer effectively deallocating those bytes
Pops %rbx off the stack
Returns the function
DisplayInfo Function
Assembly Code Block
Explanation of Functionality
241:
push %rbp
242:
mov %rsp,%rbp
245:
lea 0x0(%rip),%rsi # 24c <_Z11DisplayInfov+0xb>
24c:
lea 0x0(%rip),%rdi # 253 <_Z11DisplayInfov+0x12>
253:
callq 258 <_Z11DisplayInfov+0x17>
258:
mov %rax,%rdx
25b:
mov 0x0(%rip),%rax # 262 Pushes the base pointer to the stack
Moves the stack pointer to the base pointer.
Loads the current address of the instruction pointer to %rsi
Loads the current address of the instruction pointer to %rdi
Calls a function located at 258 with %rdi and
%rsi as the 1
st
and 2
nd
arguments
Moves %rax (the value of the previous function call) to %rdx
Moves the current value of the instruction pointer to %rax
Moves the value at %rax to %rsi
Moves the value at %rdx to %rdi
10
Assembly Code Block
Explanation of Functionality
<_Z11DisplayInfov+0x21>
262:
mov %rax,%rsi
265:
mov %rdx,%rdi
268:
callq 26d <_Z11DisplayInfov+0x2c>
26d:
lea 0x0(%rip),%rsi # 274 <_Z11DisplayInfov+0x33>
274:
lea 0x0(%rip),%rdi # 27b <_Z11DisplayInfov+0x3a>
27b:
callq 280 <_Z11DisplayInfov+0x3f>
280:
lea 0x0(%rip),%rsi # 287 <_Z11DisplayInfov+0x46>
287:
mov %rax,%rdi
28a:
callq 28f <_Z11DisplayInfov+0x4e>
28f:
lea 0x0(%rip),%rsi # 296 <_Z11DisplayInfov+0x55>
296:
mov %rax,%rdi
299:
callq 29e <_Z11DisplayInfov+0x5d>
29e:
mov %rax,%rdx
2a1:
mov 0x0(%rip),%eax # 2a7 <_Z11DisplayInfov+0x66>
2a7:
mov %eax,%esi
2a9:
mov %rdx,%rdi
2ac:
callq 2b1 <_Z11DisplayInfov+0x70>
2b1:
mov %rax,%rdx
2b4:
mov 0x0(%rip),%rax # 2bb <_Z11DisplayInfov+0x7a>
Calls a function located at 26d with %rdi and %rsi as the 1
st
and 2
nd
argument.
Loads the effective address of the current instruction pointer to %rsi
Loads the effective address of the current instruction pointer to %rdi
Calls a function located at 280 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to %rsi
Moves the value at %rax (the value of the previous function call) to %rdi
Calls a function located at 28f with %rdi and %rsi as the
1
st
and 2
nd
arguments
Loads the address of instruction pointer to %rsi
Moves the value at %rax (the value of the previous function call) to %rdi
Calls a function located at 29e with %rdi and %rsi as the 1
st
and 2
nd
arguments
Moves the value at %rax (the value of the previous function call) to %rdx
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to %esi
Moves the value at %rxs to %rdi
Calls a function located at 2b1 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Moves the value at %rax (the value of the previous function call) to %rdx
Moves the current value of the instruction pointer to %rax
Moves the value at %rax to %rsi
Moves the value at %rdx to %rdi
Calls the function located at 2c6 with %rdi and %rsi as the 1
st
and 2
nd
function
Loads the current address of the instruction pointer to %rsi
Loads the current address of the instruction pointer to %rdi
Calls the function located at 2d9 with %rdi and %rsi as the 1
st
and 2
nd
function
Loads the current address of the instruction pointer to %rsi
Moves %rax (the result of the previous function call) to
%rdi
Calls a function located at 2e8 with %rdi and %rsi as 11
Assembly Code Block
Explanation of Functionality
2bb:
mov %rax,%rsi
2be:
mov %rdx,%rdi
2c1:
callq 2c6 <_Z11DisplayInfov+0x85>
2c6:
lea 0x0(%rip),%rsi # 2cd <_Z11DisplayInfov+0x8c>
2cd:
lea 0x0(%rip),%rdi # 2d4 <_Z11DisplayInfov+0x93>
2d4:
callq 2d9 <_Z11DisplayInfov+0x98>
2d9:
lea 0x0(%rip),%rsi # 2e0 <_Z11DisplayInfov+0x9f>
2e0:
mov %rax,%rdi
2e3:
callq 2e8 <_Z11DisplayInfov+0xa7>
2e8:
lea 0x0(%rip),%rsi # 2ef <_Z11DisplayInfov+0xae>
2ef:
mov %rax,%rdi
2f2:
callq 2f7 <_Z11DisplayInfov+0xb6>
2f7:
mov %rax,%rdx
2fa:
mov 0x0(%rip),%eax # 300 <_Z11DisplayInfov+0xbf>
300:
mov %eax,%esi
302:
mov %rdx,%rdi
305:
callq 30a <_Z11DisplayInfov+0xc9>
30a:
mov %rax,%rdx
30d:
mov 0x0(%rip),%rax # 314 <_Z11DisplayInfov+0xd3>
314:
mov %rax,%rsi
the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to %rsi
Moves %rax (the result of the previous function call) to
%rdi
Calls a function located at 2f7 with %rdi and %rsi as the
1
st
and 2
nd
argument
Moves %rax (the result of the previous function call) to
%rdx
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to %esi
Moves the value at %rdx to %rdi
Calls a function located at 30a with %rdi and %esi as the 1
st
and 2
nd
arguments
Moves %rax (the result of the previous function call) to
%rdx
Moves the current value of the instruction pointer to %rax
Moves the value at %rax to %rsi
Moves the value at %rdx to %rdi
Calls a function located at 31f with %rdi and %rsi as the
1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to %rsi
Loads the current address of the instruction pointer to %rdi
Calls a function located at 332 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to %rsi
Moves %rax (the result of the previous function call) to
%rdi
Calls a function located at 341 with %rdi and %rsi as the 1
st
and 2
nd
arguments
12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Assembly Code Block
Explanation of Functionality
317:
mov %rdx,%rdi
31a:
callq 31f <_Z11DisplayInfov+0xde>
31f:
lea 0x0(%rip),%rsi # 326 <_Z11DisplayInfov+0xe5>
326:
lea 0x0(%rip),%rdi # 32d <_Z11DisplayInfov+0xec>
32d:
callq 332 <_Z11DisplayInfov+0xf1>
332:
lea 0x0(%rip),%rsi # 339 <_Z11DisplayInfov+0xf8>
339:
mov %rax,%rdi
33c:
callq 341 <_Z11DisplayInfov+0x100>
341:
lea 0x0(%rip),%rsi # 348 <_Z11DisplayInfov+0x107>
348:
mov %rax,%rdi
34b:
callq 350 <_Z11DisplayInfov+0x10f>
350:
mov %rax,%rdx
353:
mov 0x0(%rip),%eax # 359 <_Z11DisplayInfov+0x118>
359:
mov %eax,%esi
35b:
mov %rdx,%rdi
35e:
callq 363 <_Z11DisplayInfov+0x122>
363:
mov %rax,%rdx
366:
mov 0x0(%rip),%rax # 36d <_Z11DisplayInfov+0x12c>
36d:
mov %rax,%rsi
370:
mov %rdx,%rdi
Loads the current address of the instruction pointer to %rsi
Moves %rax (the result of the previous function call) to
%rdi
Calls a function located at 350 with %rdi and %rsi as the 1
st
and 2
nd
arguments
Moves %rax (the result of the previous function call) to
%rdx
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to %esi
Moves the value at %rdx (the value of the previous function call) to %rdi
Calls a function located at 363 with %rdi and %esi as the 1
st
and 2
nd
arguments
Moves %rax (the result of the previous function call) to
%rdx
Moves the current value of the instruction pointer to %rax
Moves the value at %rax to %rsi
Moves the value at %rdx (the result of the previous function call) to %rdi
Calls a function located at 378 with %rdi and %rsi as the 1
st
and 2
nd
arguments
13
Assembly Code Block
Explanation of Functionality
373:
callq 378 <_Z11DisplayInfov+0x137>
378:
lea 0x0(%rip),%rsi # 37f <_Z11DisplayInfov+0x13e>
37f:
lea 0x0(%rip),%rdi # 386 <_Z11DisplayInfov+0x145>
386:
callq 38b <_Z11DisplayInfov+0x14a>
38b:
lea 0x0(%rip),%rsi # 392 <_Z11DisplayInfov+0x151>
392:
mov %rax,%rdi
395:
callq 39a <_Z11DisplayInfov+0x159>
39a:
lea 0x0(%rip),%rsi # 3a1 <_Z11DisplayInfov+0x160>
3a1:
mov %rax,%rdi
3a4:
callq 3a9 <_Z11DisplayInfov+0x168>
3a9:
mov %rax,%rdx
3ac:
mov 0x0(%rip),%eax # 3b2 <_Z11DisplayInfov+0x171>
3b2:
mov %eax,%esi
3b4:
mov %rdx,%rdi
3b7:
callq 3bc <_Z11DisplayInfov+0x17b>
3bc:
mov %rax,%rdx
3bf:
mov 0x0(%rip),%rax # 3c6 <_Z11DisplayInfov+0x185>
3c6:
mov %rax,%rsi
c9:
mov %rdx,%rdi
3cc:
callq 3d1 <_Z11DisplayInfov+0x190>
Loads the current address of the instruction pointer to %rsi
Loads the current address of the instruction pointer to %rdi
Calls a function located 38b with %rdi and %rsi as the 1
st
and 2
nd
arguments
Moves %rax (the result of the previous function call) to
%rdi
Calls a function located 38b with %rdi as the 1
st
argument
Loads the current value of the instruction pointer to %rsi
Move %rax (the result of the previous function call) to %rdi
Calls a function located at 39a with %rdi and %rsi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to %rsi
Move %rax (the result of the previous function call) to %rdi
Calls a function located at 39a with %rdi and %rsi as the 1
st
and 2
nd
arguments
Move %rax (the result of the previous function call) to %rdx
Moves the current value of the instruction pointer to %rax
Moves the value at %rax to %rsi
Moves the value at %rdx (the result of the previous function call) to %rdi
Calls a function located at 3d1 with %rdi and %rsi as the 1
st
and 2
nd
arguments
14
Assembly Code Block
Explanation of Functionality
3d1:
lea 0x0(%rip),%rsi # 3d8 <_Z11DisplayInfov+0x197>
3d8:
lea 0x0(%rip),%rdi # 3df <_Z11DisplayInfov+0x19e>
3df:
callq 3e4 <_Z11DisplayInfov+0x1a3>
3e4:
lea 0x0(%rip),%rsi # 3eb <_Z11DisplayInfov+0x1aa>
3eb:
mov %rax,%rdi
3ee:
callq 3f3 <_Z11DisplayInfov+0x1b2>
3f3:
lea 0x0(%rip),%rsi # 3fa <_Z11DisplayInfov+0x1b9>
3fa:
mov %rax,%rdi
3fd:
callq 402 <_Z11DisplayInfov+0x1c1>
402:
mov %rax,%rdx
405:
mov 0x0(%rip),%eax # 40b <_Z11DisplayInfov+0x1ca>
40b:
mov %eax,%esi
40d:
mov %rdx,%rdi
410:
callq 415 <_Z11DisplayInfov+0x1d4>
415:
mov %rax,%rdx
418:
mov 0x0(%rip),%rax # 41f <_Z11DisplayInfov+0x1de>
41f:
mov %rax,%rsi
422:
mov %rdx,%rdi
425:
callq 42a <_Z11DisplayInfov+0x1e9>
42a:
90 nop
Loads the current address of the instruction pointer to %rsi
Loads the current address of the instruction pointer to %rdi
Calls a function located at 3e4 with %rsi and %rdi as the 1
st
and 2
nd
arguments
Loads the current address of the instruction pointer to %rsi
Moves %rax (the result of the previous function call) to
%rdi
Calls a function located at 402 with %rdi and %rsi as the 1st and 2nd arguments
Moves %rax (the result of the previous function call) to
%rdx
Moves the current value of the instruction pointer to %eax
Moves the value at %eax to %esi
Moves the value at %rdx (the result of the previous function call) to %rdi
Calls a function located at 415 with %rdi and %esi as the 1
st
and 2
nd
arguments
Moves %rax (the result of the previous function call) to
%rdx
Moves the current value of the instruction pointer to %rax
Moves the value at %rax to %rsi
Moves the value at %rdx (the result of the previous function call) to %rdi
Calls a function located at 42a with %rdi and %rsi as the 1
st
and 2
nd
arguments
Pops the base pointer off the stack
Returns the functions
15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Assembly Code Block
Explanation of Functionality
42b:
pop %rbp
42c:
retq
16
Related Documents
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT