Question

1. (1, a, b, c)

please answer and explain all abc using information below:

Read the program and the descriptions below before answering the next 6 questions. #include <stdio.h> int w = -1, x = 3, y =

1. a, b, c

What is the offset value A? Select one: O-2 O-1 0 1 O 2 оо What is the offset value X? Select one: O-2 O 2 O-1 0 1 O 3 In the

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the solution to above problem . PLEASE GIVE A THUMBS UP!!!!

1) The offset value of A is 0 because it is the first variable in local space

2) The offset value of X is 2 because the size of int is 2 byte and from starting address we need to move two byte forward to get x

3) The Register 6 is the register which points to the top of the stack in LC-3 machine

Add a comment
Know the answer?
Add Answer to:
1. (1, a, b, c) please answer and explain all abc using information below: 1. a,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Can someone explain how the answer is 2. thanks 0.2/0.2 pts Question 2 Read the program and the descriptions below #include <stdio.h> int x=0x10, y=0x200, z=0x30; int main) int a, b-0x12, c-0x20...

    Can someone explain how the answer is 2. thanks 0.2/0.2 pts Question 2 Read the program and the descriptions below #include <stdio.h> int x=0x10, y=0x200, z=0x30; int main) int a, b-0x12, c-0x20, d-0x210; a0x5; while (c <- y) printf("END In") Assume that (i) rG represents the register pointing to the beginning of the locations where the global variables are stored, (ii) rL denotes the register that records the start of the locations where the local variables are stored, and (iii)...

  • NEED HELP WITH THIS . Write a MARIE assembly language program that would simulate calling and exe...

    NEED HELP WITH THIS . Write a MARIE assembly language program that would simulate calling and executing the following C function, as shown below: z = someFunction(a, b); where z, a and b are main( ) program variables, and the values stored in a and b are input by the user. The value stored in z will be output. Did your program execute correctly? This is the code for the function: int someFunction(int x, int y) { return 3 *...

  • ANSWER ASAP PLEASE IN C Duplicate the program below to a new Program 2, and modify...

    ANSWER ASAP PLEASE IN C Duplicate the program below to a new Program 2, and modify Program 2 such that it generates n random virtual addresses between 0 and 232-1 and computes the page number and offset for each address. Here, do not write to the console. Instead, run your program with n = 1000000 random virtual addresses and compute the total CPU time of the task. Report your findings, as well as how you ran your program. Provide commentary...

  • Question 19 4 pts Using the program below, please complete the program by adding 2 functions...

    Question 19 4 pts Using the program below, please complete the program by adding 2 functions as follow: 1. A function named getAverage that calculates and returns the Average. 2. A function named getMaximum that returns the maximum of the three numbers. Make sure to use the proper data types for all variables and functions. #include <iostream> using namespace std; //function getAverage //function getMaximum int main(int argc, char** argv) { int x, y, z; cout << "Enter three whole numbers:...

  • Run the C program below and complete the table showing all the variables. Add printf function...

    Run the C program below and complete the table showing all the variables. Add printf function calls to obtain the addresses and values of all 13 variables. (Count the array (ca) as 3 variable/values and also include argc and argv in the table). The table must show the Address, Name, Datatype, Scope, and Value of each variable on the stack. (Hint: use the sizeof function to double check your addresses.) Explain how different the actual memory allocations are from what...

  • Question 1. Assume the following C program and You are writing code using SPIM to implement...

    Question 1. Assume the following C program and You are writing code using SPIM to implement this program. Write the results of each of the following in MIPS instructions. Use registers $t0 - $t7 as needed, Note: int requires 8 bytes 1. Load the contents of dot_prod and i into registers 2. Load the contents of a[i] and b[i] into registers 3. Calculate dot_prod + a[i]*b[i] and save the result into dot_prod please answer each point from (1,2,3) in separated...

  • Output all combinations of character variables a, b, and c. If a x,b-y, and c z, then the output ...

    write solution to the program above in C please and thank you. Output all combinations of character variables a, b, and c. If a x,b-y, and c z, then the output is Your code will be tested in three different programs, with a, b, c assigned with Χ. 'y', 'z', then with #. 'S. %, then with T, 23 1 #include 3 int main(void) { char a char b; char c; 4. 7 scanf(" scanf(" scanf(" %c %c %c ",...

  • Consider the following in C int main() { float x = 3.14, *p = &x; int...

    Consider the following in C int main() { float x = 3.14, *p = &x; int r, a = 2, b[] = {5, 6, 7}; <more code here> r = Foo(x, p, &a, b) <more code here> } int Foo(float x,float y, int *z, int *w) { <Foo's code goes here> } statement in Foo result (assigned value) modify Foo's AF variables modify main's AF variables statement in Foo result (assigned value) modify Foo's AF variables modify main's AF variables...

  • use c++13.12 1. Ql.cpp(40%) The questions are listed in the comments of C++ source code file...

    use c++13.12 1. Ql.cpp(40%) The questions are listed in the comments of C++ source code file Ql.cpp. a. Fill the blanks in file Ql.cpp at position or_. b. Follow the instructions in comments of source code file Q1cpp to modify the code at specified line. Compile Q1,cpp and execute it. Except for line 4, the program output will look like the c. following lines, because the random sequence may depend on the system. Errert Hewline charaeter 6556 51 1 53...

  • int c = 75; int d = 100; int& r1 = c; int& r2 = d;...

    int c = 75; int d = 100; int& r1 = c; int& r2 = d; c++; r2++; Use the code above. Suppose the variable c lives at memory address 512, and d lives at the memory address 1024. The size of an integer is 4 bytes. After execution of the above code, draw labelled boxes for each of the 4 variables c, d, r1 and r2, and show their integer values. For r1 and r2, draw an additional arrow...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT