‫Hello and welcome.
‫And in this lecture, we are going to create our very own interrupt by changing the interim vector table.
‫So the first thing we're going to do is make our interrupt.
‫So just to handle Z undisclosed zero here, and this will be responsible for handling Interop zero.
‫And we're just going to go move H.
‫Zoë H.
‫Movil A.
‫Movie zero zero in it zero 10 and then down here, we're going to go IRAT, which means return from
‫interrupt.
‫So as you do with a normal subroutine, you do right here we do IREX.
‫So what we're going to do is we're going to make it so when someone does in it zero, it will.
‫Koula handle zero routine, print the character A to the screen and then return.
‫That's all they will do.
‫So, yeah, we now need to change the interim vector table, as explained in the previous lecture.
‫OK, so we know based on our on the previous lecture that Interest Zero starts at address zero zero
‫zero in RAM or the very first by the memory.
‫Right.
‫So the first two bites of RAM are the offset for Interop zero.
‫The next two bytes are the segment for interest zero.
‫So we're just going to go move word assess zero zero zero.
‫I'll explain that in a minute and then we're going to go handle zero.
‫And before I go any further than we do here to specify, we want to use the stack segment.
‫If we don't do assess it, we'll use the data segment, which is currently pointing at zero seven zero
‫zero, which is a problem.
‫Right, because we want to point to the very first Bigram.
‫Right.
‫If you don't do this, it will use the data segment by default, which is equal to zero seven six zero
‫two points to zero seven zero zero.
‫And right.
‫We use S.A.S., we can see that SS points to zero.
‫Right.
‫The second points to zero.
‫So that's why we use Essere.
‫Right.
‫We could change the data segment and then change it back.
‫But this is just easier, right?
‫OK, so now we're going to go move word SS zero zero two and then we're going to go zero seven zero.
‫OK, and let's now do.
‫And at zero.
‫OK, and if you now.
‫Assemble and run that.
‫You'll see a hello world, so we've successfully changed where zero points to OK, so remember to run
‫the milady's this command to assemble the file, use this command.
‫Now Interop zero is an exception divided by zero exception.
‫Right.
‫So you can't divide by zero in a process.
‫So it's illegal to do this.
‫Right.
‫So throws an exception.
‫There's many different exceptions.
‫You I'll show you more of them later.
‫But what we can do then, if I just go move X zero zero zero and I do X now, that will divide X by
‫X.
‫Right.
‫And if we now assemble that run that we see a printed, even though we're not calling to zero because
‫we've caused an exception, we're dividing by zero.
‫This isn't allowed.
‫So well done.
‫You've actually created a very festinger of the now let's just create handle one so you can see how
‫that works.
‫Right.
‫So handle one.
‫Will I provide.
‫OK, and how does one work then.
‫Well we just go move what, SS zero zero four and then we just put another one and then we go move what.
‫SS zero zero six.
‫Zero seven zero to understand now, if we get rid of this and we go and everyone reassemble that, run
‫it, now we s.v. to understand because each entry takes up four bytes.
‫So the the first entry into a zero.
‫The first two bites we put our offset, which is Handal zero, and because we are because our Sembler
‫origin is zero, you know, this works fine as an offset.
‫If this Olgin wasn't zero, would have problems with this design.
‫Right, because it works fine as an offset.
‫So we do handle zero.
‫So the assembler, when we assemble it will it will give us an offset here, right, to this label.
‫All right.
‫And here, zero seven zero.
‫That's our segment.
‫Right.
‫So we put that in offset, too.
‫So then Entropia takes about four bytes and then that's why one starts zero zero four.
‫That is how entraps work.
‫OK, and I'm going to show you a place where you can learn more about the exceptions.
‫OK.
‫So if you look here, oh, Steph Dog's fantastic resource guys, right, so you can see the exceptions
‫here, right?
‫Divide by zero error.
‫That's in zero, right?
‫And it goes on and on and on, double fault general protection.
‫We'll get more on those later on.
‫Some of these may only apply to 32 bit protective mode.
‫Mind you, that is an exception in zero is.
‫So the idea is you can create an entire routine for your colonel.
‫I don't know.
‫Let's say interrupt 80 or something.
‫Right.
‫As you said, I mean, and then the program is the make use applications for your operating system can
‫call the interrupt and then you, the colonel, can handle their request.
‫So that's the idea of interrupts.
‫Right.
‫But we won't cover those anymore in real mode.
‫It is done differently in protected mode.
‫The 32 bit mode I was telling you about, we do things differently that we use something no known as
‫an encrypted script, the table rather than an interim vector table.
‫But we'll get more on that as the course progresses.