‫Welcome, guys.
‫So we're now going to discuss what registers are saying to show how to do that.
‫Now, what I want you to do is I want to open up Muladi 86 again, and we're just going to go move page
‫30.
‫That's all I want you to do.
‫I want you to press emulate.
‫And now, rather than press run, less press single step, which will run one instruction a time, by
‫the way, so we press in a step once and now I want you to look over to the left by here and you'll
‫see registers, you should see SBX decks and so on.
‫These are your registers in the process.
‫Now, as I've already said, registers a tiny memory regions' inside the processor itself.
‫They can usually only store a few bytes and there's a limited number of them.
‫In other words, just to clarify, this is not a variable.
‫There's no variables in assembly.
‫If I was if I was to try and invent my own, such as AI or something like that, that's not going to
‫work.
‫When we go move a page, we are saying move 30, move decimal 30 into the register.
‫And there's a limited number of registers that displayed here on the left.
‫So what I'm going to do, I'm going to just press emulate again now that I showed you that and going
‫to press single step ones.
‫Look to the left here at our registers, we see the apex register, right?
‫You see Hage and L.
‫Now, what is now this just means high and low.
‫The high by unallowed by essentially the H and L registers help build the X register.
‫So essentially when you when you talk with a Hajjaj you're talking with the high the height of X register.
‫When you talk with a L, you're talking with the low bytes of the X register.
‫So looking back here, then you can see that the AI, the X register is only two bytes, only two bytes.
‫Now when we do a URL, we access the low bite of the X register.
‫That's why the L stands for when we do a Hajaj, we access the high bytes of the X register.
‫That's what the hate stands for.
‫Now, X is a register in itself.
‫So if I was to go move X zero x, f, f, f and press emulate.
‫Now if you press a single step so it runs move and 30, it'll move decimal 30 into the Al register.
‫And by the way, in case you didn't notice, these bytes are shown here is hexadecimal, which is why
‫we see one E and not 30.
‫Now if I press a single step again, you'll notice both H and Al have changed F F because X is what
‫holds a shanelle, right?
‫So if we assign X to something, it overrides both the H and Al with the value.
‫If we only assign a H, it'll only affect the high of the X register.
‫So just to clarify, here we move decimal 30 to Al here we move hexadecimal F F and that that the hexadecimal
‫numbers represented by zero X at the stop by here.
‫Right.
‫If this wasn't here it wouldn't compile, it would have to be a decimal number right now.
‫Let's enter here less to move H and we're going to go see X 30.
‫Right.
‫So another hexadecimal, no press emulate press single step.
‫We see Thirty's move to the L Register, which is the low bytes of the X register.
‫Right now, thirty is represented by one hexadecimal press single step again.
‫We can see both A.H. and AOH overwritten with F and 5th and that's because we assign the full register
‫X because remember X holds a huge Aneel by moving a hexadecimal vote X overwrites both H and I because
‫a make up X hope that makes sense.
‫Remember LNH Lobi High right now if you press a single step again you'll see that our logo is still
‫F, but our high has changed to Hex Thirty.
‫And the reason for that because here on line eleven we change the H register to zero x thirty hexadecimal
‫thirty.
‫Right that the low byte stays the same because we haven't changed it.
‫Likewise if you change this to al impress emulate.
‫Single step again, single step again.
‫Now we're back to our fifth press, single step, one small.
‫Now, in this case, the high bite is still NSFW because we we set the X registered F F F on line 10
‫here.
‫But because we single step here on line 11, we changed, I already said to zero x thirty, which changes
‫the low bite of the X register to Hex 30.
‫But the high bite is not changed, which is why it is still F.
‫So that's kind of how the register system works on the eight six processor.
‫So you have a lot of other registers you can work with as well.
‫And by the way, each of these registers is used in different instructions, so certain instructions
‫will rely on different registers.
‫So for example, the load SB instruction, let me just type that out so you can see a lot.
‫Espie, this here, if you remember correctly, it loaded a bytes from our from our hello message.
‫Right.
‫And then it's stored in L so lot s.b uses the X register.
‫Right.
‫Because when we do load S.P., it loads the byte from wherever the S.I register is pointing to.
‫It loads that bytes into the low byte of the register.
‫So that's important to note that we use different registers for different things.
‫For example, the SCIEX register is mainly used with counting operations, but we can get into more
‫about that later on.
‫I just wanted to get a grip on how the registers work first.
‫So we've worked with the X Register.
‫Let's work with the X register.
‫So I want you to do a movie B, X, so you XRF, Z, FF, so forth.
‫Right.
‫So while this does it moves the hexadecimal value ff into the B register.
‫So if we emulate that now press single step, you can see the box registers high byte is now F and the
‫box is low bite's is now F.
‫Likewise if you just like when you use move move you can do B.L. or Behati.
‫So if we do move B, C you study and you emulate that first single step, a single step, we can now
‫see that the high by the box register has become thirty.
‫If we did better than the Lobi would become thirty thirty hex, by the way, guys.
‫And likewise you can do SCIEX, S.H. and s.L X, d.H and DL.
‫So that is how all that works.
‫So you'll also notice a lot of these other registers down here.
‫Now these these are special registers because they don't work in the same general-purpose way as, as
‫I expected X do.
‫Now you don't need to worry too much about these yet because we need to cover them later on, because
‫I need to teach you a few things before you can understand them.
‫But I'll go over it briefly.
‫You'll remember I talked about the programming counter and one of our lectures, the program counter.
‫Sorry.
‫While that in the 086 is represented by the IP register, the IP register contains the value of the
‫current address.
‫You're executing a memory, so the process uses the IP register to know which instruction to load from
‫RAM.
‫Now you'll also notice D.
‫S and SS.
‫And so these are segmentation registers, segment registers.
‫We can discuss those more later on.
‫It's basically allows you to offset in the eight eight six, you can only access up to one megabyte
‫of memory.
‫But obviously our registers, you know, they're only sixteen bits, white, two bytes, so they can't
‫address the full megabyte.
‫So we use something called segmentation to access the full one megabyte.
‫And we make use of these segment registers here to do that.
‫But more will be discussed on that later.
‫Espie is is our stack pointer again.
‫You need to learn what the stack is before I can teach you that.
‫So that covers registers.
‫I hope that makes more sense.
‫We'll definitely discuss more about the special registers here later on.
‫So thanks for watching.