#include<stdio.h>#include<math.h>void hanoi(int x, char from,char to,char aux){if(x==1){printf("Move Disk From %c to %c\n",from,to);}else{hanoi(x-1,from,aux,to);printf("Move Disk From %c to %c\n",from,to);hanoi(x-1,aux,to,from);}}int main(){ int disk; int moves; printf("Enter the number of disks you want to play with:"); scanf("%d",&disk); moves=pow(2,disk)-1; printf("\nThe No of moves required is=%d \n",moves); hanoi(disk,'A','C','B');return 0; }
I have no idea how to set up the cross compiler for MIPS...I've been trying for several hours now with no luck. Any chance you could just help me manually convert it unless you know how to get this cross compiler set up?
Well I'm in the process of trying to install a cross compiler but in the mean time any links/information on possibly converting each line to MIPs by hand?
That's just a matter of writing the code in MIPS assembly from scratch (following the same outline as in the C code). How good are you with MIPS assembly ?
jralexander137
ASKER
Not good at all to be honest....I have little to no idea on even where to begin. I do know how to read MIPs relatively well but writing based on C code I have pretty much no idea.
jralexander137
ASKER
If you know of any websites or something that would help me that would be great.
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.