Building an Assembler program and debugging it using symbolic Assembler debug
You might want to build an Assembler program and debug it using the symbolic Assembler debug by passing the values for the user-specified variables in the JCL procedure.
Copy the
Assemble procedure ELAXFASM to another procedure called ASMDEBUG.
Edit ASMDEBUG to add the step named XTRACT, which extracts the debug
information from the ADATA file that is created from the Assemble
step. The following example shows the ASMDEBUG procedure:
//*************************************************************
//* *
//* ASMDEBUG -- SAMPLE PROCEDURE FOR ASSEMBLING HIGH LEVEL *
//* ASSEMBLER PROGRAMS AND DO THE XTRACT STEP *
//* FOR DOING THE SYMBOLIC ASSEMBLER DEBUG. *
//* *
//* Licensed Materials - Property of IBM *
//* 5724-B67 *
//* (C) Copyright IBM Corp. 2003 *
//* *
//* *
//* *
//*************************************************************
//* *
//* CUSTOMIZE THIS PROCEDURE AS PER YOUR SITE REQUIREMENTS *
//* *
//* THIS PROCEDURE WILL BE USED BY WSED TO ASSEMBLE HIGH *
//* LEVEL ASSEMBLER PROGRAMS. *
//* *
//* CUSTOMIZATION TASKS: *
//* *
//* 1) MODIFY THE LNGPRFX VALUE AS PER YOUR SITE *
//* REQUIREMENTS. DEFAULT VALUE IS 'SYS1' *
//* *
//* ADDITIONAL COMMENTS: *
//* *
//* SYSIN, SYSLIN AND SYSLIB DD CARDS WILL BE PROVIDED *
//* BY THE GENERATION CODE. *
//* *
//*************************************************************
//ASMDEBUG PROC LNGPRFX='SYS1'
//ASM EXEC PGM=ASMA90,REGION=2048K,
// PARM=('TEST',
// 'ADATA',
// 'LIST')
//STEPLIB DD DSN=&LNGPRFX..LINKLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DUMMY
//SYSUT1 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSUT3 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSUT4 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSUT5 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSUT6 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSUT7 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//*
//SYSTERM DD SYSOUT=*
//SYSADATA DD DSNAME=&ADATADS(&MEM),DISP=SHR
//XTRACT EXEC PGM=EQALANGX,REGION=32M,
// PARM='&MEM (ASM ERROR OFT IDILANGX FAULT'
//SYSADATA DD DSNAME=&ADATADS(&MEM),DISP=SHR
//IDILANGX DD DSNAME=&LANGXDX(&MEM),DISP=SHR
//*
Be sure that you defined and are connected to
a remote system, created an MVS subproject,
and associated a property group with it.
- Edit the associated property group.
- On the Assembler Settings page, select Procedures and Steps.
- Expand ELAXFASM, select the ASM step,
and set the following Assembler options:
Assembler option Value Procedure Name ASMDEBUG Assemble Procedure Step Name ASM Object Deck Data Set HLQ.ASMOBJS.OBJ Macro Libraries SYS1.MACLIB CEEV2R1M0.SCEEMAC - Select JCL Substitution and click Add
User Variable to set the following user variables:
Variable Name Variable Value LANGXDS HLQ.EQALANGX ADATADS HLQ.ASM.ADATA - Click Insert Global Variable to add the MEM variable.
- Close and save the property group.
- Open the Properties window for the subproject and click Application Entry Point.
- Select High Level Assembler. Enter CEESTART. Save the property changes.
- Add the source TESTDBG to the MVS subproject. (The source is shown at the end of this window.)
- Build the project to generate TESTDBG.exe in the specified load data set. (You can see the default Load Module Location by opening the property group to the Link Options page and selecting the Link step.)
- Right-click TESTDBG.exe and click Debug application. The debugger is started.
- Open the Debug console and enter LDD TESTDBG at the command line.
- Step through the debugger to debug the Assembler code.
During the build process, when the JCL is generated to do the build, a SET statement is generated at the top of the job for the variables that are specified on the JCL Substitution page of the property group.
Sample Assembler program for build and debug
The Assembler program must be enabled for Language Environment®,
as in this sample source:
TESTDBG CEEENTRY PPA=MAINPPA,AUTO=WORKSIZE
USING WORKAREA,R13
*
LA R02,STRT_MSG
LA R03,DEST
LA R04,FBCODE
STM R02,R04,PLIST
LA R01,PLIST
L R15,MOUT
BALR R14,R15
*
PACK PCKA,ZNA
PACK PCKB,ZNB
PACK PCKC,ZNC
ZAP PCKSUM,PCKA
AP PCKSUM,PCKB
AP PCKSUM,PCKC
MVC OUTSUM,SUMMSK
ED OUTSUM,PCKSUM
MVC SUMMSG+1(8),OUTSUM
MVC LINE_ST,SUMMSG
*
LA R02,LINE_MSG
LA R03,DEST
LA R04,FBCODE
STM R02,R04,PLIST
LA R01,PLIST
L R15,MOUT
BALR R14,R15
*
LA R02,DONE_MSG
LA R03,DEST
LA R04,FBCODE
STM R02,R04,PLIST
LA R01,PLIST
L R15,MOUT
BALR R14,R15
*
CEETERM RC=0
* ==============================================================
* Constants and Variables
* ==============================================================
ZLEN EQU 5
PLEN EQU ZLEN/2+1
*
SUMMSG DC C'(xxxxxxxx) -- The sum '
SUMMSK DC X'4020202020202120'
ZNA DC ZL5'100'
ZNB DC ZL5'150'
ZNC DC ZL5'50'
*
PCKA DS PL(PLEN)
PCKB DS PL(PLEN)
PCKC DS PL(PLEN)
PCKSUM DS PL(PLEN+1)
OUTSUM DS CL(L'SUMMSK)
*
MOUT DC V(CEEMOUT) The CEL Message service
*
LINE_MSG DS 0F
DC AL2(LINE_END-LINE_ST)
LINE_ST DS CL25
LINE_END EQU *
*
STRT_MSG DS 0F
DC AL2(STRT_END-STRT_ST)
STRT_ST DC C'Starting the program.'
STRT_END EQU *
*
DONE_MSG DS 0F
DC AL2(DONE_END-DONE_ST)
DONE_ST DC C'Terminating the program.'
DONE_END EQU *
*
DEST DC F'2' The destination is the MSGFILE
*
MAINPPA CEEPPA
* ===================================================================
* The Workarea and DSA
* ===================================================================
WORKAREA DSECT
ORG *+CEEDSASZ
PLIST DS 0D
PARM1 DS A
PARM2 DS A
PARM3 DS A
PARM4 DS A
PARM5 DS A
*
FBCODE DS 3F
*
DS 0D
WORKSIZE EQU *-WORKAREA
CEEDSA Mapping of the Dynamic Save Area
CEECAA Mapping of the Common Anchor Area
*
R00 EQU 0
R01 EQU 1
R02 EQU 2
R03 EQU 3
R04 EQU 4
R05 EQU 5
R06 EQU 6
R07 EQU 7
R08 EQU 8
R09 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
END TESTDBG