What instruction moves a value from an integer register to a floating-point register and converts it?
fcvt.w.s
Given the following C++ code:
1
2
3
4
5
int main() {
float *ptr = (float *)70;
float value = ptr[13];
}
What memory address is dereferenced with the code ptr[13] if the pointer ptr points to the memory location 70?
122
Given the assembly code below:
??? fa0, 0(sp)
Write the instruction ??? to store the double-precision value in fa0 to the memory address *(sp + 0):
fsd
Given the following code:
.text
main:
flw fa0, 11(sp)
What memory address would be loaded from given the instruction above if the stack pointer is pointing to the value 461?
472
What instruction multiplies two double-precision values?
fmul.d
Like x0, writes to f0 are discarded and the value of f0 is always 0.0.
False
Given the following prototype:
1
double MyFunc(float a, double b, int c, int *d, float *e);
write the registers that get the parameters a through e and the return register.
fa0 MyFunc(fa0, fa1, a0, a1, a2)
Given the following code:
.text
main:
??? t0, fa0, fa1
What instruction will put 1 into t0 if the single-precision value in fa0 is GREATER THAN the single-precision value in fa1?
fgt.s
The instruction “call home” is an alias for which of the following real instructions?
jal ra, home
Given the following C++ code:
1
2
3
4
5
int main() {
double *ptr = (double *)77;
double value = ptr[14];
}
What memory address is dereferenced with the code ptr[14] if the pointer ptr points to the memory location 77?
189
The stack pointer must contain a value that is aligned to what value?
16
The instruction fmv.s.x moves a value from an integer register into a single-precision floating point register and does not convert it.
Given the following code:
.text
main:
fld fa0, 3(sp)
What memory address would be loaded from given the instruction above if the stack pointer is pointing to the value 251?
254
Single-precision floating point instructions end with which of the following suffixes?
Example: fgt.?
.s
Given the following assembly code:
.data
mystuff: .word 100
.text
main:
??? t0, mystuff
What would you write in ??? to put the memory address of the label mystuff into the register t0?
la