### Assembly

Course
Time
13 hours 15 minutes
Difficulty
Beginner
CEU/CPE
14

### Video Transcription

00:01
Hello. This is Dr Miller, and this is Episode 11.11 of Assembly.
00:07
00:11
It's a multiple load and store.
00:13
00:20
and then we have some additional ones. And so we've got the load Multiple in the store, multiple. So L d m in STM.
00:29
And then we have a bunch of different specifications here. How you can have conditional execution. We have our base register the right back ability, and then we can give it a list of registers.
00:42
Um, and then when we're done, we can have things like increment after increment before deck Ament after indica Ament before. So we'll look at some examples here,
00:51
so to load multiple. So it's L d m. So we can say load. Multiple are zero R one to r two.
00:58
00:59
are zero will be appointer and then it will load the data pointing to that by our into our one and then the next piece of data into our to
01:07
we can also have store register.
01:11
So here we got r two and R five. So we can either use a dash to denote a sequence or weaken list them one at a time, or we can combine the two.
01:21
So let's look at an example here.
01:23
So here we have an array and it has a bunch of words F f A B B. So on and so forth Cafe cafe.
01:30
And so we can see that what we do here is we're going to, um, load this data in. So we first get the address of the array here,
01:40
Um, and this is using a different style. So we actually have the array address down here. That's pointed. We could alternatively used LD R R zero
01:49
um, equal array to do that, but this is kind of the another way to do it.
01:55
And so here we are, loading that array address into our zero, and then we're going to load multiple. So r zero will load it into it are one through our five, and then we're doing some operations on that, and then we're gonna go ahead and store it.
02:08
So let's look at what this looks like after we've executed. So we execute this instruction
02:14
now are zero has this first word are too has this word. So I are one. Has this word are too Has this word
02:22
R three R four and r five So we can see that those all got loaded in from the array that we had to find. And so that load multiple will do that.
02:34
And then after we did the exclusive or in the and on our registers, we had modified R one and r two, and we can see that are one. Now, looks like this are two looks like this.
02:45
And so when we go and do the writing So the store multiple it'll right all of those values into memories. So I went, I went ahead and,
02:53
um, in GB using gaffe. I did examine, slash, fives, letter print me off five bites and then the value pointed to by our zero. So r zero does the writing and we can see that it wrote in the data. So are one got written. Here are two got written. Here are three guys in here.
03:10
Come on down the line so we can see that those got written into memory when we executed that s t m command. So it right? All of these to the address pointed to it. That location.
03:23
So there additional combinations that we can have. So, for example, we can have store multiple increment after or load multiple increment after,
03:32
um and we can put the bang in there to do the right back, and then we can ever register or a list of registers.
03:40
So let's look at an example.
03:43
So here we have the we're loading the register or zero with message,
03:49
and then we go ahead and print off the string, and then we're gonna load multiple increment after with our zero, and then we'll update its address and we'll load those into registers are one through our nine. So we'll load,
04:00
um, eight times eight bites into memory.
04:05
So let's look at what the registers look like before.
04:08
So are zero pointed to our string, and we can see our sequence of characters that are inside of our string.
04:14
So those air right there,
04:15
we can see that all of these registers don't have anything particularly interesting in them. One points of parameters.
04:23
But after we do this load, multiple are zero with right back. So r zero is gonna get updated. And then this whole list of registers
04:30
we can see that now are zero points to the end of this string. And so weaken c e how this data is loaded.
04:38
So right here, and then you can see test this string output. So these are all hex values. And then
04:45
Geffen GTB showed us Oh, that looks like that's pointing to a string. And so it shows us what those strings will look like.
04:51
We can see that all of this data got loaded into all of these registers here and then that are zero because we had the right back are zero gets updated to now point to the last bite that it had loaded. So it loaded all these bites up to here and you can see the S E.
05:06
And then it points to the next e inside of that string.
05:13
So today we talked about some multiple load and multiple store operations
05:17
in the future, will give an example using multiple load in multiple store, and we'll see that.
05:24
And then here's our quiz. So given a pointer to a ray are zero. How would you load data into registers r one R two r three r five and are seven and then update that pointer
05:36
so we could use load multiple increment after our zero. So we gotta right back
05:43
are one through our three r five and r seven.
05:48
If you have questions, you can email me, Miller, MJ at you and Katie Dottie to you, and you can find me on Twitter at Milhouse 30.

### Assembly

This course will provide background and information related to programming in assembly. Assembly is the lowest level programming language which is useful in reverse engineering and malware analysis.

### Instructed By

Matthew Miller
Assistant Professor at the University of Nebraska at Kearney
Instructor