/* REXX DECLOCN Replace the line numbers in an assembler listing with the decimal conversion of D-Loc. */ address ISREDIT "MACRO (opts) " if rc = 20 then do /* ISREDIT not available */ address TSO parse source . . exec_name . ex_nam = Left(exec_name,8) /* predictable size */ helpmsg = ex_nam "is an EDIT macro" call HELP /* -*/ end parse var opts parms "((" opts if Left( Strip( parms ),1 ) = '?' then, call HELP /* -*/ upper opts opts = Strip( opts,'T','5d'x ) /* yes we want no bananas */ parse var opts "TRACE" tv . parse value tv "N" with tv . rc = Trace( 'O' ) ; rc = Trace( tv ) "X ALL" "F 'Source Statement' 44 " if rc > 0 then do helpmsg = "Couldn't find the start of the source." call HELP end "(start) = LINENUM .zcsr " start = start+0 "F 'Relocation D' 51 " if rc > 0 then do helpmsg = "Couldn't find the end of the source." call HELP end "(finish) = LINENUM .zcsr " finish = finish+0 "RESET" start finish "CURSOR = " start /* top of source */ do forever "F P'#' 2 " /* location */ if rc > 0 then leave "(l#) = LINENUM " .zcsr /* where are we? */ if l# >= finish then leave /* end of source */ "(txt) = LINE" .zcsr /* get text */ parse var txt 2 locn . 36 stmt 41 /* hex loc + statement */ if Datatype( stmt,'W' ) = 0 then iterate if Datatype( locn,'X' ) = 0 then iterate dv = Right( X2D( locn )+1,8,0 ) /* convert to dec, add 1 */ txt = Overlay( dv,txt,114,14 ) /* overlay on sequence number */ "LINE .zcsr = (txt)" /* replace text */ end /* forever */ "CURSOR = " start /* top of source */ exit /*@ DECLOCN */ /* . ----------------------------------------------------------------- */ HELP: /*@ */ parse source sys_id how_invokt exec_name DD_nm DS_nm, as_invokt cmd_env addr_spc usr_tokn address TSO;"CLEAR" if Symbol( helpmsg ) <> "LIT" then say helpmsg ex_nam = Left(exec_name,8) /* predictable size */ say " " say " "ex_nam" replaces the line numbers on an assembler listing with the" say " decimal conversion of D-loc. " say " " say " Syntax: "ex_nam" no parms " say " " "NEWSTACK"; pull ; "CLEAR" ; "DELSTACK" say " Debugging tools provided include: " say " " say " TRACE tv: will use value following TRACE to place the execution " say " into REXX TRACE Mode. " say " " say " " say " Debugging tools can be accessed in the following manner: " say " " say " "ex_nam" parameters (( debug-options " say " " say " For example: " say " " say " "ex_nam" (( trace ?r " if sysvar("SYSISPF") = "ACTIVE" then, address ISPEXEC "CONTROL DISPLAY REFRESH" exit /*@ HELP */ /* do forever "F P'#' 2" if rc > 0 then leave /* didn't find any ? */ "(text) = LINE .zcsr" /* carpe textem */ parse var text 2 hv 8 idler 9 /* get possible hexvalue */ if idler = "" then, if Datatype( hv,"X" ) then, if Length( hv ) = 6 then do junk = Strip( Substr( text,114,8 ) ) "X ALL" "F ALL '"junk"'" "C ALL NX P'=' ' ' 114 130 " /* get rid of all the junk */ leave end end "X ALL" do forever "F P'#' 2" if rc > 0 then leave "(text) = LINE .zcsr" /* carpe textem */ parse var text 2 hv 8 idler 9 /* get possible hexvalue */ if idler = "" then, if Datatype( hv,"X" ) then, if Length( hv ) = 6 then do dv = Right( X2D( hv )+1,8,0 ) text = Overlay( dv,text,114,14 ) "LINE .zcsr = (text)" end end /* forever */ "X ALL"; "RESET" */