Page 11 - DCAP102_DCAP_401_Foundations of Computer Programming
P. 11

Basic Programming Skills/Foundations of Computer Programming




                    Notes          There are two ways of converting an assembly language program into machine language:

                                   1.  Manual assembly
                                   2.  By using an assembler.
                                   Manual Assembly: It was an old method that required the programmer to translate each opcode
                                   into its numerical machine language representation by looking up a table of the microprocessor
                                   instructions set, which contains both assembly and machine language instructions. Manual
                                   assembly is acceptable for short programs but becomes very inconvenient for large programs. The
                                   Intel SDK-85 and most of the earlier university kits were programmed using manual assembly.
                                   Using an Assembler: The symbolic instructions that you code in assembly language is known
                                   as - Source program.

                                   An assembler program translates the source program into machine code, which is known as
                                   object program.














                                   The steps required to assemble, link and execute a program are:

                                   1.  The assembly step involves translating the source code into object code and generating an
                                       intermediate .OBJ (object file) or module.

                                       The assembler also creates a header immediately in front of the generated .OBJ module;
                                       part of the header contains information about incomplete addresses. The .OBJ module is
                                       not quite in executable form.
                                   2.  The link step involves converting the .OBJ module to an .EXE machine code module. The
                                       linker’s tasks include completing any address left open by the assembler and combining
                                       separately assembled programs into one executable module.
                                       The linker:

                                       (a)  combines assembled module into one executable program
                                       (b)  generates an .EXE module and initializes with special instructions to facilitate its
                                            subsequent loading for execution.

                                   3.  The last step is to load the program for execution. Because the loader knows where the
                                       program is going to load in memory, it is now able to resolve any remaining address still
                                       left incomplete in the header. The loader drops the header and creates a program segment

                                       prefix (PSP) immediately before the program is loaded in memory.
                                   Tools Required for Assembly Language Programming

                                   The tools of the assembly process described may vary in details.










          4                                LOVELY PROFESSIONAL UNIVERSITY
   6   7   8   9   10   11   12   13   14   15   16