So now that we've seen a program, we can look at how people actually used to operate such machines beginning at the computing. So this is what the front of the machine looked like, and again this is our imaginary machine. It doesn't look that different than a real computer and might be hard to believe. But this is the complete user interface of a lot of early machines. We've got switches, we've got lights and we've got a few control buttons and they're labeled with pretty much what they do. So first thing that we have to do to use the machine is turn it on, and sometimes that would be just plugging it in or sometimes there was a key. But for Toy you just press the on off button and then it lights up to say that it's on and that's the only way you'd know that. And then what you need to do next is load your program into memory. So this is the little program that we just did that adds to numbers. And by the way this was before post-its even existed but we'll pretend that there's a post-it that's got the program. It would be a small scrap of paper with scotch tape on it actually. So to load an instruction then what you need to do is there's a set of eight switches labeled address, and a set of 16 switches labeled data. So you have to set the address in binary. So that's flicking up that switch, so that represents 1 0 and helpfully the light lights up. And then we have to put the data switches to set what the instruction and coding is. So the first one is eight, that's 1 0 0, next one is A, that's 1 0 1 0. You might think of A as 10 in binary, then 1 0 1 0. Maybe do the conversion of binary first one digit at a time you get to do this pretty quickly after a while. Next digit is one, next digit is 5 0 1 0 1. Flip up those bits. So now we forgot the switches set to the instruction and we've got the address that we want to put that instruction in, so now we hit the load button, and that'll load the instruction from the switches into the address memory word, and after it loads the light goes off. So there we go, we've got one instruction in the machine, and then flick the switches down. Good practice to flick them all down. And you could do that by running your hand across them, and that's why those go off quickly. And let's go to then the next instruction, and the next instruction we do it all over again. I load the address, in this case it's 1 1, key in the instruction. It's eight and then b 1 0 1 1. And then a one and then six. So now we've got that instruction encoded and we can press the load button, and now we have the second instruction. Flip the switches down, do the third one. Third one is location 12 1 0 0 1 0 0 1 0. Right now, you can see why you want to be working in hex, if you're trying to do all this in binary, it would get even more confusing. Now do the data switches to do the instruction encoding, and you can also see how quickly you can convert from hex to binary so C is 1 1 0 0, A is 1 0 1 0 and B is 1 0 1 1. Now that instruction is encoded in the switches and its address is there. So we press the load button and load it in and then flip the switches down into the next one. This is the store instruction, and it's in location 13 and then 9 C which is 1 1 0 0 1 and 7 0 0 0 1 1. Now that's encoded and we press load and flick the switch is down. And then go to load up the halt instruction, and the halt instruction is easy. That's it. Location 14. The data is 0 0 0 0 0. So we're done with that, and then we just press load and it's all loaded. So at that point we have our program loaded into the Toy memory. We have to kind of trust that it's in there, but there is a button that helps us at least double check that we got our program right, and that's the look button. So if you want to double check that you loaded your program properly and didn't have a bug like putting the wrong hex digits somewhere what you can do is set your memory switches again, so 1 0 and now when you press the look button it'll tell you what is low, what is in that memory location. Just press the button and then in the lights it'll tell you the contents of that memory location. In this case that's what we wanted, 8A1 5. And typically if you're a cautious programmer you'd go through and double check that every memory location has the right instruction and consequences of a bug are a little harder to deal with in a program like this than in a java program on your laptop. So now we've got our program in. And then what do we do next? Well, we want to load data in. Well how do we load data in? Exactly the same process. No distinction between data and instructions. So we load our address in, 15, our data is 8 0 0 0 8. I hit the load button and it's loaded. And then we have one more data thing and that's in location 16. So that's 0 1 1 0 0 binary six, and then set the data switches to five and then press our load button. And now we're set to go. We forgot our program and our data loaded into the memory. Now we want to run a program. So what we do is that to run a program, set the address switches to the address of the first instruction. In this case it's 1 0, and press one, run. And what does run do? It just starts that fetch, increment execute cycle. When you press run, the program starts running. Now the data lights might flash some times. But what's going to happen is after a while the run light goes off. Maybe you noticed it went off. Goes off when the hault instruction is reached and that's the only clue that you have that your program executed, is the red light goes off. So then how do you figure out what it did. Well, we have the look button to see the output. What we're going to do is set the address switches to the address of the expected result in the memory. In this case it's 17. Notice we don't have any way to look at the registers there temporary we just have ways to look at the memory. So we look at 17 and hit the look button and it tells us our result, D. If we want to run the program again and enter different data we can do that, enter different data and press run again and write down those the answers on those post-its that are in a piece of paper. That would be the way that we would enter and run a program in an old machine like PDP-8, that we're representing with our imaginary machine Toy. Nowadays, I think many people find it unbelievable that people programmed in this way. Did people really program in this way? I'd have to say yes, absolutely. In fact there's a guy programming a PDB-8. People used to program in white shirt and ties too. And I have to say I spent three years of my life programming in this way. We'll talk in more detail about this process later on.