SlideShare una empresa de Scribd logo
1 de 12
MACROS
Macro definition and
invocation
A macro is a block of text that has been
given a name. when MASM encounters the
name during assembly, it inserts the block
into the program. The syntax of macro is:
MACRO d1,d2,…dn
Statements
ENDM
macro_name is the user
supplied name for macro. The
pseudo-op macro & endm
indicate the beginning & end of
macro definition; d1,d2…..dn is
an optional list of dummy
argument used by the macro.
ILLEGAL MACRO
INVOCATION
There are often restrictions on the arguments
for a macro.
Arguments in movw macro must be:
Memory, Word, 16_bit register.
MOV AX,1ABCh
Generates the code
PUSH 1ABCh
POP AX
An immediate data push is
illegal for 8086/8088 this
results in an assembly
Example :-
MOVW MACRO WORD1,WORD2
;arguments must be
memory,words,16_bit register
PUSH WORD2
POP WORD1
ENDM
RESTORING
REGISTER
 Good programming practice requires that a procedure should
restore the register it uses, unless they contain output values.
The same is usually true for macros.
EXCH MACRO WORD1, WORD2
PUSH AX
MOV AX, WORD1
XHG AX,WORD2
MOV WORD1,AX
POP AX
ENDM
MACRO EXPANSION IN .LST FILE
.LST is a file that can be generated
when program is assembled.
It shows assembly code and the
corresponding machine code,
addresses of variables & other
information about the program.
.LST shows how macros are
expanded.
.LST FILE OPTIONS
After .SALL (suppress all),the
assembly code in a macro expansion
is not listed. You might want to use
this option for large macros, or if there
are a lot of macros invocations.
After .XALL only those source lines
that generates code or data are
listed…for e.g comment lines are not
listed. This is default options.
After .LALL (list all) all source lines
are listed, expect those start with(;;).
FINDING ASSEMBLY ERRORS
If MASM finds an error during
macro expansion, it indicates
an error at the point of the
macro invocation; however, its
more likely that the problem is
within the macro itself.
To find the mistake you need
to inspect the macro
expansion in .LST file.
LOCAL
LABELS
A macro with a loop r decision structure
contains one or more labels.
Macro invoked more than once , a duplicate
label appears, resulting in an assembly error.
This problem can b avoided by using local
labels
To declare them we use Local pseudo_op
SYNTAX: LOCAL list_of_labels
• List_of_lables is a list of
labels separated by
commas(,).
Every time the macro is expanded,
MASM assigns different symbols to
the labels in list.
The LOCAL directive must appear
on the next line after the MACRO
statement; not even a comment can
precede it.
PAGE:263,264
MACROS THAT
INVOKE OTHER
MACROS:

Más contenido relacionado

La actualidad más candente

basic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptxbasic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptxAnusha sivakumar
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationBIT Durg
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in JavaAbhilash Nair
 
Chapter 7 - Input Output Statements in C++
Chapter 7 - Input Output Statements in C++Chapter 7 - Input Output Statements in C++
Chapter 7 - Input Output Statements in C++Deepak Singh
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchartJordan Delacruz
 
Array of objects.pptx
Array of objects.pptxArray of objects.pptx
Array of objects.pptxRAGAVIC2
 
Data structure
Data structureData structure
Data structureMohd Arif
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array pptsandhya yadav
 
The msg box function and the messagebox class
The msg box function and the messagebox classThe msg box function and the messagebox class
The msg box function and the messagebox classFaisal Aziz
 
Interfacing With High Level Programming Language
Interfacing With High Level Programming Language Interfacing With High Level Programming Language
Interfacing With High Level Programming Language .AIR UNIVERSITY ISLAMABAD
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 
Binary expression tree
Binary expression treeBinary expression tree
Binary expression treeShab Bi
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Stack organization
Stack organizationStack organization
Stack organizationchauhankapil
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 

La actualidad más candente (20)

basic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptxbasic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptx
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
 
Chapter 7 - Input Output Statements in C++
Chapter 7 - Input Output Statements in C++Chapter 7 - Input Output Statements in C++
Chapter 7 - Input Output Statements in C++
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
Array of objects.pptx
Array of objects.pptxArray of objects.pptx
Array of objects.pptx
 
Data structure
Data structureData structure
Data structure
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
The msg box function and the messagebox class
The msg box function and the messagebox classThe msg box function and the messagebox class
The msg box function and the messagebox class
 
Interfacing With High Level Programming Language
Interfacing With High Level Programming Language Interfacing With High Level Programming Language
Interfacing With High Level Programming Language
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Binary expression tree
Binary expression treeBinary expression tree
Binary expression tree
 
Data structure using c++
Data structure using c++Data structure using c++
Data structure using c++
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Stack organization
Stack organizationStack organization
Stack organization
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 

Destacado

33443223 system-software-unit-iv
33443223 system-software-unit-iv33443223 system-software-unit-iv
33443223 system-software-unit-ivShaniya Fathimuthu
 
What's a macro?: Learning by Examples
What's a macro?: Learning by ExamplesWhat's a macro?: Learning by Examples
What's a macro?: Learning by Exampleschibochibo
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 
MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-IIIDr.YNM
 
Device Drivers
Device DriversDevice Drivers
Device DriversSuhas S R
 

Destacado (7)

33443223 system-software-unit-iv
33443223 system-software-unit-iv33443223 system-software-unit-iv
33443223 system-software-unit-iv
 
What's a macro?: Learning by Examples
What's a macro?: Learning by ExamplesWhat's a macro?: Learning by Examples
What's a macro?: Learning by Examples
 
Macro
MacroMacro
Macro
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-III
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 

Similar a Macros...presentation

Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfacsmadurai
 
Sas macros part 4.1
Sas macros part 4.1Sas macros part 4.1
Sas macros part 4.1venkatam
 
N_Asm Assembly macros (sol)
N_Asm Assembly macros (sol)N_Asm Assembly macros (sol)
N_Asm Assembly macros (sol)Selomon birhane
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSARASWATHI S
 
Unit ii-111206004636-phpapp01
Unit ii-111206004636-phpapp01Unit ii-111206004636-phpapp01
Unit ii-111206004636-phpapp01riddhi viradiya
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1venkatam
 
BAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 LectureBAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 LectureWake Tech BAS
 
Actionscript Standards
Actionscript StandardsActionscript Standards
Actionscript StandardsKapil Mohan
 
Writing command macro in stratus cobol
Writing command macro in stratus cobolWriting command macro in stratus cobol
Writing command macro in stratus cobolSrinimf-Slides
 

Similar a Macros...presentation (20)

Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdf
 
Ss4
Ss4Ss4
Ss4
 
Sas macros part 4.1
Sas macros part 4.1Sas macros part 4.1
Sas macros part 4.1
 
N_Asm Assembly macros (sol)
N_Asm Assembly macros (sol)N_Asm Assembly macros (sol)
N_Asm Assembly macros (sol)
 
handout6.pdf
handout6.pdfhandout6.pdf
handout6.pdf
 
Module 5.pdf
Module 5.pdfModule 5.pdf
Module 5.pdf
 
Unit 2
Unit 2Unit 2
Unit 2
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
 
Macro Processor
Macro ProcessorMacro Processor
Macro Processor
 
Macro
MacroMacro
Macro
 
MACRO ASSEBLER
MACRO ASSEBLERMACRO ASSEBLER
MACRO ASSEBLER
 
Handout#05
Handout#05Handout#05
Handout#05
 
Unit ii-111206004636-phpapp01
Unit ii-111206004636-phpapp01Unit ii-111206004636-phpapp01
Unit ii-111206004636-phpapp01
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
 
BAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 LectureBAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 Lecture
 
Actionscript Standards
Actionscript StandardsActionscript Standards
Actionscript Standards
 
Handout#04
Handout#04Handout#04
Handout#04
 
Tips of Malloc & Free
Tips of Malloc & FreeTips of Malloc & Free
Tips of Malloc & Free
 
Writing command macro in stratus cobol
Writing command macro in stratus cobolWriting command macro in stratus cobol
Writing command macro in stratus cobol
 

Más de fika sweety

Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performancefika sweety
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniquesfika sweety
 
Modeling and simulation ch 1
Modeling and simulation ch 1Modeling and simulation ch 1
Modeling and simulation ch 1fika sweety
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchartfika sweety
 
Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02fika sweety
 
Coal presentationt
Coal presentationtCoal presentationt
Coal presentationtfika sweety
 
1 Computer Architecture
1 Computer Architecture1 Computer Architecture
1 Computer Architecturefika sweety
 
Warehouse chapter3
Warehouse chapter3   Warehouse chapter3
Warehouse chapter3 fika sweety
 
Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performancefika sweety
 
Database security copy
Database security   copyDatabase security   copy
Database security copyfika sweety
 

Más de fika sweety (20)

Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performance
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniques
 
Plsql
PlsqlPlsql
Plsql
 
Shift rotate
Shift rotateShift rotate
Shift rotate
 
Graphss
GraphssGraphss
Graphss
 
Modeling and simulation ch 1
Modeling and simulation ch 1Modeling and simulation ch 1
Modeling and simulation ch 1
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Diversity (HRM)
Diversity (HRM)Diversity (HRM)
Diversity (HRM)
 
Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02
 
Coal presentationt
Coal presentationtCoal presentationt
Coal presentationt
 
1 Computer Architecture
1 Computer Architecture1 Computer Architecture
1 Computer Architecture
 
3 Pipelining
3 Pipelining3 Pipelining
3 Pipelining
 
19 primkruskal
19 primkruskal19 primkruskal
19 primkruskal
 
Warehouse chapter3
Warehouse chapter3   Warehouse chapter3
Warehouse chapter3
 
Storage memory
Storage memoryStorage memory
Storage memory
 
Quick sort
Quick sortQuick sort
Quick sort
 
Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performance
 
L2
L2L2
L2
 
Master theorem
Master theoremMaster theorem
Master theorem
 
Database security copy
Database security   copyDatabase security   copy
Database security copy
 

Último

Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringJuanCarlosMorales19600
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 

Último (20)

Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineering
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 

Macros...presentation

  • 2. Macro definition and invocation A macro is a block of text that has been given a name. when MASM encounters the name during assembly, it inserts the block into the program. The syntax of macro is: MACRO d1,d2,…dn Statements ENDM
  • 3. macro_name is the user supplied name for macro. The pseudo-op macro & endm indicate the beginning & end of macro definition; d1,d2…..dn is an optional list of dummy argument used by the macro.
  • 4. ILLEGAL MACRO INVOCATION There are often restrictions on the arguments for a macro. Arguments in movw macro must be: Memory, Word, 16_bit register. MOV AX,1ABCh Generates the code PUSH 1ABCh POP AX
  • 5. An immediate data push is illegal for 8086/8088 this results in an assembly Example :- MOVW MACRO WORD1,WORD2 ;arguments must be memory,words,16_bit register PUSH WORD2 POP WORD1 ENDM
  • 6. RESTORING REGISTER  Good programming practice requires that a procedure should restore the register it uses, unless they contain output values. The same is usually true for macros. EXCH MACRO WORD1, WORD2 PUSH AX MOV AX, WORD1 XHG AX,WORD2 MOV WORD1,AX POP AX ENDM
  • 7. MACRO EXPANSION IN .LST FILE .LST is a file that can be generated when program is assembled. It shows assembly code and the corresponding machine code, addresses of variables & other information about the program. .LST shows how macros are expanded.
  • 8. .LST FILE OPTIONS After .SALL (suppress all),the assembly code in a macro expansion is not listed. You might want to use this option for large macros, or if there are a lot of macros invocations. After .XALL only those source lines that generates code or data are listed…for e.g comment lines are not listed. This is default options. After .LALL (list all) all source lines are listed, expect those start with(;;).
  • 9. FINDING ASSEMBLY ERRORS If MASM finds an error during macro expansion, it indicates an error at the point of the macro invocation; however, its more likely that the problem is within the macro itself. To find the mistake you need to inspect the macro expansion in .LST file.
  • 10. LOCAL LABELS A macro with a loop r decision structure contains one or more labels. Macro invoked more than once , a duplicate label appears, resulting in an assembly error. This problem can b avoided by using local labels To declare them we use Local pseudo_op SYNTAX: LOCAL list_of_labels
  • 11. • List_of_lables is a list of labels separated by commas(,). Every time the macro is expanded, MASM assigns different symbols to the labels in list. The LOCAL directive must appear on the next line after the MACRO statement; not even a comment can precede it.