 Hello, Myself Ravindra Chauhan from Allchain Institute of Technology, Solapur. So in this session, we will discuss ARM assembly programming, now the outcome from this session the student will be able to make the use of ARM assembly directives in the program and also they will be able to write the ARM assembly programs for different arithmetic and logical operations. The outline of this session, first we will discuss how to write the program for addition of 232 bit values and the program for finding the length of string. Now the first program we will discuss that addition of 232 bit values and statement for this program is write a ARM assembly program to add 232 bit values stored from address 010000. So all of you are knowing that this ARM is a 32 bit processor. So ARM is capable to process on the 32 bit values. The second one is ARM instruction is based on load store architecture. So before data processing it is required to have the values to be processed into the internal register file. So the flow of writing of this program will be like this. First initialize the any R register with the starting address. Now in the statement it is mentioned that the values are stored from address 010000 onwards. So first initialize the R0 register with value 10000. Next load the first number into one of the register. Then load the second number into another register. Then add these two values which are currently now in the register file and then store the result from the result register into the memory. So for this we can write the program like this. The first the directive area is used to assign the read only memory space for the instructions. And program this is the identifier used which can be used as a reference for other program. Then the entry directive it is used to specify the start of our main program. So first instruction that is move R0, hash 0, x10000. This instruction it is used to load the R0 with the starting address. Since the first value is stored from this particular address. Then LDR R1 comma into bracket R0 these instructions loads the data stored at memory location pointed by R0 register. Since R1 register will have the value that is the first number. Now to load the second number the address register used here it is R0 it should be increment by 4. Why 4? Because the memory is of 8 bit the data is of 32 bit. So to store this 32 bit value in the 8 bit memory 4 locations are required. Hence the next value second value will start from the address R0 plus 4. So for that the instruction is written LDR R2 comma into bracket R0 comma hash 0 4. Now this instruction what it does? It loads the register R2 with the value pointed by the address R0 plus 4. So this instruction loads the second number in the R2 register. Now the first number is in R1 register, second number is in R2 register. Next is process these two numbers. So here we are adding these two numbers. So instruction is add and S is written to modify the CPSR register. If only add is written then the CPSR will not be gets modified. So add S R3 comma R1 comma R2. So the addition of values in R1 and R2 register will takes place and the result will be get stored in R3. Next store the result to store the result that is the sum which is in R3 register into the memory. So str R3 comma into bracket R0 comma hash 0 8. So R3 will be get stored at memory address R0 plus 0 8 and this N directive will stop the execution of the program. Now for this program you think and write the memory addresses used for second value and the result in this program. So address of second value is 1 0 0 0 0 0 0 4 because to store the first value 4 memory locations are required from means 0 to 3. Now to store the second value memory locations will be from 4 to 7 and that's why the result will be stored from 1 0 0 0 0 0 0 0 8 onwards. Now next we will see the program to determine the length of a string. So statement is write arm assembly program to find the length of a given string. Now to find the length of a given string the flow will be shown here. First specify the last characters in the input string. Then initialize the counter with value 0 to hold the string length which will be nothing but the result of this particular program. Next is read the character from the string and compare this character with the last defined character or specified character in the string. If match is found means it indicates that's the end of the string. You stop reading the character from the string and store the counter which is nothing but the length of a string. If match is not found means read character is other than the last character you increment the counter and go to read the next character. So follow these things to write the program to find the length of a given string. So in the program as just told the first define the last character in the string. So this equate directive is used to define the CR with value 0D which is the 8 bit value. So this CR will be the last character of the string whatever we are using in this program. Then the area is used to specify the code memory which is read only entry start of the program. Now first instruction here it is LDR R0 comma equal to table. So this instruction it is used to load the starting address of string means in the program the string is identified by the word table which holds the starting address of our input string. LDR R3 comma equal to STR length. So this instruction is used to load the address of the result. So this STR length is defined in the data area which can be read and write. Now next your instruction is written to clear the R1 register to store the count which holds the length of a given string. Then LDRB R2 comma R0 this instruction loads the first byte into R2 and R0 will be increment by 1. Then this value will be compared with the last character in the string that is CR. Then BEQ instruction will takes the jump if match is found means if R2 and the CR are same then it will come out of the loop and it will store the contents of R1 that is nothing but the length of the string into the memory. If match is not found then increment the counter and again go to the instructions to read the next byte from the string. Now you think and write directives to define the string and assign read write memory area to store string length. So in continuation with this program next part is the definition part. So the string defined here is world and with last character CR and STR length is defined byte type data. So STR length will be stored with the result and the end of the program. So these are the references used for this presentation. Thank you.