Listen to your teachers when they tell you WHAT to do. But more importantly, think about it later and ask yourself WHY they told you to do it.
--Your friends at LectureNotes

Note for System Programming - SP by Tushar Mehndiratta

  • System Programming - SP
  • Note
  • Computer Science Engineering
  • B.Tech
  • 7 Topics
  • 1 Offline Downloads
  • Uploaded 3 months ago
Tushar Mehndiratta
Tushar Mehndiratta
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-2

Introduction  Macro is a feature provided in pgm language  Macro Definition defines new operation  Macro call in program is invocation of new operation  Leads to prg generation facility through macro expansion.  Macro Expansion – Macro call replaced by sequence of statement

Text from page-3

Cont.  “A macro is a unit of specification for program generation through expansion.  Macro consist of name, a set of formal parameters and a body of code.  “The use of macro name with a set of actual parameters is replaced by some code generated from its body, this is called m acro expansion.”

Text from page-4

Cont.  In Assembly lang, Two ways to handle Macro 1) Macro Assembler 2) Macro Preprocessor  Macro Assembler does expansion of macro calls and also assembles resulting assembly prog.  While Macro Preprocessor merely does expansion and produces assembly prog.

Text from page-5

Cont.  Two kind of expansion  Lexical expansion: Lexical expansion implies replacement of character string by another character string during program generation. ◼ Lexical expansion is typically employed to replace occurrences of formal parameter by corresponding actual parameters. ◼  Semantic Expansion: Semantic expansion implies generation of instructions tailored to the requirements of a specific usage ◼ Example: generation of type specific instruction for manipulation of byte and word operands. ◼

Lecture Notes