Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
Already have an account? Sign In »
13 hours 15 minutes
Hello. This is Dr Miller, and this is Episode 11.2 of Assembly
today. What we're going to do is we're gonna download and install the template.
So the template
this template is specific to arm, so it's similar to the X 86 template. And so what we're going to do is we're gonna download install it,
and then it will create projects for us that we can use for our coating purposes.
So I've got a raspberry pi here that I can ssh into.
I've cleaned it up.
So the first thing that we're going to dio
let's go back here
as we were going to download the template. So that's we're gonna use the w get commands to w get space. It should be colon slash slash
CS that you and Kate I E D u slash till day. Miller slash arm template, Doctor Dodge Easy.
And you make sure you get all the letters to correct capitalisation. Then we'll extract it.
We will run the fix on it, and then you will need to log out and log back in now. I've already run it so I won't have to log out. But you will have toe log out or open a new terminal in order for it to work.
so let's go ahead and download it.
Okay, So it should say that it had saved our file.
If we do an ls, we should see the arm template here.
So now I should see a folder called Template. If I do dot, slash templates, fix
that should fix my environment. So now is the point where you would log out and log back in,
and then you create a new project we can use arm jen and then the name of our
project that we want to create.
So I'm gonna create one called Fred.
And here it says, successfully clear it'd Fred if you try and do it again.
Um, it says that that director already exists, so we can't recreate it
and for doing it unless And look at our files. We see that now
it started. We had armed template dot targets e g z womb. We extracted that. We ended up with a folder called Template.
And now we have an additional folder called Project.
All right, so if we go in a project again, this is where our projects will be So we can go into Fred.
We can see
we have our library. We have our make file, and then we have our assembly file. So go ahead and add it, Fred. I am Sam.
So let's add some, um, A messaging. So this is similar to the example given in the first arm lecture.
So here we're just gonna add a
string here. We're going to tell it to a line on four byte boundaries,
and then arm has some different directives so we can see an ask e string that ends in a zero is A S C i z.
And then we can just type of string
hello world with an exclamation point.
And we can even put a slash in in here who won a new line.
And then if we want to go ahead and print off that we can,
um, we'll learn about these commands later LD R zero
We'll do branch of link print
strings that'll print a string off.
We can also do things like move.
Are zero the number?
Um, let's pick a number 19
being a new branch of link print. Didn't
It's a lot of print off that number Natural number 19.
And then we're all done down here. So here is our you see comments are either slash *** tricked. And then at the end, asterix slash that's multi line or a single line.
And then, ah, regular comment is slash, slash and then everything after that and you can see syntax highlighting here shows that for me so that I can see that
Go ahead and write and quit,
and then we can type, make and so make we'll go ahead and run
the assembler on,
um, our assembly files. Afraid, I sm,
um it also run it on our library, and then we can use DCC to compile it into a binary cold. Fred
Additionally, we need to make sure that we save our link register.
So I didn't say push LR
when we're done, we need to restore that because that saves where we needed to go at the end. So pop,
And then additionally, we've got to create our text segment which wasn't by default set up there so dot text
for our main program.
now if we type make,
we can see that it should be built. And now when we run that, we can see that it prints off Hello world and then the number 19.
So today we looked at installing the template for arm and then using it in a similar way that we use our X 86 template.
So looking forward, we're going to talk about some of the instructions that we saw. So, for example, moving data to and from memory.
So we were able to load our string and load the number
19 from Variables. And so we'll look at how we do that in arm, which is going to differ a little bit than what we did in x 86.
So if you have questions, you can email me at Miller MJ at you and Keita et you, and you can find me on Twitter at No House, 30