 Hello everyone. Today we are going to see the direct linking loader. Learning outcome at the end of this session, students will be able to explain the direct linking loader and its disadvantages. Now, first we see the direct linking loader. Direct linking loader is the most common type of loader. It is a relocatable loader. The loader cannot have the direct access to the source code. And to place the object code in the memory, there are two situations. Either the address of the object code could be the absolute, which can be directly placed in the memory. And if the address is relative, then it is the assembler's responsibility who informs the loader about their relative addresses. The assembler should give the following information to the loader. First, the length of the program. Next, a list of external symbols means a list of all the symbols in the segment that may be referenced by other segments and their relative locations within the segment. A list of external symbols means a list of all the symbols that is not defined in the segment, but it is referenced in the segment. Now, next it provides the information about address constants, means information as to where the address constants are located in the segment and a description of how to revise their values. And also it provides the machine code translation of the source program and their relative addresses assigned. Now, next the assembler produces four types of cards in the object code. They are first is the external symbol directory card, next text card, third is the relocation and the linkage directory card, and fourth is the end card. Now, first we see the external symbol directory card. The external symbol directory card contains the information about all the symbols that are defined in the present program, but that may be referenced somewhere and also it contains all the symbols that is referenced in this program, but defined elsewhere. Now, the ESD card contains the reference number, symbol name, type, the relative location and the length. Here the type may contains SD, SD means segment definition, LD, local definition and ER means external references. Now, next card is the text card. The text card contains the actual object code that is translated version of source program. Now, third is the relocation and linkage directory card. It contains the information about those locations in the program whose contents depends on the addresses at which the program is placed. For such functions, for such locations the assembler must supply information enabling the loader to correct their content. The RLD card contains the following information. The location of each constant that need to be changed due to the relocation, by what it has to be changed and third is the operations to be performed. The format of the RLD card contains first it contains the reference number, then it contains the symbol, then flag, then it contains the length and after that it contains the relative location. Now, next card is the end card. The end card indicates the end of the object and it specifies the starting address for the execution of the assembled program. Now, we can see a simple example using a direct linking loading scheme. It's presented in the figure. A source program that is on the left hand column is translated by an assembler to produce the object code that is shown in the right hand column. Memonics machine codes have again been used in the translation shown in the figure. Card number 14 of figure contains a defined constant pseudo operation which which instructs the assembler to create a constant with the value of the address of table and cause this constant to be placed in the location that is labeled pointer. At this point the assembler does not know the final absolute address of the table. Since it has no idea where the program is going to be loaded, it knows that the address is the 28th byte from the beginning of this program. Then the assembler will put a 28th in the pointer and it informs the loader that the content of the location pointer is incorrect. If this program is loaded anywhere except the absolute location 0, then for this instance if this program were loaded in the location 2000, the loader would have to change the content of the pointer to be a 2028. Similarly card number 17 of figure is another DC operation which instructs the assembler to create a constant with the value of the address of subroutine sum and that causes and this cause this constant to be placed in the location that is labeled a sum. Since the assembler has no idea where the procedure sum will be loaded, then it cannot generate this constant. Thus the assembler must provide information to the loader that will cause it to put the final absolute address of sum at the designated location. When the program are loaded, we have named the program John because John is a symbol that may be referenced externally or we called by the other programs. Now next we see the EST. EST cards as shown in the figure it contains the three EST cards are needed for the program John. The first card contains the name of the program John which may be referenced externally. The type memonics we have used is SD which means the symbol is a segment definition. The relative address of John is 0 and the length is of the program that John denotes is 64. On the next EST card appears the symbol result which is a local definition and its relative address is 52. The final EST card specifies that the symbol sum is an external reference. Now next card is the text card. Text card contains the actual assembled program. Now third is the RLD card. The RLD card contains the following information. The first RLD card of our example contains a 48. It is denoting the relative location of the constant that must be changed. Here a plus sign denoting that something must be added to the constant and the symbol field indicating that the value of the external symbol John must be added to the relative location 48. The relative value of John is 0 when the program is loaded the loader will determine its absolute value. The second RLD card of our example contains a 60. It is denoting the relative location of the constant that must be changed. The symbol field indicates that the value of the external symbol sum must be added to relative location 60 but although the assembler does not know the absolute address of sum then the loader will later be able to fill in the correct value. The process of addressing the address constant of an internal symbol such as stable is normally called relocation while the process of supplying the contents of an address constant for an external symbol such as sum is normally referred to as a linking. Significantly the RLD card mechanism is used for both cases. Now next we see the example of object deck for direct linking loader. First it contains the ESD card, after that it contains the text card, next it contains the RLD card and after that it contains the in card. Now next we see the disadvantages of direct linking loader. It is necessary to allocate, relocate, link and load all the subroutines each time in order to execute a program. Even though loader program smaller than the assembler it absorbs the considerable amount of memory. Now after seeing the concept of direct linking loader can you tell me how many types of cards are produced by the assembler in the object code and list out them. Pause the video and think about it. The answer is four types of cards are produced by the assembler in object code. There first it produces external symbol electric card then it produces the text card then it produces the relocation and linkage card and after that it produces the in card. Now these are the references. Thank you.