1 3 1 2 3 4 5 e 10 11 12 13 14 In € 17 IM 19 20 21 12 23 14 25 17 int mat1 [M] [N]; int mat 2 [N] [M]; int sum_element(int i, int j) { } In compiling this code, armcc.exe produces the following code. sum element PROC ADD LDR ADD ADD ADD LDR ADD ADD LDR ADD BX ENDP ILO.401 nati return mati[i][j] + mat2 [j] [i]; mat2 DCW DCD DCD as r2, ro, ro, LSL #1 r3, |L0.401 % r2, r2, ro, LSL #3 r2, r3, r2, LSL #2 r3, r3,#0x108 r2, [r2, r1, LSL #2] r1,r1, r1, LSL #1 ri, r3, r1,LSL #3 ro, [r1, r0, LSL #2] ro.ro,r2 1r 0x0000 11.bss|| AREA II.arn_vfe_headerI, DATA, READONLY, NOALLOC, ALIGN-2 0x00000000 AREA 11.bss|, DATA, NOINIT, ALIGN=2 264 10.
1 3 1 2 3 4 5 e 10 11 12 13 14 In € 17 IM 19 20 21 12 23 14 25 17 int mat1 [M] [N]; int mat 2 [N] [M]; int sum_element(int i, int j) { } In compiling this code, armcc.exe produces the following code. sum element PROC ADD LDR ADD ADD ADD LDR ADD ADD LDR ADD BX ENDP ILO.401 nati return mati[i][j] + mat2 [j] [i]; mat2 DCW DCD DCD as r2, ro, ro, LSL #1 r3, |L0.401 % r2, r2, ro, LSL #3 r2, r3, r2, LSL #2 r3, r3,#0x108 r2, [r2, r1, LSL #2] r1,r1, r1, LSL #1 ri, r3, r1,LSL #3 ro, [r1, r0, LSL #2] ro.ro,r2 1r 0x0000 11.bss|| AREA II.arn_vfe_headerI, DATA, READONLY, NOALLOC, ALIGN-2 0x00000000 AREA 11.bss|, DATA, NOINIT, ALIGN=2 264 10.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
![1 In the following source code, M and N are constants declared with #define.
int mat1 [M] [N];
int mat 2 [N] [M];
1
2
3
4
6
1
2
8
9
10
11
12
13
15
10
17
19
21
23
24
28
31
32
33
Name:
34
35
int sum_element(int i, int j) {
30
|}
In compiling this code, armcc.exe produces the following code.
sum element PROC
ADD
LDR
ADD
ADD
ADD
LDR
ADD
ADD
LDR
ADD
BX
ENDP
return mat1[i][j] + mat2 [j] [i];
mati
|L0.401
mat2
DCW
DCD
DCD
r2,ro,r0, LSL #1
r3, |L0.401
r2,r2, r0, LSL #3
r2, r3, r2, LSL #2
||.bss||
AREA ||.arm_vfe_header |I, DATA, READONLY, NOALLOC, ALIGN=2
%
r3, r3, #0x108
r2, [r2, r1, LSL #2]
%
r1,r1, r1, LSL #1
r1, r3,r1, LSL #3
ro, [r1, r0, LSL #2]
ro,ro,r2
lr
0x0000
AREA .bss|, DATA, NOINIT, ALIGN=2
0x00000000
264
264
Student No.:
EXPORT sum element [CODE]
EXPORT mat1 [DATA, SIZE-264]
EXPORT mat2 [DATA, SIZE-264]
;... some stuff omitted...
END
3
Reverse engineer the assembly code to determine the values of M and N. Com-
ment the assembly to show your understanding of the code. (Hint: line 2 loads
r3 with the address of mat1, and line 6 loads r3 with the address of mat2.)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0973f957-4134-4ab5-88ed-06bacd6111f8%2Fd7dca239-8055-4c44-82c5-e03e6c0e874c%2Fu4d3g2k_processed.jpeg&w=3840&q=75)
Transcribed Image Text:1 In the following source code, M and N are constants declared with #define.
int mat1 [M] [N];
int mat 2 [N] [M];
1
2
3
4
6
1
2
8
9
10
11
12
13
15
10
17
19
21
23
24
28
31
32
33
Name:
34
35
int sum_element(int i, int j) {
30
|}
In compiling this code, armcc.exe produces the following code.
sum element PROC
ADD
LDR
ADD
ADD
ADD
LDR
ADD
ADD
LDR
ADD
BX
ENDP
return mat1[i][j] + mat2 [j] [i];
mati
|L0.401
mat2
DCW
DCD
DCD
r2,ro,r0, LSL #1
r3, |L0.401
r2,r2, r0, LSL #3
r2, r3, r2, LSL #2
||.bss||
AREA ||.arm_vfe_header |I, DATA, READONLY, NOALLOC, ALIGN=2
%
r3, r3, #0x108
r2, [r2, r1, LSL #2]
%
r1,r1, r1, LSL #1
r1, r3,r1, LSL #3
ro, [r1, r0, LSL #2]
ro,ro,r2
lr
0x0000
AREA .bss|, DATA, NOINIT, ALIGN=2
0x00000000
264
264
Student No.:
EXPORT sum element [CODE]
EXPORT mat1 [DATA, SIZE-264]
EXPORT mat2 [DATA, SIZE-264]
;... some stuff omitted...
END
3
Reverse engineer the assembly code to determine the values of M and N. Com-
ment the assembly to show your understanding of the code. (Hint: line 2 loads
r3 with the address of mat1, and line 6 loads r3 with the address of mat2.)
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY