 Hello, welcome for this session. So, in this session, we will discuss about ARM 7 load store instructions. Outcome of this particular session, the student can demonstrate the ARM load store instruction. Also, student can make the use of various load store instructions while writing the ARM programs. Outline of this session, first the load store architecture, load instructions, then we will discuss store instructions and block transfer instructions. So, first, what is load store architecture? As far as the instruction architecture is concerned, the two architectures are mainly defined. The first one is called register memory architecture, where the one value is in the register and second value, it may be either in the register or it may be came from memory while processing the data. But in load store architecture, both the operands should be kept in the registers. So, load store architecture does not support memory to memory data processing operation. So, before data processing operations, it is required to move the required data values into the registers. Then in ARM 7, the three sets of load store instructions are defined. The first set, which is used to load or store the whole 32-bit register. The second set is defined to transfer the block of data and the third set is used for the data swapping. First, we will see the different load instructions defined in ARM 7. So, general syntax for load operation is like this. First, need to specify the operation, then the condition, then size of the data to be load, then the register and the address. Now, it is the load operations. In load operations, the data will copy from memory into the register. And there are three load instructions are defined. The first one is LDR, which loads the 32-bit value. LDRB, which takes a byte value from the memory into the specified register. And third one is LDRH, which loads a register with a 16-bit value. That is called load a half word. The example of the load instruction, the first we can, one example we can write, the LDR R1 comma into bracket R2 comma hash 16. Now, what this instruction does? This instruction loads the R1 register. Now, what it loads in the R1 register? So, this instruction loads the R1 register from the memory whose address is calculated as the contents of register R2 plus 16. Next example is LDR R1 comma hash R2 comma R3 comma LSL hash 2. Now, this instruction loads the R1. And how the address of the memory is calculated? See first, the contents in R3 register will get multiplied by 4 because of the LSL field. And whatever the product that is R3 multiplied by 4, in that the value from R2 will get added. And the result is the final memory address from where the value will be taken and it will be load into the R1 register. Another example you take for the conditional load instruction, LDR which is the basic load instruction, EQ is the condition and B is defined for the size of the value to be loaded. So, EQ is the condition. So, this instruction will execute when 0 flag is set. So, that is why it is called conditionally load. So, this instruction loads the byte value from the address R6 plus 5 into the register R1. And where it will keep because R1 register is of 32 bit and only this instruction reads the 8 bit value. So, this 8 bit value from the memory will be copied into the bits 0 to 7 of R1 register. And remaining bits that is from bit 8 to bit 31 will be filled with 0s. Next is the store instruction. The syntax is like this. First operation, then the condition, then the size of the value to be stored, then the register to be stored and the memory address. Now, store operation means the data will flow from register into the memory. So, the data will be get stored into the specified memory address from the specified register. So, three different store operations are defined. STR which stores a 32 bit value, STRB which stores byte value, STRH which stores a half word that is the 16 bit value. Consider the some example of the store instruction. So, the first example is written as store R1 comma into bracket R2 comma R4. Now, what this instruction does? This instruction stores the value from R1 register at memory address calculated by the value in R2 and plus value in R4. So, R2 and R4 both are the registers. Now, the next example is written STR R1 comma into bracket R2 comma R4 and the special symbol shown in the instruction. Now, what this instruction does? This instruction stores the contents from R1 register into the memory address calculated by R2 plus R4 and also write the new address that is R2 plus R4 back into the register R2. The one more example you take STR R1 into bracket R2 comma R4. So, this instruction stores the value in R1 at the memory address pointed by register R2 and also it writes the new address that is R2 plus R4 into the register R2. Now, you pause the video and think that what will be the contents of R0 and R1 after the execution of instruction LDR R0 comma into bracket R1 comma R2 and the special symbol. So, what this instruction does? This instruction will load the R0 register from the memory address R1 plus R2 and at the same time the R1 register will be gates modified and the new value in R1 register will be equal to R1 plus R2. Then the next set of load store instruction is called block transfer instruction. Now, these instructions are transferred the more than one value. Now, these instructions specify whether to increment or decrement the base address pointer before or after the load and store operation. So, in block transfer instructions the increment and decrement of the base pointer is specified. So, the first stmi or ldmi these two instructions here these two instructions increment the address pointer after the load and store operation. stmi b and ldmi b these two instructions increment the pointer before load and store operation. stmda and ldmda these two instructions decrement the address pointer after the load and store operation. stmdb and ldmdb these two instructions decrement the base pointer before the operations. Now, this is the example of block transfer instructions you see the instructions now ldmi instruction first it loads the register and then it increments the base pointer. So, before execution of this the contents of R0 R1 R2 R3 are shown like this and at memory address 800101 is stored at next 1402 is stored and next is 03 is stored. So, after execution of this instruction R0 will having the new value that is 8001 c R1 will hold the value 01 which is taken from the address 80010. That means first the load operation is taking place. So, this instruction loads the value from 80010 and transferred into the R1 register and then it increments the pointer. So, R0 will be gets incremented by 4 and from the next address that is from 80014 the 02 is there which will be transferred into the register R2 and so on. References are like this Andrew Schloss book and Stu Ferber book. Thank you.