Which of the following storage keeps local variables of a program?
Stack segment |
|
Code segment |
|
Heap segment |
|
Data segment |
Which of the following storage keeps local variables of a program? Stack segment Code segment Heap...
The address space of a process contains a stack segment, a heap segment, a .bss segment, a .data segment and a .txt segment. Where are the following stored? a) Dynamic data allocated by malloc() b) An initialized external static variable c) An integer variable declared as static but not initialized within a function
6. Each time a function is invoked, the system stores parameters and local variables in an area of memory, known as_ _ _ _ _ _ _ _ _ _ _ _ _ _, which stores elements in last-in first-out fashion. a) Heap b) Storage area c) Stack d) Array
A process' memory structure includes... stack pile section text or code data section heap
When a program is activated into a process, part of this activation is the allocation and mapping of several memory segments to support the execution of the process. Addresses from which segment are found in the program counter (PC)? Stack Heap Initialized data Code Uninitialized data
1. Which of the following is a problem with dynamic scoping? Readability Access to nonlocal variables takes longer Static type checking may not be possible 2.Languages with dynamic type binding are usually implemented using: Compilers Interpreters Hybrid implementations JIT 3.Which variables are created using operator new? Static Stack-dynamic Explicit heap-dynamic Implicit heap-dynamic 4.Which variables are bound to memory cells before program execution and remain bound to the same memory cell during program execution? Static Stack-dynamic Explicit heap-dynamic Implicit heap-dynamic
Question 21 Implement the following code fragments in Hack Virtual Machine code, the variables a, b and c are in the local segment at offsets 4, 5 and 6 respectively. Jack Code a)-(alb) Virtual Machine Code [4 marks] b) (a(b+c) 5 marks] [5 marks] d) Recursive.factorial(6) 2 marks] e) a # c * b 4 marks] Total for Question 21: 20 marks] Question 21 Implement the following code fragments in Hack Virtual Machine code, the variables a, b and c...
In the following C program, indicate the variable type (global, local, or static local), the lifetime (when the program is run or when the function is called), and the memory allocation (from stack or from heap) for each variable (x, y, z, and w) defined in the program. int w; void fun (int x) { int y; static float z; ... } void main() { fun(w); }
Options for both are: - .rodata - .bss - .data - heap - stack Consider the following code snippet: int arrt 8 1 int* p - arr; int val - void main(O int x; static int y; printf("end of main\n") The specific memory areas variable arr and variable p will be stored in are Select] andSelect respectively
What is the correct way to address local stack variables in a loop (programmatically) using x86 assembly? Why can't i use this code: mov [ebp - 4 * ecx], eax Where ecx is a counter?
Computer memory is typically organized in a hierarchy with different types of memory providing different size, speed, cost, and volatility trade-offs. Which of the following statements are true: Registers are the fastest memory accessible by machine instructions. Random Access Memory (RAM) is typically divided into regions (segments) dedicated to specific uses by executing programs. Instructions are fetched from Code segments. Temporary values used to support algorithm recursion are stored in Stack Segments. in computer programming, a static variable is a...