tags:

views:

675

answers:

8

My question: Is the mips programming language that benificial to know?

I'm a CS student and am taking a assembly class which focuses on Mips. I'm very comfortable writing in high level languages, but Mips has me a little bit down.

Is Mips something that I should really focus on and try to completely grasp it? Will it help me in the future?

+3  A: 

I took on a assembly class doing mips about two years ago. I found myself writing GameBoy Advance games in a mips-like asm language. Can't say I enjoyed it.

Though I think it is good to have an understanding about the inner workings of assembled code (from high level to low level). I feel it made me understand more about how the computer actually works. Also, I couldn't resist making a few virtual machines shortly after, designing my own assembly language :)

Statement
A: 

Mips is a very simplified assembly language.

You will probably never use it.

Don't get down if you are having issues understanding it. I would not classify it as core to being a computer scientist.

It is worth learning because it will teach you the basics of how a processor goes about interpreting code.

John Mulder
+8  A: 

At one point (in the 90s) MIPS-derived processors were the best selling processors in the world, dwarfing sales of Intel x86 processors. This was because of their huge presence in the embedded market. I think now ARM-based processors may have taken over that title, but there are still tons of embedded systems out there using MIPS.

Even if you never program a MIPS chip in assembler in your career, assembly language can be useful to learn. It can help you write more efficient high level code if you have some idea of what the compiler is going to emit. Other areas where it is still used include compilers (writing your own), device drivers, and multimedia programming (where code requiring MMX or SSE is usually still written by hand in assembler).

Each CPU type has a different instruction set but there's enough commonality that once you learn one dialect of assembly (MIPS in your case) the others should be easy to pick up.

sk
+2  A: 

It is helpful to understand the very low levels of the computer. For example there are developers who will say the CPU executes some sort of "new object" instruction. There is of course no such instruction, management of objects happens several layers of abstraction higher. It is good to understand the distinction, so you can understand why object creation might be expensive (or not) or why protected addresses spaces can make the system more robust.

When I was in school, the assembly course was taught on the IBM mainframe using the System/360 instruction set. I have never, at any point in my career, come anywhere near working on such a machine, but the knowledge of what the CPU looks like has been valuable.

Nowadays I work on embedded systems using MIPS processors. I actually spend a reasonable amount of time poring over MIPS assembly listings, and write some MIPS assembly for the boot vectors and synchronization primitives. Yet even if you never actually write anything in assembly, understanding CPU operation is still valuable.

DGentry
+2  A: 

By "mips programming language" I assume you mean MIPS Assembly Language.

Learning an assembly language is beneficial to know, it helps you map the code you write to how it will run on the hardware. This can help expose you to more low level concerns like cache misses, branching, out-of-order execution, and other things you wouldn't think about writing high level code.

Weather learning MIPS assembly is useful to you depends on what career you plan to follow. Personally I think x86/x64 (popular in PCs, directly applicable if you write C++ or C# on PC), PPC (gaining popularity, used in game consoles, and also exposes you to RISC) or ARM (used in a lot of embedded devices such as mobile phones) might be better choices to learn.

redwyre
A: 

Mips appear to be coming back in embedded systems. @[sk] has given a better summary than me, but I have a recent example :

Broadcom appear to make Wifi cards these days with either MIPS or ARM chips on them ( I'm not sure which tho, documentation says one, firmware says the other ). However, on thier newer chips we're still awaiting on working linux support with all features enabled, so for that reason, I'm glad you're learning. ( Now get and write me some drivers :P )

Kent Fredric
A: 

Assembly language is always worth learning. You probably aren't being taught or seeing how the compiler turns high-level language code to assembly code, but I'd say that knowledge is the most important benefit of knowing assembly language. It's sobering how inefficient many compilers are even on the highest optimization level. (Most compilers will dump assembly code for you on request, instead of going on to machine code and linking.)

That said, MIPS asm is probably useless, because almost nobody uses MIPS now. (SGI used to, but now their machines are all on x86/IA-64 chips.) If you find assembly language appealing and want to work in assembly further, learn the ARM instruction set. ARM is only a little more complex than MIPS, and virtually all mobile phones, smart phones, and PDAs now use ARM chips (made by dozens of manufacturers). The iPod uses ARM, as does (I think) the Zune.

crosstalk
+1  A: 

MIPS is a great language to learn assembly with. You have plenty of general purpose registers to make writing your programs less tedious and it is a RISC architecture so there are less instructions you need to memorize.

Some of the mainstream usage that not a lot of people mention is that the N64, Playstation 1, Playstation 2 and PSP all used MIPS processors.

Simucal
I'm pretty sure the N64 also had a MIPS processor.
Ibrahim