Passing Parameters on the Stack (Example 10.5): m=r7, n=r4, p=r5 SRAM_BASE EQU Ox40000000 AREA PassbyStack, CODE, READONLY ENTRY LDR Sp, =SRAM_BASE MOV r1, #0x40000000 MOV 12, #2 STMIA sp), {r1, r2} ; push parameters onto stack BL saturate LDMDBSP), {r1, r2} ; pop results off stack ; Performs r4 = saturate32 (r5 << r7) STMIA spl, {r3-r7, r} ; LR on stack for reentrancy LDR r5, (sp, #-Ox20} LDR 17, (sp, #-O×1C} SATURATE ALGORITHM STR r4, (sp, #-0x20] LDMDBSP!, {r3-r7, pc} saturate ; get 1" parameter off stack ; get 2 parameter off stack ; move result to bottom of stack ; return END Instructions: For each of the following questions, you may change the three different chunks of code above, only where relevant to answer the question correctly. For all the STM and LDM instructions, instead of using the stack convention, have the corresponding IB, IA, DB, and DA too. 1. As these three pieces of code are written now, what is each's stack policy?
Passing Parameters on the Stack (Example 10.5): m=r7, n=r4, p=r5 SRAM_BASE EQU Ox40000000 AREA PassbyStack, CODE, READONLY ENTRY LDR Sp, =SRAM_BASE MOV r1, #0x40000000 MOV 12, #2 STMIA sp), {r1, r2} ; push parameters onto stack BL saturate LDMDBSP), {r1, r2} ; pop results off stack ; Performs r4 = saturate32 (r5 << r7) STMIA spl, {r3-r7, r} ; LR on stack for reentrancy LDR r5, (sp, #-Ox20} LDR 17, (sp, #-O×1C} SATURATE ALGORITHM STR r4, (sp, #-0x20] LDMDBSP!, {r3-r7, pc} saturate ; get 1" parameter off stack ; get 2 parameter off stack ; move result to bottom of stack ; return END Instructions: For each of the following questions, you may change the three different chunks of code above, only where relevant to answer the question correctly. For all the STM and LDM instructions, instead of using the stack convention, have the corresponding IB, IA, DB, and DA too. 1. As these three pieces of code are written now, what is each's stack policy?
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
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
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…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
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…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
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)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY