﻿1
00:00:00,330 --> 00:00:02,640
‫Hello and welcome to this lecture, guys.

2
00:00:02,940 --> 00:00:09,280
‫So in this lecture, we're going to change the way interests are handled if we just go to it.

3
00:00:09,300 --> 00:00:13,110
‫He did see and we scroll up.

4
00:00:17,870 --> 00:00:24,260
‫You can see that in it, in it we have ideas, he said, this is currently how we set interrupts, OK,

5
00:00:24,740 --> 00:00:32,060
‫we call it set and we set it to some assembly handler, which then calls the C function.

6
00:00:32,570 --> 00:00:38,040
‫After its first push, the general purpose registers, then it calls the C handler.

7
00:00:38,180 --> 00:00:43,610
‫OK, now this is a bit tedious because we're going to have so many assembly routines.

8
00:00:43,610 --> 00:00:45,040
‫It's going to be a bit of a nightmare.

9
00:00:45,530 --> 00:00:47,180
‫So I propose a better solution.

10
00:00:47,720 --> 00:00:54,890
‫We create an assembly interrupt routine for every single possible interrupt and they all call one handler,

11
00:00:55,400 --> 00:01:00,740
‫the handler they call they push the script number to that C handler.

12
00:01:01,280 --> 00:01:06,310
‫So the C function will know which group was called because it'll be pastorate as an argument.

13
00:01:07,010 --> 00:01:11,580
‫So obviously we don't want to create 500 different labels here.

14
00:01:12,230 --> 00:01:13,850
‫So what are we going to do?

15
00:01:14,000 --> 00:01:19,220
‫Well, we can create a macro and by creating a macro, we only have to write code once and we can make

16
00:01:19,220 --> 00:01:19,740
‫a loop.

17
00:01:20,330 --> 00:01:27,410
‫OK, so we're going to do that in this lecture and it will mean the handling of interrupts will be far

18
00:01:27,410 --> 00:01:34,460
‫cleaner because we won't have to write an assembly routine for every interest handler we wish to create.

19
00:01:35,480 --> 00:01:37,660
‫OK, so we're going to begin now.

20
00:01:37,670 --> 00:01:44,150
‫And if you don't know what I'm doing here, you're going to need to research about macros in Nazeem

21
00:01:44,750 --> 00:01:47,590
‫because that is unrelated to our step.

22
00:01:48,140 --> 00:02:00,260
‫So just by here, we're just going to go %s sine macro interrupt one global in its.

23
00:02:03,210 --> 00:02:14,060
‫Percent one in eight percent one, and we're just going to push aid to save those general-purpose registers,

24
00:02:14,070 --> 00:02:19,210
‫we can copy and paste these comments here, guys as well, just to make it clear what's going on.

25
00:02:20,330 --> 00:02:22,460
‫OK, so that's what that's doing.

26
00:02:24,790 --> 00:02:31,840
‫Interrupt frame, and and we can push the static pointer at this point in time, and now we want to

27
00:02:31,840 --> 00:02:37,980
‫push the interest number because like I said, the C program needs to know which intercept was called.

28
00:02:37,990 --> 00:02:38,360
‫Right.

29
00:02:38,950 --> 00:02:40,260
‫We're making a macro here.

30
00:02:40,270 --> 00:02:48,120
‫And essentially when they call in three or 10 or something, we're going to need to know what intercept

31
00:02:48,130 --> 00:02:49,060
‫number was called.

32
00:02:49,390 --> 00:02:51,220
‫So we push that to the stack there.

33
00:02:51,640 --> 00:02:58,990
‫And then in the C prototype, that will be like in in it interrupt or something in the C function prototype,

34
00:02:59,200 --> 00:03:03,600
‫it'll upset the stack frame and the the interim number as an integer.

35
00:03:04,060 --> 00:03:06,900
‫OK, and that's how we'll know what's going on here.

36
00:03:07,180 --> 00:03:10,270
‫And we're just going to call intra Pannella, which we haven't created yet.

37
00:03:12,350 --> 00:03:18,740
‫And now we're just going to go add ESPE eight, and this is to ignore these two values, we pushed to

38
00:03:18,740 --> 00:03:25,400
‫the stack there and I we're going to just go pop and I get to return from the routine.

39
00:03:26,090 --> 00:03:30,950
‫And I was just going to go percent and macro again.

40
00:03:31,010 --> 00:03:31,850
‫That's a macro.

41
00:03:31,850 --> 00:03:34,030
‫So that coat's not there because we haven't called it.

42
00:03:34,040 --> 00:03:41,300
‫So what we're going to do now is we're going to say percent a sign I zero.

43
00:03:41,960 --> 00:03:42,800
‫We're making a loop.

44
00:03:42,800 --> 00:03:48,440
‫OK, we're going to go rep five hundred and twelve interrupt I.

45
00:03:50,250 --> 00:03:59,460
‫OK, and then we're going to go present a sign I equals I plus one.

46
00:03:59,740 --> 00:04:04,440
‫OK, so we go assign I, I plus one and I will incremented.

47
00:04:04,440 --> 00:04:08,030
‫OK, so I know these macros are a little ugly, but this is a sembler.

48
00:04:08,040 --> 00:04:12,630
‫OK, so the macro system is not going to be beautiful, you know.

49
00:04:12,640 --> 00:04:14,280
‫So we have to deal with what we have here.

50
00:04:15,860 --> 00:04:21,760
‫We're going through the pain of making these macro's now so it can be cleaner later on in the C-code,

51
00:04:22,100 --> 00:04:25,280
‫so here we're just going to go percent and repp.

52
00:04:26,450 --> 00:04:28,340
‫So, OK, what's happening here?

53
00:04:28,340 --> 00:04:35,330
‫Then we create a for loop that loops through 512 times and it basically calls our macro interrupt.

54
00:04:35,330 --> 00:04:36,460
‫I OK.

55
00:04:37,040 --> 00:04:46,340
‫And that will essentially create this code, OK, and it will replace the Interop we we've done here

56
00:04:46,340 --> 00:04:50,590
‫with Pesenti, with the Interop number we pastorate here I.

57
00:04:50,810 --> 00:04:54,560
‫OK, so let's say it's on index six or whatever.

58
00:04:54,560 --> 00:04:54,830
‫Right.

59
00:04:55,070 --> 00:04:56,690
‫It would say in six.

60
00:04:56,930 --> 00:05:04,970
‫So if we say interest six, what we're saying is, is global and it's six in its six label Pusztai word

61
00:05:04,980 --> 00:05:05,500
‫six.

62
00:05:05,510 --> 00:05:06,330
‫That's what we're doing.

63
00:05:06,350 --> 00:05:10,790
‫OK, so this code is basically like copy and pasted like this.

64
00:05:11,150 --> 00:05:12,670
‫Five hundred and twelve times.

65
00:05:13,430 --> 00:05:16,370
‫So essentially this is looped through 512 times.

66
00:05:16,700 --> 00:05:23,090
‫Encrypt I is called, which represents our macro that we make further up.

67
00:05:27,960 --> 00:05:34,320
‫OK, you don't have to do anything, I was just controls in those copy and paste I did.

68
00:05:34,710 --> 00:05:37,330
‫So yeah, that's what's happening here.

69
00:05:37,350 --> 00:05:39,140
‫OK, we're doing interrupt.

70
00:05:39,150 --> 00:05:45,120
‫I hear if we did interrupt sex, what would happen is this would say in it's sex, this will push sex,

71
00:05:45,300 --> 00:05:45,810
‫OK?

72
00:05:46,170 --> 00:05:48,470
‫And it literally is like copy and pasting.

73
00:05:48,480 --> 00:05:50,470
‫It's like definitions in C.

74
00:05:50,540 --> 00:05:56,610
‫OK, so once you've done that then we can go ahead and say that we are looking for that function, the

75
00:05:57,510 --> 00:05:58,890
‫interrupt handler function.

76
00:05:58,890 --> 00:06:05,510
‫So we'll go at the top here and we simply go extern interrupts Handler.

77
00:06:06,630 --> 00:06:14,850
‫So OK then we're just going to go to I that c and just by here at the top here we're going to say void

78
00:06:14,850 --> 00:06:15,990
‫interrupt handler.

79
00:06:16,890 --> 00:06:18,060
‫Any to interrupt.

80
00:06:18,630 --> 00:06:20,700
‫Struct interrupt free.

81
00:06:24,840 --> 00:06:30,450
‫OK, and we can just call that frame, actually, so, yeah, this function here.

82
00:06:31,900 --> 00:06:39,040
‫We'll get cold by these macro's, OK, and this macro will pass the correct integer, the intra that

83
00:06:39,040 --> 00:06:48,820
‫was called to us because of the well, this one I mean, because we've done percent I so percent I is

84
00:06:48,820 --> 00:06:51,210
‫replaced with whatever value you passed here.

85
00:06:51,610 --> 00:06:57,160
‫If you do interrupt 20 like this, then it's going to generate a macro within it.

86
00:06:57,190 --> 00:07:00,440
‫Twenty being the label and at twenty being pushed.

87
00:07:00,460 --> 00:07:05,700
‫OK, so just, just understand that OK, so that's perfect.

88
00:07:05,750 --> 00:07:07,150
‫We go to see.

89
00:07:07,870 --> 00:07:11,830
‫OK, so before we fill this function in, there's some things we need to note.

90
00:07:12,880 --> 00:07:14,500
‫The process is not magic.

91
00:07:14,860 --> 00:07:19,240
‫It doesn't know that we've created a macro or 512 interrupts.

92
00:07:19,960 --> 00:07:24,540
‫We need to update the descriptive tables using it.

93
00:07:24,540 --> 00:07:30,160
‫Except now the problem is we don't know the addresses of these macros.

94
00:07:30,740 --> 00:07:31,720
‫It's unfortunate.

95
00:07:31,720 --> 00:07:32,190
‫I know.

96
00:07:32,500 --> 00:07:34,240
‫So what do we do about this?

97
00:07:34,810 --> 00:07:37,990
‫Well, we create an external pointer array.

98
00:07:38,020 --> 00:07:38,860
‫That's what we do.

99
00:07:39,070 --> 00:07:41,940
‫And we define the array in IGT, HSM.

100
00:07:42,370 --> 00:07:46,730
‫So just follow me and you will understand what is going on.

101
00:07:47,020 --> 00:07:55,540
‫So just by here, we're going to say external void pointer entry points a table, OK, and we're going

102
00:07:55,540 --> 00:08:05,110
‫to put here Pekoe as Max interrupts OK, now if you just go to config dot, we're going to make that.

103
00:08:05,120 --> 00:08:08,410
‫So we're just going to go define Peatross.

104
00:08:08,410 --> 00:08:12,090
‫Max interrupts 512.

105
00:08:12,100 --> 00:08:18,550
‫Make sure it's 512 guys because we've created 512 entries here in Australia.

106
00:08:18,570 --> 00:08:20,950
‫So when we looked for five, 10, 12 times.

107
00:08:20,950 --> 00:08:21,250
‫Right.

108
00:08:22,990 --> 00:08:24,400
‫OK, so that's was all good.

109
00:08:24,760 --> 00:08:31,450
‫Now, essentially in days and we're going to declare this array into a table.

110
00:08:31,460 --> 00:08:33,970
‫That's why we've is external, right?

111
00:08:33,970 --> 00:08:35,170
‫Using the external keyword.

112
00:08:36,130 --> 00:08:39,670
‫We're going to fill that array in assembly with pointers.

113
00:08:39,680 --> 00:08:45,970
‫So these interests that we've created here in our little loop by here in TRIPTI, in TRIPTI and so on.

114
00:08:45,970 --> 00:08:50,710
‫Right interview into one inch or two, we've created five, 10, 12 of them in this four loopier.

115
00:08:50,710 --> 00:08:51,000
‫Right.

116
00:08:51,190 --> 00:09:01,000
‫We've got in TRIPTI and it's called an TRIPTI here and created 512 of these separate routines for each

117
00:09:01,000 --> 00:09:01,870
‫and every interrupt.

118
00:09:02,620 --> 00:09:11,380
‫So the idea is here we create this entry point to table in Australia and we we pointed to each and every

119
00:09:11,380 --> 00:09:14,410
‫individual one that we've created here in this folder.

120
00:09:14,830 --> 00:09:19,660
‫OK, so that's the idea because the C program can't possibly know about this.

121
00:09:19,660 --> 00:09:19,960
‫Right?

122
00:09:20,290 --> 00:09:22,660
‫So that's why we have to declare the array.

123
00:09:22,660 --> 00:09:27,430
‫And I start I assume you will understand soon enough.

124
00:09:27,730 --> 00:09:29,110
‫Just scroll down a bit here.

125
00:09:29,680 --> 00:09:39,790
‫And just by here you will see we loop through PTW total interrupts and we set I to know interrupt.

126
00:09:39,790 --> 00:09:41,770
‫OK, we need to change this.

127
00:09:41,950 --> 00:09:47,270
‫It instead needs to be set to enter a pointer table I.

128
00:09:48,340 --> 00:09:51,810
‫OK, and that will ensure the process is happy.

129
00:09:52,450 --> 00:09:56,650
‫Now you'll see we've gone ptw into interrupt PTW total interrupts.

130
00:09:57,430 --> 00:10:01,780
‫We now have two definitions saying the same thing so we don't really want that.

131
00:10:01,810 --> 00:10:04,990
‫So this little definition we may, we're going to replace it with PTW.

132
00:10:04,990 --> 00:10:12,010
‫Total interrupts actually and in config Hajj we can remove that definition we made.

133
00:10:12,460 --> 00:10:15,200
‫I didn't realize we made one earlier on.

134
00:10:15,610 --> 00:10:18,910
‫So if we go back twice to see it should look like that now.

135
00:10:18,960 --> 00:10:19,280
‫OK.

136
00:10:19,810 --> 00:10:23,860
‫OK, so just a quick overview.

137
00:10:24,160 --> 00:10:26,830
‫We create an array called entry point to table.

138
00:10:26,830 --> 00:10:29,680
‫This is external, which means we're not creating this memory.

139
00:10:29,950 --> 00:10:32,830
‫We're saying to the C compiler, this man was created somewhere else.

140
00:10:33,100 --> 00:10:39,030
‫We don't know where, but just treat it like void pointer array that can hold five, 10, 12 elements.

141
00:10:39,040 --> 00:10:40,040
‫That's what we're saying here.

142
00:10:40,640 --> 00:10:43,950
‫Now, the memories actually create nice today.

143
00:10:44,620 --> 00:10:45,850
‫We haven't written it yet.

144
00:10:45,850 --> 00:10:48,080
‫But, you know, I've told you, that's what we're going to do.

145
00:10:48,430 --> 00:10:49,510
‫OK, so you're aware of that?

146
00:10:49,510 --> 00:10:49,810
‫Good.

147
00:10:50,590 --> 00:10:51,540
‫In it.

148
00:10:51,550 --> 00:10:55,120
‫In it we loop through all of those total interrupts, OK?

149
00:10:55,360 --> 00:11:01,200
‫And we set in the script table that I should point to entry points, table I.

150
00:11:01,450 --> 00:11:02,310
‫That's what we say.

151
00:11:02,500 --> 00:11:06,190
‫OK, so we've set up those points is now OK.

152
00:11:06,760 --> 00:11:11,990
‫And now finally and that Asen we'll have a little pointer array OK.

153
00:11:12,460 --> 00:11:17,080
‫Which will point to each and every interrupt here, which I've already explained to you.

154
00:11:17,740 --> 00:11:20,650
‫So that's a brief overview of what's going to happen here.

155
00:11:21,220 --> 00:11:22,480
‫So this is not so hard.

156
00:11:22,480 --> 00:11:28,780
‫Scroll to the bottom here and in section, that data, which is going to go into a pointer table.

157
00:11:31,610 --> 00:11:44,030
‫And we're going to go percent a sign I zero percent rep five June 12 interrupts Arae entry I, which

158
00:11:44,030 --> 00:11:45,010
‫we haven't created yet.

159
00:11:45,920 --> 00:11:54,500
‫And then we're going to go percent assign I, I plus one percent and rep and I just above here were

160
00:11:54,500 --> 00:12:09,630
‫going to say macro interrupts oray entry one td in eight percent one and macro.

161
00:12:10,430 --> 00:12:12,360
‫So can you see how this is working.

162
00:12:12,800 --> 00:12:18,170
‫We've created that entry point a table that's that our C program sees as external.

163
00:12:18,170 --> 00:12:18,550
‫Right.

164
00:12:18,800 --> 00:12:24,650
‫It sees that as external as as I've already explained, we create the array here that point to table

165
00:12:24,650 --> 00:12:31,850
‫here, OK, and we call the macro encrypt array entry which does a double what, which is four bytes

166
00:12:32,060 --> 00:12:34,700
‫the size of an address and a 32 bit architecture.

167
00:12:34,700 --> 00:12:34,970
‫Right.

168
00:12:35,570 --> 00:12:36,340
‫And what address.

169
00:12:36,350 --> 00:12:37,280
‫So we send it to.

170
00:12:37,820 --> 00:12:39,890
‫Well, only in eight percent one.

171
00:12:40,130 --> 00:12:45,120
‫OK, and as you know, the percent one is replaced with whatever value parts to it.

172
00:12:45,860 --> 00:12:47,550
‫So that's how that's working.

173
00:12:47,690 --> 00:12:55,010
‫If I was to go interrupt array entry five, that's going to be replaced with in five.

174
00:12:55,850 --> 00:12:58,020
‫And what is the five label.

175
00:12:59,300 --> 00:13:02,420
‫Well, the five label if we scroll up.

176
00:13:04,390 --> 00:13:06,460
‫Is this it represents this.

177
00:13:08,020 --> 00:13:19,440
‫I understand, because if I did interrupt five, then that's going to give me a label of it five, you

178
00:13:19,510 --> 00:13:21,760
‫understand, because that's how macros work.

179
00:13:22,210 --> 00:13:26,710
‫This is created five million, 12 times because of our loop and so is our point.

180
00:13:26,710 --> 00:13:28,830
‫That table is created five, 10, 12 times.

181
00:13:28,840 --> 00:13:31,880
‫Well, the entry we have five new 12 entries.

182
00:13:31,910 --> 00:13:41,350
‫OK, so we let's we have literally in just assembly created a table of pointers pointing to our intra

183
00:13:41,370 --> 00:13:42,420
‫service routines.

184
00:13:43,360 --> 00:13:50,950
‫So it's nice to see if we now access the entire point to table where actually accessing the memory here

185
00:13:50,950 --> 00:13:55,300
‫on line 112 where we where we call the interrupt array entry macro.

186
00:13:56,350 --> 00:13:56,830
‫OK.

187
00:13:58,210 --> 00:14:05,800
‫It's appointer to end it one and two and three and four and so on, and that's the same reason why we

188
00:14:05,800 --> 00:14:13,810
‫have to loop through all of the pointed table and do I just said, OK, because that updates the descriptive

189
00:14:13,810 --> 00:14:16,150
‫table so that it points.

190
00:14:17,890 --> 00:14:23,890
‫So these macro's, OK, so that's how that is working guys, and I hope that makes sense because it's

191
00:14:23,890 --> 00:14:28,120
‫quite difficult to explain this stuff when you haven't worked with macro's before.

192
00:14:28,150 --> 00:14:32,980
‫So if you're still confused, you need to research by the macro's before continuing this course.

193
00:14:34,450 --> 00:14:40,480
‫So, yeah, now that we have done that, if we want to run this, any interest that happens, that we

194
00:14:40,480 --> 00:14:43,060
‫have an override ID, we've overrides everything here.

195
00:14:43,060 --> 00:14:47,500
‫You see Xerox 21, Xerox, Xerox and any Interop, we have an override ID.

196
00:14:47,890 --> 00:14:49,740
‫It will call this interim Tangela here.

197
00:14:50,170 --> 00:14:58,150
‫So it really is that that fascinating that we've just simplified this so much now that we can see the

198
00:14:58,150 --> 00:15:02,410
‫exact interruptive was called the Interop number, which is fantastic.

199
00:15:02,410 --> 00:15:07,090
‫We can have a switch statement, we can have an array of function pointers and we can work with those

200
00:15:07,090 --> 00:15:07,910
‫in troop numbers.

201
00:15:08,380 --> 00:15:12,640
‫OK, so this is a this is a really good thing that we've abstracted it out like this.

202
00:15:13,000 --> 00:15:17,920
‫If we decided not substract that, I would like this, we would have to use it set on some assembly

203
00:15:17,920 --> 00:15:23,680
‫routine, which then calls the C handler would have to do that for every single instrument that we wanted.

204
00:15:23,830 --> 00:15:25,690
‫Now, that's that's a lot of work.

205
00:15:26,470 --> 00:15:32,080
‫This little micro implementation simplifies the whole thing, although we have to do is use an if statement

206
00:15:32,080 --> 00:15:36,540
‫on this interim number was the incorrupt and SREP five.

207
00:15:37,000 --> 00:15:39,280
‫OK, then do something for five.

208
00:15:39,280 --> 00:15:40,060
‫You see what I mean?

209
00:15:40,360 --> 00:15:43,130
‫It's that simple now because we've abstracted this out.

210
00:15:43,510 --> 00:15:46,620
‫So just go to Tarsem because we're not quite done.

211
00:15:46,990 --> 00:15:50,290
‫We need to now make this table exploded.

212
00:15:50,290 --> 00:15:52,930
‫So just copy and paste the label into your points table.

213
00:15:53,290 --> 00:16:00,110
‫Scroll up and we're just going to say global and we're going to paste that in global entry points table.

214
00:16:00,170 --> 00:16:04,300
‫OK, I'll give it a global and a 21 H because we don't want that anymore.

215
00:16:04,780 --> 00:16:05,980
‫We're just going to delete that.

216
00:16:06,020 --> 00:16:17,500
‫OK, we go to Tazi and we're just going to look through here a second, whereas in SREP 21 handle at

217
00:16:17,500 --> 00:16:18,910
‫the age of twenty one.

218
00:16:18,910 --> 00:16:22,420
‫Hey Chandler, we no longer want that or I just delete that.

219
00:16:23,170 --> 00:16:28,420
‫OK, and copy and paste outby zero twenty six twenty and paste that in the interim.

220
00:16:28,420 --> 00:16:33,820
‫Tandler because remember the programmable Interop controller requires an acknowledgement, as I've already

221
00:16:33,820 --> 00:16:37,120
‫explained, when we were first implementing these handlers.

222
00:16:37,120 --> 00:16:39,280
‫OK, it requires an acknowledgement.

223
00:16:39,520 --> 00:16:41,470
‫So we have to give it an acknowledgement.

224
00:16:41,500 --> 00:16:44,710
‫OK, so we're now ready to test this.

225
00:16:44,710 --> 00:16:49,780
‫So we're going to compile this and we're going to put a breakpoint on this line and see what the number

226
00:16:49,790 --> 00:16:50,230
‫says.

227
00:16:50,830 --> 00:16:56,500
‫So just go to the terminal and we're going to go make clean build that, S.H..

228
00:16:58,870 --> 00:17:08,230
‫And we see a little error on line 54 and 65, I see JSM, so just go to line 54 and we can see what

229
00:17:08,230 --> 00:17:08,770
‫I've done here.

230
00:17:08,770 --> 00:17:11,500
‫I've done a percent, I, I should have been eight percent one.

231
00:17:11,500 --> 00:17:14,800
‫Guys, that was a little mistake because I was using the eye here in the loop.

232
00:17:15,070 --> 00:17:17,710
‫Change that from percent eye two percent one.

233
00:17:18,190 --> 00:17:25,030
‫And we're going to scroll down and we're going to do the same on line 64.

234
00:17:26,800 --> 00:17:28,390
‫No, no, that was the only one.

235
00:17:28,660 --> 00:17:30,100
‫OK, recompile that now.

236
00:17:32,180 --> 00:17:32,910
‫And there we are.

237
00:17:32,930 --> 00:17:38,190
‫That works fine, you can see undefined reference to any 21 page, line 57.

238
00:17:38,210 --> 00:17:39,650
‫That's because we just deleted that.

239
00:17:40,790 --> 00:17:47,640
‫So if we just could start see line 57, uh, and we're going to delete this one here.

240
00:17:47,660 --> 00:17:54,320
‫This is she said Xerox 21 k delete that because we've created the handle on how to handle that.

241
00:17:54,320 --> 00:17:55,970
‫Right, with the macros.

242
00:17:56,150 --> 00:17:57,020
‫So build again.

243
00:17:57,020 --> 00:17:58,640
‫We can see that works absolutely fine.

244
00:17:59,170 --> 00:18:03,590
‫We're going to go Cribben GDP and we're going to test this to see if it works.

245
00:18:03,600 --> 00:18:09,650
‫So we're going to go add single file filled kernel full todo Xerox one.

246
00:18:09,650 --> 00:18:10,970
‫One, two, three, four, five.

247
00:18:12,930 --> 00:18:23,130
‫Target remote kumu system i3 eight six dash hastier showstopping dash capsulize JP GBE Studio.

248
00:18:25,000 --> 00:18:28,460
‫OK, and we're now going to break on the interrupt handler.

249
00:18:30,190 --> 00:18:33,910
‫We're going to proceed to continue and look at that.

250
00:18:33,940 --> 00:18:40,420
‫We can see in thirty two, OK, and if we print the frame, we can see the general-purpose registers

251
00:18:40,420 --> 00:18:41,460
‫pressie to continue.

252
00:18:41,470 --> 00:18:45,430
‫Now we see in Europe one one eight C to continue in 32.

253
00:18:46,960 --> 00:18:57,120
‫OK, so you can see we have now created our very own generic intercept handler and it tells us the number.

254
00:18:57,520 --> 00:18:59,290
‫And can you see the potential with this?

255
00:18:59,470 --> 00:19:06,160
‫We have a switch statement if statement point of function or anything we want because we now know the

256
00:19:06,160 --> 00:19:06,880
‫Interop number.

257
00:19:07,210 --> 00:19:09,730
‫Now, this is something that the processor doesn't tell you.

258
00:19:10,060 --> 00:19:17,020
‫As you know, we we know which Europe was used because we made a macro of 512 different interrupts,

259
00:19:17,560 --> 00:19:21,670
‫OK, that it literally created 512 different Interop labels.

260
00:19:22,510 --> 00:19:29,680
‫And if we scroll down, we created our pointed table here, which also points to the addresses of those

261
00:19:29,680 --> 00:19:30,820
‫five 12 interrupts.

262
00:19:31,090 --> 00:19:32,260
‫What are the addresses?

263
00:19:32,530 --> 00:19:33,870
‫Simply the labels.

264
00:19:34,420 --> 00:19:38,260
‫So in it one and a two and a three and a four, so on.

265
00:19:38,470 --> 00:19:42,880
‫And they push themselves, they push their own interim number to the stack.

266
00:19:43,150 --> 00:19:47,350
‫And that is how we get to know exactly which Interop was called.

267
00:19:48,190 --> 00:19:51,960
‫So congratulations, you've now abstracted out your interest handlers.

268
00:19:52,450 --> 00:19:56,200
‫This was very important step in writing clean code.

269
00:19:57,160 --> 00:19:59,470
‫That little extra effort goes a long way.

270
00:19:59,470 --> 00:20:00,580
‫So thanks for watching.

