/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : ASMTIDY */ /* */ /* ***** Edit Macro ***** */ /* */ /* Description : Tidy an assembler program up a little */ /* */ /* Created on : 16 Jun 2023 */ /* Created by : Kevin Ferguson */ /* : Userid MIT001 */ /* : Using ABBYDALE.PROD.EMACS(ASMTIDY) */ /* */ /* Called by : Command Line */ /* */ /* Calls : Word, Words */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ parse Arg Help /* Check for Help */ If SYSVAR("SYSISPF")<>"ACTIVE" then DO say "ISPF must be active to use "ASMTIDY exit(16) end Address ISREDIT "MACRO (Help) PROCESS" If Help = "?" Then DO Call Disp_Help exit(4) end ISREDIT "(NUMLAST) = LINENUM .ZLAST" ISREDIT "(CRSLINE,CRSCOL) = CURSOR" ISREDIT "(LINEDATA) = LINE" CRSLINE lne = 1 cnt = 0 UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" lower = "abcdefghijklmnopqrstuvwxyz" ISREDIT "X ALL" ISREDIT "NUM" ISREDIT "UNNUM" Do Until Lne > numlast ISREDIT "(LINEDATA) = LINE" Lne test = word(linedata,1) test = translate(test,upper,lower) if test = 'LTORG' then do lne = numlast iterate end Lne = Lne + 1 if Words(linedata) > 1 then do if substr(linedata,1,1) = "/" then iterate if substr(linedata,1,1) = "&" then iterate if substr(linedata,1,1) = "*" then iterate n = 1 if substr(linedata,1,1) <> " " then do n = 2 end x = Lne-1 K = word(Linedata,n) K = Translate(K,upper,lower) If K = "EQU" then do if word(linedata,N+1) = "*" then do ISREDIT "X ALL" ISREDIT "RESET EXCLUDED" x x ISREDIT "C "Word(Linedata,n)" DS ALL NX" ISREDIT "C '*' '0H' ALL NX" end end If K = "BAL" then do ISREDIT "RESET EXCLUDED" x x ISREDIT "C "Word(Linedata,n)" BAS ALL NX" end ISREDIT "RESET EXCLUDED" x x ISREDIT "C '"Word(Linedata,n)"' '"K"' ALL NX 2 16" cnt = cnt + 1 end end ISREDIT "RESET EXCLUDED" ISREDIT "RESET" Signal on novalue /* un-initialized vars*/ Signal on halt /* attention key */ Return /*-------------------------------------------------------------------*/ /* Disp_Help Procedure */ /*-------------------------------------------------------------------*/ DISP_HELP: Procedure say "ASMTIDY - Tidy up an assembler prgram." say"" say "Usage: ASMTIDY | ?" say"" say" ? - Generates this information." say"" say" RETURN Codes :" say" 4 - Help displayed" say" 16 - Not under ISPF" say"" return /*-------------------------------------------------------------------*/ /* End of Disp_Help Procedure */ /*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/ /* Trap NOVALUE Condition */ /*-------------------------------------------------------------------*/ novalue: say "NOVALUE entered from line" sigl say condition("D") say "The instruction is suppressed" ADDRESS "TSO" "delstack" Exit(16) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" Address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of ASMTIDY */ /*-------------------------------------------------------------------*/