Berkeley CS 61C Lecture 6

Here are some notes and corrections on this lecture:

Each note begins with a time; "ca." in front of a time means that it is approximate.

ca. 4:00 -- There is a one-to-one correspondence between assembly-language instructions and machine instructions. This is very unlike high-level languages such as python, java, and C.

ca. 5:20 -- He mentions the "fetch-execute loop", which is more commonly known as the "fetch-execute cycle". I found a video on YouTube that addresses this and isn't terrible:

9:20 ff -- Translation of ifs and loops into assembly-language: KNOW THIS It's what compilers do for a living.

ca. 16:00 -- Note carefully the "j Exit" instruction right before the "else". This keeps the computer from executing BOTH parts of the if/else statement. Of course you know that it is NEVER right for that to happen. I'm leaning on this because people leave that out on the final exam, and I gleefully mark it wrong. This is after they've been in this class for a whole semester.

ca. 22:00 -- the example he's doing here with a slt followed by a bne is the expansion of the fake blt instruction. We haven't talked about branches yet. One of the problems with this course is that there are about 4 million things we have to talk about the first week.

36:00 -- I want to do this in class

ca. 49:00 -- Here he is showing the expansion of the fake instruction "move".

ca. 1.04:00 ff -- I don't know why he is saving $t0. That's the difference between the $tx registers and the $sx registers: you have to save the $sx registers before using them and restore them afterwards. Not so with the $tx registers.