Write the following C statements in MIPS code. You can use MIPS editor to verify
ID: 640542 • Letter: W
Question
Write the following C statements in MIPS code. You can use MIPS editor to verify your implementation.
Note: You need to submit your source code on blackboard. Your source needs to have comments that
explain your implementation. You need to include the following set of comments at the top of your source
code for all assignments.
#Your Name and Id
#Assignment # (Example: Assignment #2)
Hint: You can use statements below to print an integer. You need to place the value to be printed in $a0
register before making system call function.
li $v0, 1 # service 1 is print integer
add $a0, $t0, $zero # load desired value($t0) into argument register $a0
syscall
C Code
void main (){
int> int a=5;
int b=10;
cout<<(a|b)<<endl;
cout<<(a&b)<<endl;
cout<<(a&one)<<endl;
cout<<(a^b)<<endl;
cout<<(~one)<<endl;
cout<<(~0)<<endl;
cout<<(a<<1)<<endl;
cout<<((b-(a<<1))==0)<<endl;
Explanation / Answer
reference....::
http://assembly.ynh.io/
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.