Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:papc:chapter_6_13 [2025/11/13 11:49] ktokarzen:multiasm:papc:chapter_6_13 [2026/02/20 10:15] (current) – [Macro functions] ktokarz
Line 1: Line 1:
 ====== Macros ====== ====== Macros ======
-Macros are elements of language that enable the replacement of one text with another. In assembler language, macros can be implemented differently in different assemblers understood as programming software. In this chapter, we'll present the MASM implementation. Although in other assemblers (NASM, NASM) the syntax can differ, the idea remains the same. There are a few types of macros in MASM:+Macros are elements of language that enable the replacement of one, usually shorter textwith another. In different assemblers (NASM, FASM), macros can be implemented differently.  The syntax can differ, but the idea remains the same. In this chapter, we'll present the MASM implementation. There are a few types of macros in MASM:
   * Text macros,   * Text macros,
   * Macro procedures,   * Macro procedures,
Line 201: Line 201:
 ===== Macro functions ===== ===== Macro functions =====
  
-A macro function is a macro which returns a value. As all macros are tex processing feature macro functions always return text. Returning the value is possible with the use of the **EXITM** directive. Argument of the **EXITM** must be text or the result of another macro function. Numeric values must be converted to text form with the expansion operator %.+A macro function is a macro which returns a value. As all macros are texts, macro functions always return text. Returning the value is possible with the use of the **EXITM** directive. Argument of the **EXITM** must be text or the result of another macro function. Numeric values must be converted to text form with the expansion operator %.
  
 ===== Predefined macro functions ===== ===== Predefined macro functions =====
Line 211: Line 211:
 name CATSTR string [[, string ]] name CATSTR string [[, string ]]
  
-name TEXTEQU @SubStr string, start [, length ] +name TEXTEQU @SubStr (string, start [, length ]) 
-name TEXTEQU @InStr [[start]], string, substring +name TEXTEQU @InStr ([[start]], string, substring) 
-name TEXTEQU @SizeStr string +name TEXTEQU @SizeStr (string) 
-name TEXTEQU @CatStr string [[, string ]]+name TEXTEQU @CatStr (string [[, string ]])
 </code> </code>
  
en/multiasm/papc/chapter_6_13.1763027398.txt.gz · Last modified: by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0