473,505 Members | 13,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need Help Translating C++ to MIPS

8 New Member
I'm taking a MIPS class, and our first project is to prompt the user to input 8 numbers (using a for loop & an array), and output the minimum and maximum numbers of the array.

I wrote the program in C++ (works perfectly), and I've been trying to translate it, but the online tutorials aren't very good. So here's one thing I find difficult to translate:
Expand|Select|Wrap|Line Numbers
  1. int array[8]={0};
  2. for (int i=0; i<8; i++)
  3. {
  4.      cout << "Input number " << i+1 << ": ";
  5.      cin >> array[i];
  6. }
  7.  
Then after that, how would I sort the array, or simply display the max and min values?
In my C++ code, I used a bubble sort, but MIPS is too confusing for me, and it seems like bubble sorting is overly complex in MIPS.

Thanks in advance!
Oct 28 '07 #1
4 4031
JosAH
11,448 Recognized Expert MVP
Have you tried the compiler's -S option? It generates human readable assembly
code then. Handy to have when you have to deal with MIPS code.

kind regards,

Jos
Oct 28 '07 #2
angel120
8 New Member
Which program are you speaking of? I write my C++ programs in Visual Studios .NET 2003.
Oct 28 '07 #3
JosAH
11,448 Recognized Expert MVP
Which program are you speaking of? I write my C++ programs in Visual Studios .NET 2003.
I was talking about the gnu GCC (Gnu Compiler Suite), much better than all that
Intel centric Microsoft stuff.

kind regards,

Jos
Oct 28 '07 #4
angel120
8 New Member
Ok, I can't figure out for the life of me how to get GCC running.. Is there anyone that can help me w/ the MIPS problem?
Oct 28 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1884
by: gb | last post by:
Hi, I have a small program which opens a file (Whose content is a mac address in the form xx:xx:xx:xx:xx:xx) and uses fscanf() to get individual bytes into an array which is defined as "unsigned...
126
4195
by: ramyach | last post by:
Hi friends, I need to write a parallel code in 'C' on the server that is running SGI Irix 6.5. This server supports MIPS Pro C compiler. I don't have any idea of parallel C languages. I looked...
4
5864
by: nickpreiser | last post by:
Hi Everyone, I trying to get a build of Python together to run on an Embedded Linux / Mips machine. I run the ./configure --host= XXXmips(my mips proc) --build=XXX x86(my pc). and the...
1
3303
by: shell6 | last post by:
Ok, so I want to generate MIPS ASM from C/C++ code. I tried using binutils through cygwin but that just plain doesn't work. Microsoft Visual C++ is refusing to do it... Does anybody have a free...
1
6140
by: sekhar_ps | last post by:
whats the difference between mips and mcps
2
3504
by: Lorenzo Mainardi | last post by:
Hi everybody, I bought a very small embedded card, with a MIPS processor, running Linux. So, I would to use Python on that; I checked on python.org, but I did'nt find any release for this...
6
6285
by: waxinwaxout | last post by:
I'm compiling the same set of c++ sources to both x86 (32 & 64) and to mips32. For x86 I'm using gcc 4.1.2 and for mips I'm using gcc 3.4.6. What I don't understand is why the mips binaries are...
1
2689
by: jty0734 | last post by:
if you have mips cross compiler, please convert this c code to mips code. i'm try to install mips compiler 3 days, but some error fail to that. so if you have something cross compiler c code...
4
12988
mia023
by: mia023 | last post by:
if i have the following MIPS code: sll $t1,$s3,2 add $t1,$t1,$s6 lw $t0,0($t1) bne $t0,$s5,Exit Loop: addi $s3,$s3,1 add $t1,$t1,4 lw $t0,0($t1) beq $t0,$s5,Loop
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.