Essential Assembler and Machine Language Concepts

machine language alp format modular programming n.w
1 / 11
Embed
Share

Explore the core concepts of machine language, ALP format, modular programming, linking, and relocation as explained by K.S.V. Sambasiva Rao. Understand the structure of instructions, operands, and the role of assemblers in translating instructions. Dive into the nuances of assembler language and the design features of ASM-86 by Intel, emphasizing the importance of high-level language experience in assembly programming.

  • Assembly Programming
  • Machine Language
  • ALP Format
  • Modular Programming
  • Assembler

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. MACHINE LANGUAGE, ALP FORMAT, MODULAR PROGRAMMING,LINKING AND RELOCATION K.S.V.SAMBASIVARAO HEAD,DEP.OF.ELECTRONICS

  2. MACHINE LANGUAGE An instruction is divided into bits (or) fields with one field called operation code (op-code) and other field is called operand. Indicate the information needed an instruction carry out in task. An operand may contain a data at least a part of instruction of data, an index pointer to address. Instruction may contain several operands more memory they will occupy and more time it will take to transfer instruction into c.p.u. In order to minimize the total no. of bits in an instruction, most instruction are of 16-bits which are limited to one or two operands with at least one operand in two operand instruction involving a register. The memory and/or input/output spaces are relatively large memory input/output address require several bits because the no. of register is small. It takes only a few bits to specify a register. The 2ndoperand limitations reduce to flexibility of much instruction but normally extra flexibility is not really needed. Op-code Operand1,operand2---

  3. ASSEMBLER LANGUAGE In machine language instruction, a machine code consists of 0&1 combination and the computer decodes directly. In assembler language code, there a 2 types of statements: In which the instruction is translated into machine language instruction by assembler. Directives which give the direction to assembler during the assembler process but are not translated into machine instructions. Typical assembler language ADD AX, COST Add the contents of memory location associated with identifier cost to register AX. Cost DW-eg of directive it causes the assembler to result a word and associate the identifier cost with the word but does not result in machine language instructions.

  4. Assembler in this book ASM-86 designed by Intel features that are experienced in high level language must also be assembled in assembler language. Although even a single high-level language requires several assembler statements to implement it. In addition, including ways of performing branches, loops, input- output Operations, assignment where as assembler require (or) needs to provide excellent. Pre-assignment storage allocation clearing of constants connecting, coil procedures, stmt functions and global labeling.

  5. ASSEMBLER INSTRUCTION FORMAT: The general format of assembler instruction is label: Mnemonic operand, operand ;comments where inclusion of spaces is arbitrary except at least one space must be inserted, if no space, it would be treated as ambiguity. A label is an identifier i.e., assigned the address of 1st byte of instruction, the presence of label is the optional in an instruction but label provides a symbolic name that can be used in branch instruction. If there is no label, the columns must be deleted. The presence of operand depends on instruction. Some instructions have no operands, some have one and some have two. If there are two operands they must be separated by comma(,). If there are two operand, the destination operand appears 1st and source operand appears 2nd. The comment may contain combination of characters if it is optional it is deleted, then semicolon(;) is also deleted. A typical assembler instruction, one which uses register relative r and register addressing mode to add a memory location to AX. Word operand the low order byte has low address and high order byte has high address. Ex: Identifier Cost is used as word operand, cost acts as low order byte.

  6. MODULAR PROGRAMMING In this the instructions are combined together to perform a task. Most useful program are simple program and complex program. In complex program the module is divided into sub modules to perform several tasks. All these tasks are combined to form a modular programming. The high level language the program can be executed as: 1. Perform what program to do. 2.Break over all program into task. 3. Defining each task must do and how it communicates with other task. 4. Put task in assemble language module and communicate and modular together. 5. Debugging and testing. 6.Documentation of program In main hardware circuit design we required components And then inserted on PCB and later integrated them in desired system. The modular programming can be understand by hierarchical diagram It gives the relationship between module (task) and sub-module (sub-task). In this main module is president of corporation and principal sub modules are A,B,C ------- i.e Principal as main module and sub module are vice principal, staff members.

  7. Modules are used to depending on following factors: Module is easy to understand. Different modules assigned to different programmers. Modification can be localized. Debugging and testing. Documentation of program Module stored in libraries used by several programs.Modules are entered and excited by having control coupling in which information is communicated between modules In data coupling the coupling between two modules depends on several factors whether they are assigned together (or) separate organization of data. In most assembler process the modulation process can be done in three ways: Data to be structured and it is accessed by various modules. Stacks, procedures (or) sub-routines. Permit session of code like macro having single statement and contain name and set of arguments.

  8. LINKING AND RELOCATION To construct a program some program modules may be put in some source module and assembled together. Others may be different source module and they assembled separately. If they are assembled separately then the main module which has first instruction to be executed and terminated by END statement and some other modules may be terminated by END statement with no operand. In any event resulting objective module some of which may be grouped into library must be linked together to form load module In addition to output in the load module the linker prints a memory map that indicates where the linked objective modules were loaded in the memory After the load module has been created it is loaded in the memory of computer by loader and execution begins Normally the input and output done by input output drivers that is a part of operating system In MASM.86 software linker , it is divided into two parts One being called linker and other as locater

  9. Here loading is done by operating system. The linker and loader combination must make all segment and address assignment that are needed to allow the program to work properly. The combination must have: To find the objective module to be linked Construct load module by assigning the position all the segments in all objective modules being linked. Fill in all offset that can be determine by assembler. Fill in all segment address Load the program for execution. The objective modules to be link are determined by naming the is command by the operating system searching through libraries Intel MASM-86 software allows the user to specify the module and segment ordering in details.

  10. DIAGRAM:

  11. THANK YOU

More Related Content