Assembler Programming Part 1
Code: ASM1Description
This is an entry level Assembly Language Programming workshop with a Commercial Application bias. Topics range from Syntax and the Assembly processing, through to code a basic application program including file processing. Whilst the emphasis is on 24/31-bit instructions, the newer 64-bit instruction set is discussed as appropriate. The workshop content is biased towards z/OS, but can be adapted to suite z/VSE if required.
Audience
This course is aimed at new system programmers, technical support and software programmers and application programmers who need the ability to write and debug assembly language programs and better understand the software that their installation uses.
Prerequisites
Attendees will need to be able to edit data using TSO/ISPF and have sufficient JCL knowledge to deal with any issues which may arise when performing the exercises.
Previous programming experience would be useful, but not essential.
Objectives
At the completion of this workshop, students will know how to use the IBM Assembler Programming Language and be able to:
- Access the correct manuals.
- Explain the general syntax and structure of the language.
- Explain register structure.
- Explain how data is addressed in storage.
- Demonstrate the ability to start and end programs correctly.
- Select and use appropriate instructions for moving data between registers and storage.
- Select and use appropriate instructions for moving data around storage.
- Use appropriate instructions to alter the logic flow of a program.
- Perform binary integer arithmetic.
- Perform decimal arithmetic.
Topics
Module 1 - Assembler Documentation
Discusses the various IBM manuals.
Describes the Assembly process.
Introduces the elements of the assembly listing.
Module 2 – Hardware Appreciation
Describes the structure of Virtual Storage.
Provides AMODE / RMODE definitions.
General Purpose Registers and the associated conventions.
Introduces the Program Status Word (PSW).
Describes addressability and relocation.
There are 2 exercises included in this module.
Module 3 – Getting Started
Assembler statement syntax.
CSECT statement.
Save Areas.
BAKR – Branch and Stack Instruction.
BASR – Branch and Save Instruction.
BR – Branch on Register Instruction.
L – Load instruction.
LA – Load Address Instruction.
LG – Load Instruction (64-bit).
LM – Load Multiple Instruction.
LMG – Load Multiple Instruction (64-bit).
PR – Program Return Instruction.
ST – Store Instruction.
STG – Store Instruction (64-bit).
STM – Store Multiple Instruction.
STGM – Store Multiple Instruction (64-bit).
USING – Assembler statement.
END – Assembler statement.
PRINT – Assembler Statement.
TITLE – Assembler Statement.
Module 4 - Data Areas
DC – Declare Constant Assembler statement.
DS - Define Storage Assembler statement.
Literals.
EQU – Assembler statement.
Simulated data structures (as per COBOL and PLI).
COPY – Assembler statement.
Placement of data areas.
Module 5 – Diagnostic Aids
Using the WTO macro.
Forcing an S0C1 ABEND.
Using the ABEND Macro.
Using the SNAP Macro.
Investigating an S0C7 ABEND.
Module 6 - Non-VSAM Queued I/O Macros
The difference between BSAM and QSAM.
OPEN Macro.
CLOSE Macro.
DCB Macro for both input and output sequential files.
GET Macro – Move Mode.
GET Macro – Locate Mode.
PUT Macro – Move Mode.
PUT Macro – Locate Mode.
Module 7 - Using Storage
MVC – Move Character Instruction.
MVI – Move Immediate Instruction.
MVCL – Move Character Long Instruction.
MVN – Move Numerics Instruction.
MVO – Move with Offset Instruction.
MVZ – Move Zones Instruction.
EX – Execute Instruction.
Module 8 - Decision Making
PSW format.
Condition Codes.
BC – Branch on Condition Instruction.
BCR – Branch on Condition Register Instruction.
Extended mnemonics.
CLC – Compare Logical Character Instruction.
CLCL – Compare Logical Character Long Instruction.
CLI. – Compare Logical Immediate Instruction.
BCT – Branch on Count Instruction.
BCTG – Branch on Count Instruction (64-bit).
BCTGR – Branch on Count Register Instruction (64-bit).
BCTR – Branch on Count Instruction.
C – Compare Instruction.
CH – Compare Half-word Instruction.
CR – Compare Register Instruction.
Module 9 - Using Registers
IC – Insert Character Instruction.
ICM & ICMH– Insert Character under mask Instructions.
LH – Load half-word Instruction.
LGR – Load Register (64-bit).
LR – Load Register.
LTR – Load and Test Register.
STC – Store Character Instruction
STCM & STCMH – Store Character under Mask Instructions.
STH – Store Half-word instruction.
Module 10 - Redefining Storage
DSECT – Assembler statement.
ORG – Assembler statement.
Module 11 – Data Conversion
PACK – Pack Instruction.
UNPK – Unpack Instruction.
CVB – Convert to Binary Instruction.
CVBG – Convert to Binary Instruction (64-bit).
CVD – Convert to Decimal Instruction.
CVDG – Convert to Decimal Instruction (64-bit).
OI – Or Immediate instruction.
What constitutes a valid decimal sign.
TR – Translate instruction.
TRT – Translate and Test instruction.
Module 12 – Binary Integer Arithmetic
A – Add instruction.
AG – Add instruction (64-bit).
AGR – Add Register Instruction (64-bit).
AH – Add Half-word Instruction.
AR – Add Register Instruction.
D – Divide Instruction.
DR – Divide Register Instruction.
M – Multiply Instruction.
MH – Multiply Half-word Instruction.
MR – Multiply Register Instruction.
S – Subtract Instruction.
SG – Subtract Instruction (64-bit).
SGR – Subtract Register Instruction (64-bit).
SH – Subtract Half-word Instruction.
SR – Subtract Register Instruction.
Module 13 – Decimal Arithmetic
PACK – Pack Instruction.
AP – Add Packed Instruction.
CP – Compare Packed Instruction.
DP – Divide Packed Instruction.
ED – Edit Instruction.
EDMK – Edit and Mark Instruction.
MP – Multiply Packed Instruction.
SP – Subtract Packed Instruction.
SRP – Shift and Round Packed Instruction.
ZAP – Zero and Add Packed Instruction.
Module 14 – File Processing (ESDS)
ACB Macro.
ENDREQ Macro.
EXLST Macro.
GENCB Macro.
MODCB Macro.
OPEN Macro.
CLOSE Macro.
GET Macro.
PUT Macro.
RPL Macro.
SHOWCB Macro.
Appendix – The Linkage Editor / Program Binder
Overview of functionality.
Purpose of SYSLIN.
Purpose of SYSLMOD.
The INCLUDE statement.
The NAME Statement.
Brief description of other statements.
Brief description of PARM options.
Price (ex. VAT)
Duration
Delivery methods
- Classroom
- On-site (at your location)
- Virtual (instructor online)