High Level Assembler: Macro Programming.
This course covers the macro facilities available with the High
Level
Assembler. It also discusses advanced macro programming techniques,
such as abstract data types, inheritance and function overlaying.
The course is intended for:
- Experienced Assembler programmers needing to brush up on their
macro
programming skills.
- Assembler programmers with some experience needing to expand
their
understanding of macro facilities available.
This overview comes in three parts, which are presented in sequence
below:
- Course Description
- Course Objectives
- Topical Outline
Recommended Duration: 2 Days
Benefits: Students who complete this course will be able to write
or maintain macros
for Assembler programs. The emphasis is on learning the relevant
macro
facilities available as well as learning to use them to implement an
advanced programming environment.
Audience: Experienced Assembler programmers needing to acquire
additional macro
programming skills.
Prerequisites: At the very least the student entering this course
should have background
in using ISPF/PDF or a similar product used for creating programs
and
submitting jobs. Some experience in writing programs in Assembler.
Related IBM Materials. With IBM's permission this course is based
upon John Ehrman's SHARE
presentation "Assembler as a Higher Level Language: Macros and
Conditional Assembly Techniques".
Access to the following IBM manual in the classroom is recommended
(via hardcopy, BookManager, etc.):
- SC26-4940 - High Level Assembler reference
Major Topics Include:
- Conditional Assembly Language
- Statement Selection
- Statement Generation and Substitution
- External Conditional Assembly Functions
- Debugging Conditional Assembly Language
- Macro Facility concepts
- Macro Definition
- Macro Comments and Readability
- Macro Parameters
- Macro Arguments Attributes
- Global Variables
- Macro Debugging Techniques
- Defining Symbols
- Generating a Sequence of Values
- MVC with Source Operand's Length
- Converting between Hex and Decimal
- Named Integer Constants
- AREAD and AINSERT
- Macro Recursion
- Bit handling
- Advanced Bit Handling
- Defining and Using Data Types
- Type Checking
- Encapsulated Abstract Data Types
- Front-ending Macros and Instructions
On successful completion of this course, the student, with the aid
of the
appropriate reference materials, should be able to:
- Enhance assembler programs with conditional assembly techniques
to support program variations from a single source.
- Define and create assembler macros using the following
techniques:
- Source and/or macro library definitions
- Nested macro definitions
- Nested and/or recursive macro calls
- Keyword parameters and/or positional parameters
- Processing of sublists of parameters
- Inheritance and function overlaying (polymorphism)
- Abstract data types, encapsulation and type checking
- Front-ending or replacing existing macros and/or instructions
- Document the programs and macros with comments to assist in
maintenance
and understanding of the code
- Debug the resulting code of errors
Day One
Conditional Assembly and Macro Overview
The Conditional Assembly Language
- Evaluation, Substitution, and Selection
Variable Symbols
- Declaring Variable Symbols
- Substitution
- Comments on Substitution, Evaluation, and Re-scanning
Assigning Values to Variable Symbols
- Evaluating Conditional-Assembly Expressions
- Evaluating and Assigning Arithmetic Expressions
- Internal Arithmetic Functions
- SETA statements vs EQU Statements
- Evaluating and Assigning Boolean Expressions
- Evaluating and Assigning Character Expressions
- String Concatenation
- Substrings
- String Lengths
- Internal Character Functions
- External Conditional-Assembly Functions
- Conditional Expressions with Mixed Operand Types
Displaying Variable Symbol Values
Statement Selection
- Sequence Symbols
- The ANOP Statement
- The AGO Statement
- The Extended AGO Statement
- The AIF Statement
- The Extended AIF Statement
- Logical Operators in SETx and AIF Statements
Examples of Conditional Assembly
- Example 1: Generate a Sequence of Byte Values
- Example 2: Generating System-Dependent I/O Statements
Conditional Assembly Language Eccentricities
Basic Macro Facility Concepts
- What is a Macro Facility
- Benefits of Macro Facilities
The Macro Concept: Fundamental Mechanisms
- Text Insertion
- Text Parameterization and Argument Association
- Text Selection
- Macro Call Nesting
- Macro Definition Nesting
The Assembler Language Macro Definition
- Macro Instruction Definition Example
- Macro Instruction Recognition Rules
- Macro Instruction REcognition Details
- Macro Definition Encoding
- Nested Macro Definition in High Level Assembler
- Macro Expansion, Generated Statements, MEXIT
Macro Comments and Readability Aids
- Example 1: Define Equated Symbols for Registers
Macro Parameters and Arguments
- Macro Definition Parameters
- Macro Instruction Arguments
- Macro Parameter-Argument Association
- Example 2: Generate a Sequence of Byte Values
- Macro Parameter Usage in Model Statements
Macro Argument Attributes and Structures
- Macro Instruction Argument Properties: Type Attribute
- Macro Instruction Argument Properties: Count Attribute
- Macro Instruction Argument Properties: Number Attribute
- Macro Instruction Argument Lists and Sublists
- Macro Instruction Argument Lists and &SYSLIST Variable
Symbol
Global Variable Symbols
- Variable Symbol Scope Rules: Summary
Macro Debugging Techniques
- Macro Debugging: The MNOTE statement
- Macro Debugging: The MHELP statement
- Macro Debugging: The ACTR statement
- Macro Debugging: The LIBMAC option
- Macro Debugging: The PRINT MCALL statement
IBM Macro Libraries
Day Two
Macro Techniques
- Macro Techniques Case Studies
Case Study 1: Defining Equated Symbols for Registers
Case Study 2: Generating a Sequence of Byte Values
Case Study 3: 'MVC2' Macro Uses Source Operand Length
Case Study 4: Conversion Between Hex and Decimal
- Macro-time Conversion from Hex to Decimal
- Macro-time Conversion from Decimal to Hex
Case Study 5: Generate a List of Named Integer Constants
Case Study 6: Using the AREAD Statement
- Case Study 6a: Creating Length-Prefixed Message Texts
- Simple Prefixed Message Text
- More General Prefixed Message Text
- Prefixed Message Text with the AREAD Statement
- Case Study 6b: Block Comments
Case Study 7: Macro Recursion
- Recursion Example 1: Indirect Addressing
- Recursion Example 2: Factorial Function Values
- Recursion Example 3: Fibonacci Numbers
Case Study 8: Defining Macros for Bit-Handling Operations
- Basic Bit-Handling Techniques
- Case Study 8a: Bit-Handling Macros - Simple Forms
- Simple Bit-Manipulation Macros
- Simple Bit-Manipulation Macros: Setting Bits ON
- Simple Bit-Manipulation Macros: Setting Bits OFF
- Simple Bit-Testing Macros
- Case Study 8b: Bit-Handling Macros - Advanced Forms
- Bit-Handling 'Micro Language' and 'Micro Compiler'
- Declaring Bit Names
- Improved Bit-Manipulation Macros
- Using Declared Bit Names in a BITON Macro
- Using Declared Bit Names in a BBITON Macro
Case Study 9: Defining and Using Data Types
- Case Study 9a: Type Sensitivity - Simple Polymorphism
- Shortcomings of Assembler-Assigned Types
- Symbol Attributes and Lookahead Mode
- Case Study 9b: Type Checking
- Instruction-Operand Type Checking
- Instruction-Operand Type Checking (Generalized)
- The AINSERT Statement
- User-Defined Assembler Type Attributes
- Instruction-Operand-Register Type Checking
- Case Study 9c: Encapsulated Abstract Data Types
- Calculating with Date Variables
- Calculating with Interval Variables
- Comparison Operators for Dates and Intervals
Case Study 10: Front-Ending a Macro
External Conditional Assembly Functions
- SETAF External Function Interface
- Arithmetic-Valued Function Example: LOG2
- SETCF External Function Interface
- String-Valued Function Example: REVERSE
- Installing the LOG2 and REVERSE Functions
Remarks? Questions? More information? Select the topic of your
choice or
e-mail us with your
questions.
To the Course Description
To the Course Objectives
To the Topical Outline
This site is a member of WebRing.
You are invited to browse the
list of mainframe-loving sites.
|
|
Dinos are not dead. They are alive and well and living in data
centers all
around you. They speak in tongues and work strange magics with
computers.
Beware the dino! And just in case you're waiting for the final
demise of
these dino's: remember that dinos ruled the world for 155-million
years!
|
Dinos and other anachronisms
[
Join Now
|
Ring Hub
| Random
|
<< Prev
|
Next >>
]
|