Here is the entire assembly code for the body of a function (but function) in a C program. ADD R7, R4, H5 LDR R7, R7, He STR R7, R5, ue LDR R7, R5, ue STR R7, RS, -1 ADD R7, R4, 14 LDR R7, R7, ue STR R7, RS, He

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Local Variables and Parameters
Here is the entire assembly code for the body of a function (but excluding the activation record set-up code and the return statement of the
function) in a C program.
ADD R7, R4, 5
LDR R7, R7, He
STR R7, R5, ue
LDR R7, R5, He
STR R7, R5, H-1
ADD R7, R4, 14
LDR R7, R7, ne
STR R7, R5, ne
And here is the entire global data section of that program
GLOBAL_DATA_START
g .FILL 12
L1_activi .FILL 1c3_L1_activi
f .FILL 1c3_t
L5_activi .FILL lc3_L5_activi
L7_activi .FILL 13
L6_activi .FILL H6
L4_activi .FILL 184
L3_activi .FILL 1
L2_activi .FILL 45
.END
How many lines of C code does the body of this function have?
How many local variables does this function have?
What is the value in the first local variable just before the function returns?
If the function has two parameters, how many memory cells does the activation record for this function occupy?
Transcribed Image Text:Local Variables and Parameters Here is the entire assembly code for the body of a function (but excluding the activation record set-up code and the return statement of the function) in a C program. ADD R7, R4, 5 LDR R7, R7, He STR R7, R5, ue LDR R7, R5, He STR R7, R5, H-1 ADD R7, R4, 14 LDR R7, R7, ne STR R7, R5, ne And here is the entire global data section of that program GLOBAL_DATA_START g .FILL 12 L1_activi .FILL 1c3_L1_activi f .FILL 1c3_t L5_activi .FILL lc3_L5_activi L7_activi .FILL 13 L6_activi .FILL H6 L4_activi .FILL 184 L3_activi .FILL 1 L2_activi .FILL 45 .END How many lines of C code does the body of this function have? How many local variables does this function have? What is the value in the first local variable just before the function returns? If the function has two parameters, how many memory cells does the activation record for this function occupy?
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
ADT and Class
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education