COMPUTER ORGANIZATION
& ASSEMBLY LANGUAGE
LECTURE ON MACRO PROGRAMING WEEK 13 PRACTICAL
BY MUHAMMAD JAFER
1
MACRO PROGRAMMING
• Some Code required Again & Again
• Some required in a sequence
• Rewriting A Issue
• Writing a Task or group of Task for a Job once
• Invoke it When Required
• This process is called Macro
2
MACRO SYNTAX
• Name MACRO Arg1, Arg2,….
• BODY
• ENDM
• Calling A MACRO
• Name Arg1,…..
3
MACRO COMMENTS
• ; - Assembler Identifiable
• ;; - Non-Assembler Identifiable
• Three Important Command
• .LALL (List ALL)
• .SALL (Suppress ALL)
• .XALL (eXecutable ALL)
4
LOCAL DIRECTIVES
• Needed for Labels In Macro
• Define after Macro first list
• If not used Errors by assembly due to duplication
• Local name1,name 2, ….
5
INCLUDE DIRECTIVES
• INCLUDING A MACRO from external directory
• MYMACRO.MAC
• INCLUDE MYMACRO.MAC
6
CHAPTER REVIEW
• The x86 PC Assembly Language, Design &
Interfacing
• Chapter # 4
• What is a Macro & How is it used?
7

Coal 21- macro in Assembly Programming

  • 1.
    COMPUTER ORGANIZATION & ASSEMBLYLANGUAGE LECTURE ON MACRO PROGRAMING WEEK 13 PRACTICAL BY MUHAMMAD JAFER 1
  • 2.
    MACRO PROGRAMMING • SomeCode required Again & Again • Some required in a sequence • Rewriting A Issue • Writing a Task or group of Task for a Job once • Invoke it When Required • This process is called Macro 2
  • 3.
    MACRO SYNTAX • NameMACRO Arg1, Arg2,…. • BODY • ENDM • Calling A MACRO • Name Arg1,….. 3
  • 4.
    MACRO COMMENTS • ;- Assembler Identifiable • ;; - Non-Assembler Identifiable • Three Important Command • .LALL (List ALL) • .SALL (Suppress ALL) • .XALL (eXecutable ALL) 4
  • 5.
    LOCAL DIRECTIVES • Neededfor Labels In Macro • Define after Macro first list • If not used Errors by assembly due to duplication • Local name1,name 2, …. 5
  • 6.
    INCLUDE DIRECTIVES • INCLUDINGA MACRO from external directory • MYMACRO.MAC • INCLUDE MYMACRO.MAC 6
  • 7.
    CHAPTER REVIEW • Thex86 PC Assembly Language, Design & Interfacing • Chapter # 4 • What is a Macro & How is it used? 7