 Hello everyone, today we are going to see the micro, micro definition, micro call and micro expansion. Learning outcome at the end of this session, students will be able to explain the concept of micro, micro definition, micro call and micro expansion. Now, first of all we see the micro, a micro is nothing but it is a name block of assembly language statement. Micro allows a sequence of source language code to be defined, once the micro is defined it can be called one or more times in a program. So next we see the example in the micro in C language. So in the C language we define the micro by using the syntax hash define PI 3.14. So here hash define is a preprocessor statement, PI is the name of the micro and 3.14 is the value of that micro. Now next we see the definition of the micro, a micro is nothing but a micro is a unit of specification for program generation through the expansion. Basically a micro is consist of a name, a set of formal parameters and a body of code. Now next we see the advantages of micro. The first advantage of the micro is it simplify and reduce the amount of repetitive coding. When we use the micro in the program it reduces the amount of repetitive coding. Instead of writing the same code again and again we make it as a micro and call it in the program whenever required. The second advantage of the micro is it reduces the possibility of errors that is caused by the repetitive coding. Writing the same code repeatedly it causes the errors. So to reduce that errors we can use the micro and the third advantage is it makes an assembly program more readable. Now next we see the micro definition. A micro definition is enclosed between a micro header statement and the micro end statement. Basically a micro definition are located at the start of the program. A micro definition consist of a micro prototype statement, one or more model statement and micro preprocessor statements. Now one by one we see the statement, the first one is the micro prototype statement. Micro prototype statement it declares the name of the micro and the names and the kinds of the parameter. The next statement is the model statement. Model statement is a statement from which an assembly language statements are generated during the micro expansion. And the third type of the statement is the micro preprocessor statement. Micro preprocessor statement it is used to perform the auxiliary functions during the micro expansion. Now next we see the syntax of defining the micro prototype statement. Now this is the syntax of defining the micro prototype statement. So first of all we have to mention the micro name and next we have to specify the formal parameter specification. Here the formal parameter specification is having its own format. So the syntax is ampersand parameter name, parameter kind. So this is the syntax of writing the formal parameter specification. After saying the concept of micro definition, can you tell me, it dash statement declares the name of the micro. The options are micro prototype statement, micro definition, micro identification or none of the above. Pause the video and think about it. The answer is micro prototype statement declares the name of the micro. Now next we see the micro call. After defining the micro, now the next we have to call the micro. A micro is called by writing the micro name in the memonics field of an assembly statement. The syntax of calling the micro is first of all here we have to mention the micro name and next we have to mention the actual parameter specification. Now next we see the example of the micro definition and the micro call. So here the example is write a program to increment the value that is stored in the memory word. So here first of all we define the micro definition. We know the micro definition is includes between the micro header statement and the micro end statement. So here the micro header statement means here we use the word micro and micro end statement is defining the MND statement. So now the next statement is the prototype statement. So here the prototype statement indicates the name of the micro and the parameter list. So here the name of the micro is INCR and it takes the three parameters. So here we can see the parameter name is specify ampersand parameter name. So here the INCR, so here INCR micro is having the three parameters ampersand memory value, ampersand INC value and ampersand register. So this is the prototype statement. Now the next there are three model statements are there in the given micro. Now the first model statement is move our ampersand register comma ampersand memory value, add ampersand register comma ampersand INC value and the third one is the move ampersand register comma ampersand memory value. So these are the three model statement of the given micro or we can say that it is a body of the micro. For this micro we call this micro by specifying the name of the micro. So here you can see the name of the micro is INCR and it is now next AB and A register. These are the actual parameter specification. So here memory value is having the value A, INC value is having the value B and register is having the value A register. Now next we see the micro expansion. A micro call leads to the micro expansion. Doing the micro expansion the micro call statement is replaced by the sequence of assembly statement to differentiate between the original statement of a program and the statement that is resulting from the micro expansion. Each expanded statement is marked with a plus symbol in its label field. Now next we see the example. So this is the micro call and this is the micro definition. So the same example is there. So this is the expansion of the micro. So here the name of the micro is INCR. Here the memory value is having the value A, INC value is having the value B and register formal parameter is having the value A register. Now next we see the expansion of this statement. So here the first model statement is MOVR, AMPUS and memory value. So during the micro expansion to differentiate between the original statement and the expanded statement, each expanded statement is marked with the plus symbol in its label field. So here that's why here we specify the plus. Now the next we specify the operation code as it is. So here the operation code is MOVR. So here we specify MOVR. Now the next is what AMPUS and register. So AMPUS register is a formal parameter. So for this parameter there is an actual value. So the register is having the value A register. So here during the micro expansion we specify the actual value A register. Now the second formal parameter is memory value. So here the memory value is having the value A. So here we put the value A. So this is the expansion of the first model statement. Now similarly we expand the second model statement add AMPUS and register comma AMPUS and INC value. So here first of all we specify the plus symbol to differentiate it from the original statement and the expanded statement. So here we specify plus. Now next we specify the operation code as it is. So here we specify the operation code add. Now next here the formal parameter is AMPUS and register. So here the AMPUS and register is having the actual value A register. So here we specify the A register and AMPUS and INC value is having the value B. So here we specify the value B. So this is the expansion of the second model statement. Now similarly we expand the third model statement MOAM AMPUS and register comma AMPUS and memory value. First of all here we specify the plus symbol in the label field. Now next we specify the opcode. So here the opcode is the MOAM. So here we specify the MOAM. Next the first parameter is AMPUS and register. So AMPUS and register is having the value A register. So here we specify the A register. And the second formal parameter is AMPUS and memory value. So here AMPUS and memory value is having the value A. So here we specify A. So this is the expansion of the micro. Now next we see the there are two key notations that are used during the micro expansion. First one is the expansion time control flow and the second is the lexical substitution. The first we see expansion time control flow. The expansion time control flow it determines the order in which the model statements are visited during the micro expansion. And the second one is the lexical substitution. So the lexical substitution it is used to generate an assembly statement from a model statement. So these are the two key notations that are used in the micro expansion. Now the next we see the flow of control during the expansion. So the default flow of control during the micro expansion is sequential. Means here the model statements are visited during the micro expansion sequentially when the prepossess statement appear in the micro definition. So it alter the flow of control during the expansion. So some model statements are never visited during the expansion. So this is called as conditional expansion and the some model statements are repeatedly visited during the expansion. This is called as expansion time loops. So basically the flow of control during the micro expansion is implemented using the micro expansion counter it is also called as MAC. Now next we see the algorithm of the micro expansion. So the first statement is here we assign the MAC to the value the statement number of the first statement that is following the prototype statement. After assigning the first statement number to the MAC now the second step is here we use the while loop. Here while statement pointed by MAC is not a micro end statement these statements are executed. Now in that first of all we see if there is a model statement if there is a model statement we expand the statement and there we are increment the MAC by 1. If there is a no model statement means here the else part will be executed means there is a preprocessor statement. So here during the execution of the preprocessor statement here the MAC is setting to the new value it is specified in the statement to implement the conditional expansion and the expansion type loop and the third statement is the exit from the micro expansion. Now these are the references thank you.