Assembler Option
Technical Guide
MERANT™
Issue 3
June 1999
Audience
This technical guide is for Assembler programmers who need
information about the advanced features of the Assembler Option
component of Mainframe Express. The basic features and functions of
Assembler Option are described in the Mainframe Express User’s Guide
and the online help that is part of Mainframe Express.
Notation
The following type styles and conventions are used in this Guide:
Text that you type is shown like this:
cat script_name | more
The italic text denotes a variable that you type as part of the
command.
Optional text in command lines and code examples is shown in
square brackets. In the following example, the expression can
specify that the column_name is like the pattern_value, or is
not like the pattern_value, depending on the absence or
presence of the optional word NOT:
column_name [NOT] LIKE pattern_value
2 Run-time Considerations
2.1 Memory Requirements 2-1(13)
2.1.1 Reserving Memory for Execution 2-2(14)
2.1.2 How to Specify Your Memory Requirements 2-2(14)
2.1.2.1 Program Only Uses Memory Below the Line 2-3(15)
2.1.2.2 Program Only Uses Memory Above the Line 2-3(15)
2.1.2.3 Program Uses Memory Below and Above the Line 2-4(16)
2.1.3 Setting Residency Mode 2-5(17)
2.1.4 Using Subpools 2-5(17)
2.2 Macros and SVCs 2-6(18)
3 File Handling
3.1 Introduction 3-1(21)
3.2 Using QSAM for File Handling 3-2(22)
You can set directives in the IDE simply by making selections in the Build
Settings dialog box, at either project or program level. These appear in
Build Settings at the bottom of the page.
You can also enter directives not already set by typing them into
Additional Directives. As you type into Additional Directives, the
directives you add appear in Build Settings.
Directives set at project level automatically apply to all Assembler
programs within the project, unless you override them at program level.
The build settings are distributed over four Assembler pages in the Build
Settings dialog box: General, Link, Preproc (for Preprocessor) and Adv
(for Advanced). You can set directives to:
Create debug information. The compiler stores the debug
information in files progname.idf and progname.idx, where
progname is the name of your program.
Create optimized code. An optimized code compilation fully
resolves references to addresses in macro code. If the compilation of
your program involves the execution of many macros, you can
reduce the total compilation time by specifying this directive.
Mark the code as re-entrant. This has the same effect as marking
code as serially reusable.
Resolve external calls at link time; see the section Linking Modules
for more information.
Set addressing mode and residency mode; see the section Memory
Requirements in the chapter Run-time Considerations for more
information.
Create Assembler Analysis Tool files. These are files that assist in
the analysis of Assembler programs. For example, you could use
them to help you locate date fields that need changing to work
correctly in the year 2000 and beyond.
Linking modules when you build the project is known as static linking.
You can also link modules dynamically at execution time, when external
references in LINK or LOAD commands are resolved.
Since all the calls reference the modules’ external names, the Assembler
Compiler finds and locates all the called modules in your Assembler
source libraries, and builds the main and called modules into one .390
file.
3. Create a link file (.lin) that lists all the object files to be included
with the main module in the executable file.This link file must have
the same name as the main module. For example if the main
module has the name mymain.mlc, the link file must have the name
mymain.lin. See the section Link File INCLUDE commands for more
information about link files.
The TYPE parameter specifies the language of the called module and is
optional; it defaults to ASM (for Assembler) if the main module is
Assembler. The PARMS parameter specifies the number of parameters to
be passed to the called program; you only need to specify it if TYPE =
CBL (for COBOL) . There are options that allow you to call a COBOL IMS
program and to call a program with a variable number of parameters.
ENTRY. Use this command if the executable file you are building
may be called by another program, and you want all such calls to
enter the program at a particular entry point, rather than the
beginning of the program.
ALIAS. Use this command to create an alias for the executable file
that you are building. The alias is created in the Mainframe Express
entry point mapping file mfentmap.dat.
These link file commands are documented in full in the online help; click
Help Topics on the Mainframe Express Help menu, then on the Contents
tab click Reference, Assembler Option, Link File Commands.
Run-time
Considerations
Run-time Considerations
This chapter provides information about various aspects of the run-time
behavior of Assembler programs.
Run-time Considerations
2.1.2.1 Program Only Uses Memory Below the Line
If your program only needs to address memory below the line, you
should:
1. Set Max. memory below 16Mb line to the maximum amount of
memory below the line that your program requires. The default is
3Mb and the maximum is 16Mb.
2. Set Addressing mode to AMODE(24) for the main program and for
each program that the main program loads.
Notes:
Run-time Considerations
On the Advanced page of the Linker page in the Build Settings for
Project dialog box or the Build Settings for filename dialog box. Set
residency mode here for each Assembler program that does need a
separate link file to control the production of an executable code file.
Note: If you set AMODE to 31 and RMODE to 31, but the Assembler module
contains 24-bit addresses, the Linker overrides your RMODE setting and
loads the module below the line, and displays a warning message.
Run-time Considerations
5 FREEMAIN L LC LU E EC EU, Free memory (list, element and variable
VC, VU requests).
26 CATALOG and LOCATE Uncatalog a data set; return a volume list for a
data set.
120 GETMAIN RU, RC, VRC, VRU; Get memory (RU and RC type register requests)
FREEMAIN R, RU, RC, VRC Free memory (all types of register requests).
and VRU;
STORAGE Get memory or free memory
File Handling
File Handling
3.1 Introduction
Assembler Option provides file handling facilities for a subset of the data
set organizations supported by Mainframe Express. The following table
shows the data set organizations and access methods that you can use in
your Assembler programs:
Your files can have fixed, variable or Micro Focus line sequential record
formats. The length of the last record read or written is always available
in the LRECL field of the DCB.
In the case of variable-length records, each record is prefixed by a
four-byte mainframe-compatible record descriptor word (RDW).
Program Summary
File Handling
qsamex4.mlc Reads an ANSI text file (line sequential format ) and
writes the records to an EBCDIC PS file of
80-character fixed length records. The source and the
input file are in folder
\mfuser\projects\demo\asmdemo\source. This
sample program is very useful for converting ASCII
text files into 80-byte EBCDIC card-images to be
read by other Assembler programs.
Your blocked files can have fixed, variable or Micro Focus line sequential
record formats. Fixed length records are held in fixed length blocks,
while variable length records are held in variable length blocks. Line
sequential records are held in variable length blocks, one record per
block.
In the case of variable-length blocks, each block is prefixed by a four-byte
mainframe-compatible block descriptor word. Each record is normally
prefixed by its own record descriptor word, but processing this is the
responsibility of your Assembler program.
To use Micro Focus line sequential file organization, specify RECFM=T in
the DCB. The single record in each block must end with ANSI
carriage-return and line-feed characters (x"0D0A").
Your files can have fixed or variable record formats. The length of the last
record read or written is always available in the RECLEN field of the
request parameter list.
You can use one alternate index to access a VSAM KS files. You specify
alternate index access with the AIX option of the MACRF parameter of
the ACB macro.
Assembler Option does not support the following mainframe VSAM
options: reverse sequential processing, relative byte addressing, control
interval access, asynchronous input/output and multiple file positions.
Program Summary
File Handling
vsamex1.mlc Reads a variable-length KS file sequentially by key
and displays each record on the screen. The source
and input file are in folder
\mfuser\projects\demo\asmdemo\source.
Index
! C
&SYSPARM Assembler compiler directive CALL Assembler macro 1-5(11)
1-3(9) Catalog 3-2(22)
24-bit addressing 2-1(13) accessing at run time 2-6(18)
31-bit addressing 2-1(13) CICS Option, and Assembler Option 1-2(8)
.390 file 1-3(9) CLOSE Assembler macro 3-2(22)–3-4(24)
COBOL program, called by Assembler 1-5(11)
Compiler directive
AMODE 2-1(13)
A Assembler 1-1(7)
AAT, See Assembler Analysis Tool RMODE 2-1(13)
ACB Assembler macro 3-4(24) Compiling Assembler program, directive
Access method 3-1(21) 1-1(7)
control block 3-4(24) Control block, macro 3-2(22)
Addressing mode, Assembler program 2-1(13)
ALIAS command in link file 1-6(12)
Alternate, index 3-5(25) D
AMODE directive 2-1(13)
Assembler Analysis Tool 1-2(8) Data, control block 3-2(22)–3-3(23)
Assembler Option Data file, in Assembler Option 3-1(21)–3-6(26)
build settings 1-3(9) Data set
CICS commands 1-2(8) dynamic allocation 2-6(18)
file handling 3-1(21)–3-6(26) organization 3-1(21)
macro 1-2(8), 2-6(18), 3-2(22) DCB Assembler macro 3-2(22)–3-3(23)
memory management 2-1(13) Debugging, Assembler program 1-2(8)
program structure 1-3(9) Dynamic, allocation 2-6(18)
sample program 3-3(23), 3-5(25)
SVC 2-6(18)
Assembler program
addressing mode 2-1(13) E
calling a COBOL program 1-5(11) ENTRY command in link file 1-6(12)
compiling 1-1(7) Entry point, in Assembler module 1-4(10)
debugging 1-2(8) Entry point mapping 1-6(12)
entry point 1-4(10) EXLST Assembler macro 3-4(24)
entry point mapping 1-6(12) Extended, memory 2-1(13)
linking 1-3(9) External, name 1-4(10)
structure 1-3(9)
B F
File, link 1-3(9)
Blocked record format, conversion 3-3(23) FREEMAIN Assembler macro 2-5(17)
BSAM file handling 3-3(23)
Build settings, with Assembler Option 1-3(9)
G P
GENCB Assembler macro 3-4(24) PARMS parameter to link file commands
GET Assembler macro 3-2(22), 3-4(24) 1-6(12)
GETMAIN Assembler macro 2-2(14), 2-5(17) POINT Assembler macro 3-4(24)
Pre-compiled Assembler macro 1-2(8)
PUT Assembler macro 3-2(22), 3-4(24)
I
INCLUDE command in link file 1-5(11) Q
Index, alternate 3-5(25)
QSAM file handling 3-2(22)
K
Key, alternate 3-5(25)
R
Re-entrant code, Assembler program 1-2(8)
READ Assembler macro 3-3(23)
Record, format 3-1(21)–3-2(22), 3-4(24)
L Register, notation 3-2(22)
.lin file 1-3(9) Request
Line, sequential file 3-3(23)–3-4(24) macro 3-2(22)
Link file 1-3(9) parameter list 3-4(24)
command 1-5(11)–1-6(12) Residency mode 2-1(13)
LOAD Assembler macro 1-5(11) RMODE directive 2-1(13)
RPL Assembler macro 3-4(24)
M S
Macro 2-6(18), 3-2(22)
pre-compiled 1-2(8) Serially-reusable code, Assembler program
stub 2-6(18) 1-2(8)
Memory, access to extended 2-1(13) SHOWCB Assembler macro 3-4(24)
mfentmap.dat 1-6(12) STORAGE Assembler macro 2-2(14), 2-5(17)
MODCB Assembler macro 3-4(24) Stub macro 2-6(18)
Subpool 2-5(17)
Supervisor call 2-6(18)
SVC, See Supervisor call
N System, queue area 2-2(14)
NAME command in link file 1-6(12)
NONCAN link directive 2-5(17)
T
TESTCB Assembler macro 3-4(24)
O TYPE parameter to link file commands 1-6(12)
.obj file 1-3(9)
OPEN Assembler macro 3-2(22)–3-4(24)
Optimized code, Assembler program 1-2(8) V
Variable-length record 3-2(22), 3-4(24)
VSAM, file handling 3-4(24)
W
WRITE Assembler macro 3-3(23)
Index
Year 2000, Assembler Analysis Tool 1-2(8)