See macro recorder batch file and shell script Simply An assembly language that

See macro recorder batch file and shell script simply

This preview shows page 8 - 11 out of 38 pages.

blown programming language. See macro recorder , batch file and shell script . Simply, An assembly language that uses macros. A macro is a sequence of instructions, assigned by a name and could be used anywhere in the program.
Image of page 8
The macro is invoked by using the macro name along with the necessary parameters. When you need to use some sequence of instructions many times in a program, you can put those instructions in a macro and use it instead of writing the instructions all the time. Macro Processor - Macro Processor is a program that lets you define the code that is reused many times giving it a specific Macro name and reuse the code by just writing the Macro name only. Generally it doesn't come as a separate program but as a bundle to either assembler or compiler. There are three main steps of using a macro - 1.Define the macro name 2.Give it's definition 3.Use the macro name from within the program anywhere to use it's definition (this step is called macro call) And the most important thing is that, macro processing is done before the compilation replacing the code in place of macro calls and deleting macro definitions. One important use of these macros is for booting. During the boot time, the system uses a lot of macros to get itself started since they need not be compiled to use, but just macro processing is enough which is a small task. Three examples of actual macro processors 1. A macro processor designed for use by assembler language programmers 2. Used with a high-level programming language 3. General-purpose macro processor, which is not tied to any particular language Conditional Macro Expansion - The macro processor replaces each macro instruction with the corresponding group of source language statements. This is called macro expansion or expanding the macros. Conditional assembly are frequently considered to be mechanisms that allow a single version of the source code for a program to be used to generate multiple versions of the executable. Most macro processors can also modify the sequence of statements generated for a macro expansion, depending on the arguments supplied in the macro invocation. Conditional Assembly is
Image of page 9
commonly used to describe this feature. It is also referred to as conditional macro expansion. Conditional Assembly can be achieved with the help of – 1. AIF statements - It is used to specify the branching condition. This statements provides conditional branching facility. Syntax: AIF (condition) Label If condition is satisfied the label is executed else it continue with the next execution. It performs an arithmetic test and branches only if tested condition is true. 2. AGO statements - This statement provides the unconditional branching facilities. We do not specify the condition. Syntax : AGO. Label It specifies the label appearing on some other statement in the macro instruction definition. The macro processor continues the sequential processing of instructions with the indicated statement.
Image of page 10
Image of page 11

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture