Assembly was written as the first language above binary to make it easier for humans to write functional programs. As such, there is almost a line for line equivalency between the two codes.

When we first translated the simple square() method to Assembly in Exercise 3, our two lines of Python code expanded into 16 lines of Assembly. The code editor has the Python and the translated Assembly in the window to the right.

When the Assembler translates the Assembly code into machine code, each line will create a 32-bit MIPS instruction in accordance with the standards of the ISA.

The Assembly ADD function and the binary ADD function are structured the same way in the documentation in order to give developers better control over their programs.


Check out the official MIPS32 Documentation and take a look at some of the Assembly statements. Come up with the binary output you would expect to see.

When you are finished, hit Run and see the binary output of the square() function and see how you did.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?