Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
Match the C-function on the left to the Intel assemble function on the right.
W:
cmpl $4
movl %edi , %edi
jmp .L4(,%rdi,8)
%edi
.L3:
movl $17, %eax
ret
.15:
movl $3, %eax
int A ( int x , int y) {
int a ;
if ( x == 0 )
else i f ( x == 1 ) a = 3 ;
else i f ( x == 2 ) a = 2 0 ;
else i f ( x == 3 ) a = 2 ;
else i f ( x == 4 ) a = 1 ;
ret
.L6:
a = 17;
movl $20, %eax
ret
.L7:
movl $2, %eax
ret
else
a = 0;
.L8:
return a ;
movl $1, %eax
.L2:
ret
. section .rodata
. L4:
.quad .L3
.quad .L5
.quad .L6
.quad .L7
.quad .L8
X:
testl %edi, %edi
je
cmpl
je
cmpl
je
стр1
je
cmpl
.L16
$1, %edi
.L17
$2, %edi
.L18
$3, %edi
int B (int x, int y) {
int a;
switch (x) {
.L19
$4, %edi
%al
movzbl %al, %eax
case 0: a = 17; break;
sete
break;
case 1: a = 3;
case 2: a = 20; break;
case 3: a = 2; break;
case 4: a = 1;
a = 0;
}
return a;
ret
.L16:
break;
movl
$17, %eax
ret
.L17:
movl
$3, %eax
}
ret
.L18:
movl
$20, %eax
ret
.L19:
movl
ret
$2, %eax
expand button
Transcribed Image Text:Match the C-function on the left to the Intel assemble function on the right. W: cmpl $4 movl %edi , %edi jmp .L4(,%rdi,8) %edi .L3: movl $17, %eax ret .15: movl $3, %eax int A ( int x , int y) { int a ; if ( x == 0 ) else i f ( x == 1 ) a = 3 ; else i f ( x == 2 ) a = 2 0 ; else i f ( x == 3 ) a = 2 ; else i f ( x == 4 ) a = 1 ; ret .L6: a = 17; movl $20, %eax ret .L7: movl $2, %eax ret else a = 0; .L8: return a ; movl $1, %eax .L2: ret . section .rodata . L4: .quad .L3 .quad .L5 .quad .L6 .quad .L7 .quad .L8 X: testl %edi, %edi je cmpl je cmpl je стр1 je cmpl .L16 $1, %edi .L17 $2, %edi .L18 $3, %edi int B (int x, int y) { int a; switch (x) { .L19 $4, %edi %al movzbl %al, %eax case 0: a = 17; break; sete break; case 1: a = 3; case 2: a = 20; break; case 3: a = 2; break; case 4: a = 1; a = 0; } return a; ret .L16: break; movl $17, %eax ret .L17: movl $3, %eax } ret .L18: movl $20, %eax ret .L19: movl ret $2, %eax
Y:
cmpl %esi, %edi
jge
movl $0, %eax
.L12
.L11:
int c (int x, int y) {
int a = 0;
while (x < y) {
a += x * y;
++x; --y;}
movl %edi, %edx
imull
addl
addl
subl
%esi, %edx
%edx, %eax
$1, %edi
$1, %esi
cmpl %esi, %edi
.L11
return a;
}
jl
ret
.L12:
movl $0, %eax
ret
Z:
cmpl %esi, %edi
jge
pushq %rbx
movl %edi, %ebx
imull %esi, %ebx
subl
addl $1, %edi
call
.L22
int D (int x, int y) {
if (x >= y)
return 0;
else
return (x*y) + D(x+1, y -1);
}
$1, %esi
D
addl %ebx, %eax
jmp
.L21
.L22:
movl
$0, %eax
ret
.L21:
popq %rbx
ret
A
[選択]
В
[選択]
C
[選択]
D
[選択]
>
>
>
expand button
Transcribed Image Text:Y: cmpl %esi, %edi jge movl $0, %eax .L12 .L11: int c (int x, int y) { int a = 0; while (x < y) { a += x * y; ++x; --y;} movl %edi, %edx imull addl addl subl %esi, %edx %edx, %eax $1, %edi $1, %esi cmpl %esi, %edi .L11 return a; } jl ret .L12: movl $0, %eax ret Z: cmpl %esi, %edi jge pushq %rbx movl %edi, %ebx imull %esi, %ebx subl addl $1, %edi call .L22 int D (int x, int y) { if (x >= y) return 0; else return (x*y) + D(x+1, y -1); } $1, %esi D addl %ebx, %eax jmp .L21 .L22: movl $0, %eax ret .L21: popq %rbx ret A [選択] В [選択] C [選択] D [選択] > > >
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education