/* REXX | | Name: IEFBR549 ... ISPF macro ... Show Extended Mnemonics | | BR5-49 is the phone number for Junior Sample's Used Car lot on | the TV show Hee Haw. It is also the name of a C/W band. | | | Author: David Alcock | davea@ticnet.com (home) | dalcock@csw.com (work) | | | Purpose: This ISPF edit macro reads the current dataset or selected | lines and shows the Assembler Extended Mnemonic | instructions as ISPF info lines for "BC" instructions. | | No source code is changed by the use of this macro. | | I recommend using the "RESET" command before invoking. | | | Limitations: This ISPF edit macro *ASSUMES* that the assembly | instructions have correct syntax. We are in the | explanation business not the parsing business. | | | Disclaimer: Since the proper use of any conditional branch | instruction is dependant on the previous instruction | for the setting of the condition code, we will show | all known extended mnemonics for the given "BC" | instruction. We will take a SWAG (Scientific Wild | A$$ Guess) and put a "*" by the one that we think | matches - but don't always assume it's right. | | The "EX" of a "CLC" for example would never be picked | up by the AI, Artificial Insanitiy, SWAG code. | | Not all instructions that cause a condition code have been | identified by this exec - only the most common ones. | | Reference: GX20-0406-0 ESA/370 Reference Summary (1989) | | | Legal: This REXX exec is FREEWARE. It is not in the Public Domain. | I retain the copyright for this work. | | Use it, Modify it, but don't claim it for your own or charge | others money for it other than the cost of the media to | deliver it. | | Use at your own risk. It is provided for your enjoyment and | neither David Alcock nor his employer provides any warranty | for it. I'd like to hear feedback on how it works on | your system or if you find it useful. | */ vrm = "0.9" /* Set current version */ /* ================================================================= * | | M o d i f i c a t i o n H i s t o r y | | Person Date Description | ---------- ----------- -------------------------------------------- | DGAlcock 22-DEC-1997 v0.9 - Initial exec created; * ================================================================= */ address ISREDIT /* Set up default environment */ 'MACRO (PARM1) NOPROCESS' parm1 = translate(parm1) if parm1 = '?' then do say "The BR5-49 edit macro can be use to show all Assembler" say "Extended Mnemnoic Instructions for the whole or selected" say "lines of the dataset" exit end /********************************************************************* | Process line commands, check if S or SS was specified ********************************************************************/ 'PROCESS RANGE S' select when rc = 0 then do '(CMD) = RANGE_CMD' /* Get the command */ '(LINE1) = LINENUM .ZFRANGE' /* Get first in range */ '(LINE2) = LINENUM .ZLRANGE' /* Get last in range */ typesel = "slines" end when rc <= 4 then do /* No S or SS entered, use entire file */ '(CMD) = RANGE_CMD' /* Get the command */ '(LINE1) = LINENUM .ZFIRST' /* Get first in range */ '(LINE2) = LINENUM .ZLAST' /* Get last in range */ typesel = "file" end otherwise /* Line command conflict - Edit will create message */ exit 12 end /* of "select" */ /********************************************************************* | Process the lines selected ********************************************************************/ xmi_count = 0 /* Count of "BC" found */ lastone = "" /* Last assembler instruction */ Firstone = 0 /* First "BC" assembler instruction line */ "(ICAPS) = CAPS" /* save caps type upon entry */ "CAPS = OFF" /* Ensure mixed case for note/msg lines */ do i = line1 to line2 '(LINEVAL) = LINE' i if substr(lineval,1,1) == "*" then iterate /* Skip comment lines */ counted = 0 /* Have we counted this line yet? NO */ tw = 2 if substr(lineval,1,1) == " " then tw = 1 if word(lineval,tw) == "BC" then do parse value word(lineval,tw+1) with type "," label type = strip(type) select when type == "15" then xni = "B" when type == "0" then xni = "NOP" otherwise xni = "" end ai = "*" if xni <> "" then call showit "General" select when type == "2" then xni = "BH" when type == "4" then xni = "BL" when type == "8" then xni = "BE" when type == "13" then xni = "BNH" when type == "11" then xni = "BNL" when type == "7" then xni = "BNE" otherwise xni = "" end if xni <> "" then do select when lastone == "C" then ai = "*" when lastone == "CH" then ai = "*" when lastone == "CL" then ai = "*" when lastone == "CLC" then ai = "*" when lastone == "CLCL" then ai = "*" when lastone == "CLI" then ai = "*" when lastone == "CLR" then ai = "*" otherwise ai = " " end call showit "After Compare Instructions ONLY!" end select when type == "2" then xni = "BP" when type == "4" then xni = "BM" when type == "8" then xni = "BZ" when type == "1" then xni = "BO" when type == "13" then xni = "BNP" when type == "11" then xni = "BNM" when type == "7" then xni = "BNZ" when type == "14" then xni = "BNO" otherwise xni = "" end if xni <> "" then do select when lastone == "LTR" then ai = "*" otherwise ai = " " end call showit "After Arithmetic Instructions ONLY!" end select when type == "1" then xni = "BO" when type == "4" then xni = "BM" when type == "8" then xni = "BZ" when type == "14" then xni = "BNO" when type == "11" then xni = "BNM" when type == "7" then xni = "BNZ" otherwise xni = "" end if xni <> "" then do select when lastone == "TM" then ai = "*" when lastone == "ICM" then ai = "*" when lastone == "CLM" then ai = "*" otherwise ai = " " end call showit "After Test Under Mask Instructions ONLY!" end end lastone = strip(word(lineval,tw)) end /********************************************************************* | End this up ********************************************************************/ if xmi_count == 0 then say "No BC instructions were found." else do noteline = "IEFBR5-49 v"vrm" - Freeware by Dave Alcock -" , "Extended Mnemonics Rule!!!!" "LINE_BEFORE 1 = INFOLINE '"noteline"'" "LINE_BEFORE 1 = INFOLINE ' '" noteline = xmi_count" BC instructions" , "were shown as extended mnemonics." "LINE_BEFORE 1 = INFOLINE '"noteline"'" noteline = "The first one was at relative line "firstone , "(from top of file)" "LINE_BEFORE 1 = INFOLINE '"noteline"'" "LINE_BEFORE 1 = INFOLINE ' '" noteline = "-> This ISPF edit macro is an aid and you should" , "verify results." "LINE_BEFORE 1 = INFOLINE '"noteline"'" end "CAPS = "icaps /* Restore CAPS state upon entry */ exit /********************************************************************* | Sub-routine: show this line's extended Mnemonic ********************************************************************/ showit: parse arg comment if counted <> 1 then do xmi_count = xmi_count + 1 counted = 1 end if length(label) < 12 then label = left(label,12) noteline = " " left(xni,5) label ai comment "ISREDIT LINE_AFTER "i" = INFOLINE '"noteline"'" if firstone == 0 then firstone = i return /* | ---------EEEEEEEE---------NN-----NN---------DDDDDDD--------- | | ---------EE---------------NNNN---NN---------DD----DD-------- | | ---------EEEEE------------NN-NN--NN---------DD----DD-------- | | ---------EE---------------NN---NNNN---------DD----DD-------- | | ---------EEEEEEEE---------NN----NNN---------DDDDDDD--------- | */