Software tools needed: web browser and a graphical editor, such as gEdit.
References:

In today's lab, we will explore a programming language that is very "low level" in that it maps very closely to the actual commands that are used by the computer's processor. To gain intuition on some of the underlying fundamental concepts, we will start with a simple implementation that has only 11 basic commands (that the developers describe as following the Harvard Architecture with a single accumulator).
To get started:
Open the program, choose your avatar, and proceed to the first level.

Work through the first six levels:
inbox and outbox which picks up an item from the inbox and places an item on the outbox, respectively. These are similar to our input() and print() functions in Python.jump which allows you to repeat blocks of code or "loop." copyfrom command that allows you to pick up values from the floor (aka "the registers" or places you can store values you would like to use in your computation).copyto is introduced. It allows you to place values on marked regions of the floor (e.g. place values in specific registers).add. It's a very limited version of addition in that you can only add something on the floor (in a register) to what you're holding, and the result replaces what you're holding. While limited, it echos the restrictions that you find in most machine languages.The first 6 years introduced 6 commands (out of the 11 total in Human Resource Machine) that allow you to input, output, jump to other parts of your program, store and retrieve values, and perform a limited addition. In Section 3, we will see the corresponding commands in the MIPS machine language.

We're only doing the main branch of the program, but if you're interested your are welcome to do the optional years (such as 8, 10, and 12).
jump if zero that allows us to only jump, or branch, if what we're holding is 0. sub. It's a very limited version of subtraction, echoing the restricted version of addition. But while limited, it also echos the restrictions that you find in most machine languages. jump if negative to make it a bit easier to compare items. The goal of this part of the lab is to build up understanding of branching (e.g. the different types of jump commands) and the use of registers (the values stored on the floor). We are only doing these challenges for the lab today, but you can keep working through Human Resource Machine if you're intested!
We will use an emulator, WeMIPS, to emulate what a machine-level language would do for a popular class of computer processors, MIPS. Processors with MIPS are a Reduced Instructor Set Computer (RISC), meaning they have fewer different types of instructions that the processor knows (and thus fewer that have to be implemented, leading to faster processors).
Let's start by looking at a program that will print "Hello World":
If you would like to follow along, using the emulator (click on this link to open in a new tab or use inline below), toggle the "Show/Hide Demos" button and then click on the "Hello World" demo:
Just as we did with PythonTutor, we can "step" or go through the code line-by-line to see what it does:
Try changing the program in the WeMIPS window to print out "Hello!!!". Once it does, copy the program into a text window:
#Name: YOUR NAME HERE
#Email: YOUR EMAIL HERE
#My first MIPS program that prints: Hello!!!
... put your machine language program here ....
and see the homework List.
To create loops in our machine language, we use two additional instructions:
#Sample program that loops from 10 down to 0
ADDI $s0, $zero, 10 #set s0 to 10
ADDI $s1, $zero, 1 #use to decrement counter, $s0
AGAIN: SUB $s0, $s0, $s1
BEQ $s0, $zero, DONE
J AGAIN
DONE: #To break out of the loop
Here's a translation of the code into pseudocode:
This program counts down from 10 to 0. How could you modify it to count from 1 to 10? When you have it running, see the homework page.
(Hint: store the value 10 in a register to use in the comparison)
As a final machine language challenge, modify the "Interactive" demo (the first lines are in the image above) to use the current year when computing the ages:

Click on "Show/Hide Demos" and then click on "Interactive:
We're going to use just a few commands that move values into registers (physical memory locations), do simple arithmetic, and jump (or branch) to another part of our program. There are many commands that can be used in the full MIPS machine language. We are working with only a few of them:
ADD, ADDI, ADDIU, BEQ, J, SB, SUB, SUBU, syscall
As such, the grading script only recognizes the commands above and the '#' style comments. Anything else will confuse it greatly.
The general format for simplified machine language programs is:
#Name: YOUR NAME HERE
#Email: YOUR EMAIL HERE
... Put your code goes here...
To submit your program for grading:
In Lab 6, we introduced making short programs, or scripts, of Unix commands. In this lab, we introduce a very useful construct to let you glue together simple commands to perform more complex actions.
The command '|' is called a pipe since it takes the data flowing out of a command and directs it to flow into the next command, much like a pipe directing the flow of water.
For example, if you type:
ls -l
at the prompt, you will see the 'long' listing for every file in your current directory. (Note that it's the letter "L", not the number "1" that it looks like on some browsers). For example, if I ran this command in my directory for Program 44, I get:
showing 7 files, 6 of which were created in October. Names with '/' after them are directories or folders. '*' indicates files that can be executed (see Lab 6 for how to change the permissions of a file).
Let's use a pipe to count the number of files from October. First, we need to take the output from ls and direct it into a program that can find patterns. A popular one on Unix is called grep (it searches for patterns, which are also called regular expressions or 're'-- the name comes from global search for regular expressions program). Let's have it look for 'Oct':
ls -l | grep "Oct"
Note that between the ls -l and the grep "Oct" is a pipe ('|') that directs the outflow from the ls command to the inflow of the grep command:
We can use the pipe to take the output of the grep command and send it to a program that counts the number of lines. This program, wc, counts characters (option -m), words (option -w), and lines (option -l). We'll use the -l option to count lines:
ls -l | grep "Oct" | wc -l
which gives:
the number of files in the directory that were last modified.
How could you make a script that counted the number of .py files in the directory?
When you have the answer, put the single line into a script. Remember to use Unix end-of-lines, since gradescope will run what you submit as a Unix script and will be very confused if you have non-Unix (i.e. Windows-style) end-of-lines. See homework.
You can start working on this week's programming assignments. The homework page has problem descriptions, suggested reading, and due dates next to each problem. You should aim to finish the programs in the next week, although the deadlines are several weeks out, to give a buffer just in case.