Did you know NASA just landed a 22-year-old Bondi Blue iMac on Mars? It’s true! It’s just tucked away under the hood of this incredible piece of engineering, the Perseverance Rover!

I assuming they scrapped the case to save on weight…
I'm not familiar with QtSpim, in fact I haven't coded in mips awhile. I'm a little taken aback that code written for one editor wouldn't work with another. Its not even like there are different dialects. Whatever works is fine. Its nice to know the different methods. – jason dancks Jan 4 '13 at 15:03. Here is the code to do a recursive factorial function in MIPS assembly. Changing it to do Fibonacci is left as an exercise to the reader. (Note: delay slots aren't optimized in this code, as it's designed for readability.). Streamlines multiple quality programs under the new Merit Based Incentive Payments System (MIPS) Gives bonus payments for participation in eligible alternative payment models (APMs) MACRA also required us to remove Social Security Numbers (SSNs) from all Medicare cards by April 2019.
Old G3 iMac Landed On Mars
Ok ok.. so NASA did not take an actual iMac G3 and stuff it into the Perseverence Rover, BUT, it has the same brain! The original 1998 Bondi Blue iMac the revolutionized computing was powered by a 233Mhz PowerPC 750 processor, capable of eye melting 525 MIPS!
MARS MIPS simulator is an assembly language editor, assembler, simulator & debugger for the MIPS processor, developed by Pete Sanderson and Kenneth Vollmar at Missouri State University (src). You get the MARS for free here. As for installing the 4.5 version, you might need the suitable Java SDK for your system from here.
And a current AMD Ryzen 9 3950X is capable of 749,070 MIPS.
That is 4,286% slower… surprising for a spacecraft that reached 39,000KPH on its way to the Red Planet.
Why would Perseverance Rover, the single most advanced planetary rover produced by humanity use such a crap processor?? So many reasons!
- Proven technology – has been on market for ages and known not to fail, no concern about bugs being discovered later!
- No need for speed – This rover is not running the latest copy of Cyberpunk 2077 out there.
- Simpler architecture – Fewer parts (10.4 million transistors compared to nearly 4 billion for the Ryzen)
- Power consumption – Fewer transistors and such means it uses less power, incredibly important for spacecraft – but nuclear-powered ones?
- Design time – This equipment has been on the drawing board for decades – this PowerPC 750 was amazing at the time!
- Radiation Hardening – Oh yea, this one is built like a TANK. It achieves radiation hardness of 1E-11 upsets/bit-day – those specs are beyond me.

So yea, though it’s been built specifically to survive dodging Klingons in the coldness of space, that is the same damn processor found in my 1998 iMac! Just much less affordable, $250,000 a pop would have impacted Apple sales significantly.
Ancient, Proven Technology Common In Space
Common sense would make us believe the latest in NASA engineering should be using Quantum Computers already, the latest bleeding-edge technology out of Skunkworks or DARPA, but no, it’s like the Enterprise is fighting the Borg with over-clocked Intel i9 processors in their computer cores. The biggest reason is simply that durability and fact they are proven to be reliable.
Photoshop budget has been blown on this post, we apologize for the poor quality of further silly graphics.
Though I’d sign up for it, it’s pretty difficult for NASA to send Geek Squad out to Mars to swap a processor if a critical flaw is found like the Intel Converged Security Management Engine (CSME). Finding something like that, later on, could prove absolutely fatal to such a complex mission. It’s much more beneficial to use something that is known transistor by transistor, something that is known to be incredibly stable, something you don’t have to worry about crapping the bed 220 million clicks away.
When you are going to have computer hardware travel through the harshness of space, suffer the incredible rough entry into a planetary atmosphere and survive in a radiation heavy environment like Mars, you want to be assured of your hardware. But, NASA is always prepared, there are two of those (well, three, one used for image analysis) processor modules onboard, one for backup.
NASA is such a fan of this processor package, they used it on board Curiosity, Fermi Space Telescope, Lunar Reconnaissance Orbiter, Deep Impact spacecraft, and the Kepler telescope, and I’m sure it will be used again.
We may kid about the weaksauce Perseverance has for brains, but the truth is this thing screams compared to the other Mars rovers; Pathfinder and the Spirit/Opportunity twins had a 20Mhz processor with 128MB of RAM. Both of these left Sojourner in the martian dust, it clocked at 2Mhz!
Perseverance Rover is not the first Mac on Mars either! When I was in High School, I was excited to see the first PowerPC Macs come into the lab in ’94, a beautiful pizza box-shaped Power Mac 6100! Little did I know that 10 years later I would see two of them trundling around the surface of Mars!
Anything to say about this article? Contact us!
- 2021 iMac – Aluminum Is The New Beige - May 5, 2021
- iOS 14.5 – The Pandemic Update A Year Late - April 26, 2021
- Apple AirTags – Soon To Be The Most Prolific Apple Product - April 24, 2021
Facebook Comments
Goals
This lab will give you practice running and debugging assembly programs using the MARS simulator, as well as writing MIPS functions.
Setup
Copy the lab files with
Intro to Assembly and MARS
The following exercises use a MIPS simulator called MARS, which provides a rich debugging GUI. You can run MARS on your home computer by downloading the jar file from the Internet or by copying it from ~cs61c/bin/Mars4_5.jar on the instructional machines. You will need Java J2SE 1.5.0 (or later) SDK installed on your computer, which can be obtained from Sun. If your home computer is a Mac, you can also follow the instructions here to install MARS as an app in one step (thanks to Sagar, a former TA).
You can run MARS in lab by typing 'mars &' at the command line.The ampersand is optional but will allow you to continue using that terminal window (on the Macs however, you'll need to run it in it's own terminal tab by pressing command-t first).To run the program remotely, you may either run via an instructional server (but NOT one of the Orchard machines), or through a local installation (recommended).When on an instructional server, you will need to be running an X-Server (like XMing), and enabling X11 tunneling.
Mars Mips Compiler
Tip: Although it is possible, you should avoid running MARS remotely at all costs - it will be painfully slow to use and will overwhelm the servers if many students attempt to do so.It is in your best interest to setup/run a local copy of MARS. I know several students will try anyways, but consider this your warning.
Assembly Basics:
- Assembly programs go in text files with a .s extention.
- Programs must contain a label 'main:' (similar to the main() function in C programs).
- Programs must end with an 'addi $v0,$0,10' followed by a 'syscall'. main() is special and must transfer control back to the operating system when it is done rather than just returning.
- Labels end with a colon (:).
- Comments start with a pound sign (#).
- You CANNOT put more than one instruction per line.
Exercises
Exercise 1: Familiarizing yourself with MARS
Getting started:
Mars Mips Array
- Run MARS.
- Load lab3_ex1.s using File-->Open.
- View and edit your code in the 'Edit' tab. Notice the code highlighting and 'completion suggestion' features.
- When ready, assemble your code using Run-->Assemble (or press F3).
- This will take you automatically to the 'Execute' tab, which is where you can run and debug your program.
- Step through the program using Run-->Step (or press F7).
- You should take the time to familiarize yourself with everything in the Run menu (and the keyboard shortcuts).
For this exercise, we calculate the Fibonacci numbers using fib[0] = 0; fib[1] = 1; fib[n] = fib[n-1] + fib[n-2].
Follow the steps below and record your answers to the questions. The Help menu (F1) may come in handy.
- What do the .data, .word, .text directives mean (i.e. what do you use them for)?
- How do you set a breakpoint in MARS? Set a breakpoint on line 14 and run to it. What is the instruction address? Has line 14 executed yet?
- Once at a breakpoint, how do you continue to execute your code? How do you step through your code? Run the code to completion.
- Find the 'Run I/O' window. What number did the program output? If 0 is the 0th fib number, which fib number is this?
- At what address is n stored in memory? Try finding this by (1) looking at the Data Segment and (2) looking at the machine code (Code column in the Text Segment).
- Without using the 'Edit' tab, have the program calculate the 13th fib number (0-indexed) by manually modifying this memory location before execution. You may find it helpful to uncheck the 'Hexadecimal Values' box at the bottom of the Data Segment.
- How do you view and modify the contents of a register? Reset the simulation (Run-->Reset or F12) and now calculate the 13th fib number by (1) breaking at a well-chosen spot, (2) modifying a single register, and then (3) unsetting the breakpoint.
- Lines 19 and 21 use the syscall instruction. What is it and how do you use it? (Hint: look in Help)
Checkoff
- Show your TA that you are able to run through the above steps and provide answers to the questions.
Exercise 2: Compiling from C to MIPS
For this exercise we need to use a program called mips-gcc (a cross-compiler for MIPS) that allows us to compile programs for the MIPS architecture on our x86 machines. If you are doing this lab remotely, you should SSH into one of the hive machines.
Compile The file lab3_ex2.c into MIPS code using the command:
The -O2 option (capital letter 'O' and 2) turns on a level of optimization.The -S option generates assembly code.Don't worry about the delayed branch option for now; we will revisit this topic again when we talk about pipelining.The above command should generate assembly language output for the C code.Please note that you will NOT be able to run this code through MARS.
Find the assembly code for the loop that copies sources values to destination values.Then find where the source and dest pointers you see in lab3_ex2.c are originally stored in the assembly file.Finally, explain how these pointers are manipulated through the loop.
Checkoff
- Find the section of code in lab3_ex2.s that corresponds to the copying loop and explain how each line is used in manipulating the pointer.
Exercise 3
This exercise uses the file listmanips.s.
We might have left Python behind with CS61A, but we definitely want to bring our friends map and reduce along with us! In this exercise, you will complete an implementation of map in MIPS. Our function will be simplified to mutate the list in-place, rather than creating and returning a new list with the modified values.Our map procedure will take two parameters; the first parameter will be the address of the head node of a singly-linked list whose values are 32-bit integers. So, in C, the structure would be defined as:
Our second parameter will be the address of a function that takes one int as an argument and returns an int. We'll use jalr
(see below) to call this function on the list node values.
Our map
function will recursively go down the list, applying the function to each value of the list nodes, storing the value returned in that node. In C, this would be something like this:
If you haven't seen the int (*f)(int)
kind of declaration before, don't worry too much about it. Basically it means that f
is a pointer to a function, which in C is used exactly like any other function.
You'll need to use an instruction you might not have learned before to implement this: jalr
. jalr
is to jr
as jal
is to j
. It jumps to the address in the given register and stores the address of the next instruction (i.e., PC+4
) in $ra
. So, if I didn't want to use jal
, I could use jalr
to call a function like this:
There are 7 places (6 in map
and 1 in main
) in the provided code where it says 'YOUR_INSTRUCTION_HERE'. Replace these with instructions that perform as indicated in the comments to finish the implementation of map
, and to provide a sample call to map
with square
as the function argument. When you've filled in these instructions, running the code should provide you with the following output:
Checkoff
- Show your TA your test run.
Exercise 4
Add the prologue and epilogue to the code in nchoosek.sso that it computes 'n choose k'. the number of combinations of n distinct elementstaken k at a time. This can be computed through factorials, however we will be computing this through finding the (n,k) entry in Pascal's triangle.
Checkoff
Mars Mips Assembler And Runtime Simulator
- Show your TA your code and its test run.