Hello.
Welcome back.
So let's test out what you to drive.
I'm gonna create symbolic names for some commonly used keys that um we use keys such as delete space
escape backspace carriage return line feed etc. These aren't keys like ABC.
So um I'll say see are here for carriage return.
These are standard ASCII symbols.
This one is represented by 0 x 0 D and then I'm gonna have P S for backspace to clean something.
This is represented by your ex.
Sure.
8.
And then we going to have Elif for line feed.
You can you.
This is going to be represented by your ex to a.
And we're going to have escape.
Yes.
See you can.
This is going to be represented by your ex one beat.
Then we're going to have this space.
This is going to be represented by 2 x 2 0.
And then we're going to have delete which we should represent by E Q You sure x 7 f Okay 7 F right.
So.
To Rome to go to the new line.
We need to send carriage return and line feet.
So we need to send two characters.
I'm going to create I'm going to create Tom I'm gonna create a label or a subroutine for new line cause
it takes two characters to send a new line.
Wanna come over here and just put a label here.
You line.
This which we'll use to send you lines.
We start off by saving and down the link register.
Push
LR
And then we start off by.
And then we move or courage return into register our hero.
Yeah.
Carriage return.
And then once we've moved it.
Remember Irish euro is like the variable speed.
I just thought I heard the argument for a while.
You are to write character subroutine.
So then once we've moved this into our issue we can branch to the subroutine to send it.
And then once we've done that we don't move our 0 line feet and then yell out you at the right character
and then.
Okay so when we push link register we got to pop the program counter register which is P.C. and then
over here we pop APC in our you know uh you add in net we started by pushing link register and then
we pop the program counter register.
Okay.
If I get also we forgot to a line.
This is the last subroutine does the end of the far end of a here and then I'm going to clean the space.
We created
goodness.
Anyway I'm gonna go up there now.
We've got this new line so we can try this out.
We can simply um we start off by initialize in a way you UT and then um we can.
We can send a character a.
And see what we get.
I'm gonna come over here.
I'm gonna do a hobo rather than send a we're going to send a B C D E to C out send a C so I don't move
our for over here.
There should be a b o here or to move R for the character a.
And then once that is done I'm gonna take orders in our form and put into our shoe move
into our ask.
What is in order for.
And then once they stand.
I'm going to write it.
Oh you're.
Right.
Correct.
Uh right.
And once that is done I'm going to add one to what is in order for it to go to the next character in
the alphabet.
I can simply do it for our add 1 2 our 4 and store the results back into our for like this and then
I'll check what the character is see.
I want to stop at outsourcing so I can do simply R for compare what is an R for with the characters.
If so skip complete.
If it's not easy then we can keep growing it.
I'm gonna use cup to see LDP Ellis
B less well p zero.
Okay we'll come back to the top here.
This is LP 0.
Okay.
Then
once we are done we can.
Yeah we can go to a new line if we want to peel branch.
We created a label for new lines so we can simply see a new line.
And then we do move our 0.
I'm gonna write exclamation SIGN HERE LIKE THIS AND THEN WE CAN BE ABLE TO COME TO YOU AT
A Scott rights character
and then yeah I think
we can pull a loop somewhere and try this out.
Okay.
So let's see how this operates.
You start from here.
Come over here and then we run to the end.
Okay so let's put and see.
I suspect we may have a number of arrows over here.
We have two arrows.
Symbol not defined to which symbol is this you at zero f or register K as should be on equal sign here.
Come on missin.
Okay.
Click here to build it SPRO successfully system control our CTC GPI.
On the score are not defined RC GC GPA you are unless you want a name what name would give the register
I GC GP who is from the word CIS control.
No problem.
Um I'll just copy it and bring it over here.
Uh this should be r c No.
Our GC.
Okay
our GC okay.
Build.
Now let's download onto our board and see what we have
actually before we download onto a board to a number of things we need to take care of.
Um.
Come to your.
Come over here.
Device.
And then start up the S S file in the Reset handler.
I'd like you to comment all these uh these two lines.
There was something in the system in it that interferes with I want you to drive us it is currently.
So we need to combine these two instructions.
These two lines from the reset handler.
Once you've done the um less Inspector code again.
Um.
Over here I realized there was an anomaly over here.
When we came in we looked at the line control register and I did.
Um I'd ask you are sure you hear this word here.
I suspect initially it was an end.
It has to be at mistyped.
And then over here we use in line control word land underscore H plus FIFO and enable so verify that
you have this corrected over here like this.
Right.
So this has to be done and over here to the p c t r l Well we when we did a configuration remember to
store it back into the register store.
STATEMENT HERE AND OVER HERE IN OUR you at our read character in right.
Correct a subroutine the end here has an s at the end.
S and s and end s over here.
Right.
So once you've verified all of these changes then we can build again.
And then once it's built successfully we can download onto a board to download.
I'm going to open my serial program com 8 and then okay.
Then I'll come to set up serial port and then I'll set a speed to one hundred and fifteen thousand two
hundred and then okay and then I'll press to reset my port.
And as you can see this is what we said.
We said we're right in a through z and then exclamation sign and a new line.
So this is it.
You are the driver is working just like we've configured it so in the next lesson what we're going to
do is we going to make our U S driver accessible from the from a c file.
I think that is much more practical.
It's much more practical to have the drivers initialization and subroutines written in assembly and
then calling them in C so in C language we're going to test print FS can't f we see both.
We'll see bi directional you at you know communication essentially we'll be able to read and write characters
there.
Right.
So this order is for this lesson and I'm going to attach my project to the to the video.
So if you face any arrows or yours it's not working like mine you can simply download a project attach
to the video and try it out right.
So this all there is and I shall see you in the next lesson.