Question

Write the C55x assembly code for each of the following C snippet code shown below. Assume...

  1. Write the C55x assembly code for each of the following C snippet code shown below. Assume the 8-bit values a, b, c, and d are stored in locations 0x600, 0x601, 0x602, and 0x603 respectively in the memory. Store the result x in location 0x604 and y in location 0x60C. Do not use software to generate the assembly code and comment your code.
    1. x = (a - b)3 - (c*d);
    2. for (j=0;j<=200;j++)   y = y + (a * b);

Homework Answers

Know the answer?
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
Similar Questions
Convert each of the below C code snippet to LEGv8 assembly code. Assume variable a, b,...
Convert each of the below C code snippet to LEGv8 assembly code. Assume variable a, b, and c is stored in registers X19, X20, and X21 respectively. Base address of d is stored in register X22. Comment your assembly code. (24 Points) a. if (a > b) d[a] = b + 8; else d[a] = b - 16; b. for (i=0;i<a; i++) a = d[i] + c; c. i = 0; while ( d[i] == b) if(( a - i...
Convert each of the below C code snippet to LEGv8 assembly code. Assume the variables a,...
Convert each of the below C code snippet to LEGv8 assembly code. Assume the variables a, b, and c are stored in registers X19, X20, and X21 respectively. Base address of d is stored in register X22. Comment your assembly code. a. if (a > b) d[a] = b + 8; else d[a] = b - 16; b. for (i=0;i 0) i++; a = d[i] + c; c. i = 0; while (d[i] == b) if ((a - i) >...
write a subroutine at the end of the following code that will add two eight- bit...
write a subroutine at the end of the following code that will add two eight- bit number at data location 0x100 and 0x0200 and store the result in memory location x0x300?
(MIPS Assembly Language): Write the following sequence of code using *native* MIPS instructions: x = x...
(MIPS Assembly Language): Write the following sequence of code using *native* MIPS instructions: x = x - y[0] + y[1]; In memory x, y are stored beginning at 0x010000cc. Use registers $s1 for x,  and $s2 for the base address of y. Make sure your code includes all necessary declarations such that it could run in SPIM.
1. In the following C code, elements of each row are stored contiguously in memory. Assume...
1. In the following C code, elements of each row are stored contiguously in memory. Assume each element in an array is a 32-bit integer. p = 0; for (j=0; j<8; ++j) for(i=500; i>0; --i ) {     A[ i] = 2 * B[j]; ++p; } a. How many 32-bit integers can be stored in a 32-byte cache block? b. Which variable references exhibit temporal locality? c. Which variable references exhibit spatial locality?
Create three address code from the program snippet below. int a = 2, b = 8,...
Create three address code from the program snippet below. int a = 2, b = 8, c = 4, d; for (j = 0; j <= 10; j ++) ( a = a * (j * (b / c)); d = a * (j * (b / c)); }
Hello, I am trying to do an assignment that requires writing an MSP432 code to add...
Hello, I am trying to do an assignment that requires writing an MSP432 code to add two 64 bit numbers together and store the result in memory location 0x2000_0000. The problem is that the it is a 32 bit register. I don't know how to add to a load 64 bit numbers. The question is below but please feel free to use your own examples, I will understand better. Thank you very much. Write a small MSP432 code segment that...
I need to implement the following while loop in assembly: i = 1; while (i <=...
I need to implement the following while loop in assembly: i = 1; while (i <= 50) { A[i] = i; i++; } With the array of integers A stored at memory location x+200, where x is the address of the memory location where the assembly program is loaded. I can only use following commands; LOAD, STORE, ARITHMETIC (ADD, SUB, MUL, DIV, INC), SKIP, BRANCHING (BLT, BGT, BLEQ, BGEQ, BEQ), READ and WRITE, and HALT
QUESTION 1 Convert the following code fragment to assembly code fragment, using instructions discussed in class....
QUESTION 1 Convert the following code fragment to assembly code fragment, using instructions discussed in class. if X > Y then Y=X else X=Y 2 QUESTION Suppose a user wants to do a system call. Assume that the service routine of this system call is at physical address 500. Suppose the user knows this address of the service routine. So instead of executing a system call, the user simply jumps to this location 500 (by executing “JMP 500”). Assume that...
Please use loop and branch instructions to write an assembly code segment to do the following:...
Please use loop and branch instructions to write an assembly code segment to do the following: Read DIP switch. If DIP switch has the setting: b7 = b0 = 1, then, load A with number $11, load B with number $22, and do A+B; save the result to memory location $1000; if DIP switch has the setting: b4= b3 = 1, then, load A with number $55, load B with number $33, and do A-B; save the result to memory...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT