 Hello everyone today we are going to see the types of formal parameters in the micros. Learning outcome at the end of this session students will be able to explain the different types of the formal parameters. Now first we see there are different types of the formal parameters are there in the micro. First one is the positional parameter, second one is the keyword parameter, third one is the default specification of parameters, fourth one is the micros with mixed parameter list and the fifth one is the other uses of parameters. Now first of all we see the positional parameters. A positional formal parameter is written as ampersand parameter name. So here we see the example ampersand sample. So here the sample is the name of the parameter. In the positional parameter parameter kind is omitted. So here the actual parameter specification in the micro call using the positional parameter is simply an ordinary string. Now next we see the how we calculate the value of the formal parameter by using the positional association. So here the value of the positional formal parameter x, y, z is determined by the rule of positional association as follows. First find an ordinal position of x, y, z in the list of formal parameters in the micro prototype statement. After that we here why we have to find the actual parameter specification that occupies the same ordinal position in the list of actual parameter in the micro call statement. Now next we see the example of the positional parameter. So this is the definition of the micro. Here the name of the micro is INCR. Here micro INCR it is having the three positional parameters ampersand memory value, ampersand INC value and ampersand register. These are the three positional parameters for the given micro INCR. Now next this is the micro call. So here the name of the micro is INCR. There are three actual values are there a, b and a register. Now here you can see these are the formal parameters and their actual value. So the first formal parameter is memory value. So the memory value is having the value a, INC value is having the value b and register is having the value a register. So here memory value is having the value a, INC value is having the value b and register is having the value a register. This is the expansion of the model statement. So here the first model statement is MOV and ampersand register comma ampersand memory value. So here to differentiate between the original statement and the expanded statement we specify the plus symbol in its label field, after that we specify the operation code as it is. So here the operation code is MOAR, now the next formal parameter is ampersand register. So the register is having the value irregister, so here during the microexpansion we specify irregister. Now the second parameter of the first model statement is ampersand memoryval. So here the memoryval is having the value a, so here we specify the a value. So this is the expansion of the first model statement. Now we expand the second model statement add ampersand register comma ampersand INCval. So here we specify the plus symbol in its label field, now next we specify the opcode. So here the opcode is add, now the next we expand here the next is ampersand register. The register is having the actual value irregister, so here we specify the value irregister. The second formal parameter is ampersand INCval. So INCval is having the actual value b, so here we specify the value b. Similarly, we expand the third model statement MOAM, ampersand register comma ampersand memoryval. So first of all here we specify the plus to differentiate between the original statement and the microexpanded statement. After that we specify the operation code. So here the operation code is MOAM, now the first formal parameter is ampersand register. Register is having the value irregister. So here we specify the irregister, now the second parameter is ampersand memoryval. So memoryval is having the value a, so here we specify the a. So this is the lexical expansion of the model statement. Now next we see the keyword parameters. For the keyword parameters the parameter name is simply an ordinary string and the parameter kind is the string equal to. Now the next we see the syntax of defining the keyword parameters ampersand parameter name equal to. The actual parameter specification in the keyword parameter is written as formal parameter name equal to ordinary string. Now next we see how to calculate the value of the formal parameter using the keyword association. Though the value of the formal parameter x, y, z is determined by the rule of the keyword association as follows. The first one is we have to find the actual parameter specification which has the form x, y, z equal to ordinary string. After that assume that there is a late ordinary string in the specification is some string a, b, c. Then the value of the formal parameter x, y, z is a, b, c. Now next we see the example of the keyword parameter. So this is the micro definition. The name of the micro is ir. It is having the three keyword parameters. The syntax of defining the keyword parameter is ampersand parameter name equal to. So here the ampersand memory value equal to, ampersand INC value equal to and ampersand registry equal to. These are the three keyword parameters for the given micro INCR. During the micro call a keyword parameter is specified by its name. Now the first micro call is the name of the micro. It is INCR. So here in the keyword parameter the parameter is specified by its first we specify the formal parameter name and then we specify their actual value. So first formal parameter is memory value. So here the mem value is having the actual value a. The second formal parameter is INC value. It is having the actual value b and the third formal parameter is register. It is having the actual value a register. So here in the keyword parameter the actual value is assigned by to the formal parameter by its name or we can say the second micro call. So again the name of the micro is what INCR. And here in the keyword parameter the order of the formal parameter can be changed. Means here first we specify the INC value and it is having the actual value b. Now next we specify the register formal parameter. It is having the actual value a register and the third we specify the mem value. It is having the actual value a. So in the keyword parameter we can change the order of the formal parameter but in the positional parameter we cannot change the order of the formal parameters. Now the third type of the type of the parameter is the default specification of parameter. The default specification of parameter is useful in the situations where a parameter has the same value in the most calls. When the desired value is different from the default value then the desired value can be specified explicitly in the micro call. So this overrides the default value of the parameter for the duration of the call. Now the next we see the syntax. So here first of all we specify ampersand parameter name. Next we specify the parameter kind and next we specify the default value. Now next we see the example of the default specification of parameter. So here the name of the micro is what INCRD. It is having the three parameters ampersand memory value equal to ampersand INCRD value equal to and ampersand register equal to a register. So here for the third formal parameter the default value is assigned to the register. So the value of the third formal parameter actual value is a register. Now next we see the there are three micro calls are there. In the first micro call the name of the micro is INCRD. So here the first formal parameter memory value is having the actual value a and the second formal parameter is having the value b. So here INC value is having the value b. But in the first micro call the third parameter is not specified. So the third parameter for the third register value it is using the default value a register. Similarly the second micro call INCRD here the INC value is having the value b and memory value is having the actual value a. So for the third formal parameter, there is a value is not specified. So here we use the default value that is specified in the prototype statement is the A register. So here the A register it is used in the third formal parameter. If you observe the third micro call, INCRD, the first formal parameter INCRD is having the value B, memory value is having the value A and here the register is having the value B register. That means here the register is, the default value is the A register, so during the micro call it overrides the default value and here we use the value B register. Now the next type of the parameter is micros with mixed parameter list. A micro definition may use both positional and the keyword parameters. In such a case all the positional parameters must precede all the keyword parameters in a micro call. Now next we see the example. So here the name of the micro is sum up it is having the four parameters, A, B, G equal to 20, H equal to X. So here A, B is the positional parameters and G equal to 20 and H equal to X, these are the keyword parameters. Now the last type of the parameter is the other uses of parameters. Know that the parameters is always appear in the operand field but the formal parameter can also be appear in the label and the upcode field of the model statement. So this is the definition of the micro. Here the name of the micro is calc. It is having the four parameters, ampersand X, ampersand Y. These are the positional parameters, ampersand op equal to mud. This is the keyword parameter with default value and ampersand lab equal to this is again a keyword parameter. Now if we observe here ampersand lab, this is a formal parameter. It is appear in the label field and in the model statement ampersand op, it is appear in the upcode field. Now next we see the micro call for this micro. So here calc A, B, lab equal to loop. Now next we see the formal parameters and their actual value. So here first formal parameter X, it is actually having the value A. The second formal parameter is Y, it is having the value B. Op is having the value mud and lab is having the actual value loop. Now next we see the expansion of this statement. So this is the lexical expansion of the model statement. So first model statement is ampersand lab MOAR A register comma ampersand X. So to differentiate between the original statement and the expanded statement, here we specify the plus symbol in its label field. So ampersand lab. So ampersand lab it is a formal parameter name. So lab is having the actual value loop. So here we specify the loop. Now next we specify the operation code. The here the operation code is MOAR. So here we specify the MOAR. Next we specify the A register and the next parameter is ampersand X. So X formal parameter having the actual value A. So here we specify the A. Similarly we expand the second model statement ampersand op A register comma ampersand Y. So op is again what? It is a formal parameter name. So op is having the default value mud. So here we see the mud is specified in the here. The first parameter is the A register. So here we specify the A register. The second formal parameter is ampersand Y. So Y is having the value B. So here we specify the B. Now the next model statement is MOAR A register comma ampersand X. So here we specify first of all plus. Now next we specify the operation code MOAM. Now next we specify the first formal parameter A register. And the second formal parameter is ampersand X. So here the X is having the value A. So here we specify A. After seeing the different types of the parameters, can you tell me in which kind of the parameter, the parameter kind is omitted. The options are positional parameter, keyword parameter, default specification, none of the above. Pause the video and think about it. The answer is positional parameter. In the positional parameter, the parameter kind is omitted. These are the references. Thank you.