, 00002000 00004000 THE PENNSYLVANIA STATE UNIVERSITY 00006000 Computation Center 00008000 00010000 CONTRIBUTED PROGRAM 00012000 Contributor: John R. Mashey, Computer Science Department 00014000 00016000 XDUMP/XSNAP 00018000 360 ASSEMBLER LANGUAGE writeup revised January 1973 (v.5.0)00020000 00022000 EXTENDED SNAP AND DUMP MACROS 00024000 00026000 INTRODUCTION 00028000 00030000 XDUMP provides a very simple command for obtaining either a dump of00032000 the general purpose registers, or of a single area of main storage. The00034000 output is identified by printing the location at which the XDUMP was00036000 invoked. XDUMP is a special case of XSNAP, and calls it to create code.00038000 00040000 XSNAP is a much more flexible macro. General purpose registers may00042000 be stored for later inspection if it is not desired to have them printed00044000 immediately. In addition to the printing of the GP registers, the00046000 floating point registers and any number of storage areas can be printed00048000 by one XSNAP, in any desired combination. Any storage areas may be00050000 displayed, and may be specified by labels, base-displacements, dummy00052000 section symbols. An optional label may be provided to further identify00054000 the output. XSNAPs may be cancelled at assembly time using the XSET00056000 macro, and may be made conditional at execute time by making tests on00058000 values in registers or storage. XSNAP modifies neither the condition00060000 code nor the registers, and can thus be used at any point in a program00062000 at which addressibility exists. 00064000 00066000 TYPICAL USAGE 00068000 00070000 a) Print GP registers (XDUMP with no operands). 00072000 00074000 XDUMP 00076000 00078000 b) Print a single block of storage (up to 4095 bytes). 00080000 00082000 XDUMP AREA,LENGTH LENGTH bytes starting at AREA 00084000 00086000 c) Print GP registers, floating registers, and a storage area.00088000 (labeled as shown, with 100 bytes starting at X). 00090000 00092000 XSNAP T=FL,LABEL='REGS,AREA X',STORAGE=(X,X+100) 00094000 00096000 d) Print 2 storage areas, no registers. Areas are specified by RX-00098000 type addresses in this case, including DSECT symbols X1 and X2.00100000 00102000 XSNAP T=NO,STORAGE=(*0(R1,R2),*40(R1,R2),*X1,*X2) 00104000 00106000 e) Print (GP registers in this case) only when specified test is met,00108000 in this case, only if value in register 2 is greater than 100 .00110000 00112000 XSNAP LABEL='AFTER 100TH TIME IN LOOP',IF=((2),H,=F'100') 00114000 , 00116000 XDUMP/XSNAP - 02 00118000 00120000 XDUMP 00122000 00124000 USE 00126000 00128000 XDUMP can be used in one of two basically different ways:00130000 00132000 a) GENERAL PURPOSE REGISTER DUMP 00134000 00136000 XDUMP 00138000 00140000 Coding XDUMP with no operands prints the contents of the user's00142000 general purpose registers, in hexadecimal notation. The registers00144000 are preceded by a header line like the following: 00146000 00148000 BEGIN XSNAP - CALL # AT CCAAAAAA USER REGISTERS 00150000 00152000 # is the number of calls made to XDUMP so far, for identification.00154000 00156000 CCAAAAAA shows the last 32 bits of the user's PSW, in hexadecimal.00158000 00160000 CC gives the ILC, CC, and Program Mask at the time of the XDUMP.00162000 00164000 AAAAAA gives the approximate address of the XDUMP macro expansion, and00166000 thus can be used to distinguish between the output of different00168000 XDUMP statements. *NOTE* XDUMP , is the same as XDUMP with no operand.00170000 00172000 b) STORAGE DUMP 00174000 00176000 XDUMP area,length 00178000 00180000 area is any RX-type address (anything allowed in a LA instruction)00182000 00184000 length is an absolute expression having value from 1 to 4095.00186000 00188000 Coding XDUMP with an address and length produces a dump of a00190000 user storage area, beginning at the address given by area, and00192000 ending at address area+length. 00194000 00196000 The resulting output includes a header line like the above,00198000 followed by a hexadecimal and alphanumeric dump of the selected00200000 storage area. The storage is printed in lines showing two groups00202000 of four fullwords, preceded by the memory address of the first00204000 word in each line, and followed by the alphanumeric representation00206000 of the 32 bytes on the line, with letters, numbers, and blanks00208000 printed directly, and all other characters translated to periods.00210000 The storage printed is also preceded by a line giving the address00212000 limits specified in the XDUMP. 00214000 00216000 If the length is omitted, the value 4 is used as a default.00218000 00220000 EXAMPLES OF XDUMP USAGE 00222000 00224000 XDUMP AREA+10,80 00226000 XDUMP 8(1,4),100 00228000 XDUMP FULLWORD use default value of 4 00230000 XDUMP TABL(3),12 00232000 , 00234000 XDUMP/XSNAP - 03 00236000 00238000 XSNAP 00240000 00242000 USE 00244000 00246000 XSNAP may be coded with any of the operands shown, in any order,00248000 since all are keyword operands. It is called as follows: 00250000 00252000 label XSNAP T=,LABEL=,STORAGE=,IF= 00254000 00256000 label is an optional statement label. 00258000 00260000 00262000 T= (Type of action to be performed for registers) 00264000 00266000 T=PRINT requests that the GP registers be printed, as given by XDUMP..00268000 Storage areas may of course be printed in addition (STORAGE=).00270000 00272000 T=NOREGS requests that GP registers NOT be printed. If no STORAGE=00274000 is specified, this produces exactly 1 line of output, which can be00276000 used for program tracing. 00278000 00280000 T=FLOAT requests both GP and floating point registers to be printed.00282000 00284000 T=(FLOAT,NOREGS) requests floating point registers, but NOT GP regs.00286000 00288000 T=STORE causes the GP registers to be saved into a well-labeled area,00290000 but does not create any printed output. The register area is00292000 originally generated filled with -1's (hexadecimal 'FF's), and is00294000 immediately preceded by the LABEL= string if it exists, or by the label00296000 generated on the register area (of form XX####B), if no LABEL= was used.00298000 The area is followed by 'XXXX' to make it easy to find. By examining00300000 such an area in a dump, the user can immediately determine: 00302000 00304000 a) whether control ever passed through a given point (register area has00306000 values other than X'FF'). 00308000 00310000 b) the contents of the registers the LAST time control passed through00312000 the given XSNAP. 00314000 00316000 Note that the LABEL= option helps identify each XSNAP. If it is00318000 not used, the XX####B label placed before the area also appears in the00320000 assembly Cross-Reference listing, so it is still easy to locate. Note00322000 that this option is especially useful for placing inside heavily-used00324000 loops in a program in which intermittent/unpredictable errors occur.00326000 00328000 Any of the types above may be abbreviated by the first two letters:00330000 PRINT = PR, NOREGS = NO, FLOAT = FL, STORE = ST . 00332000 00334000 **DEFAULT** T=PRINT is the default value used if not supplied.00336000 00338000 00340000 LABEL='string' (identification LABEL printed as XSNAP heading)00342000 00344000 The 'string' is any character string usable as a C-type constant in00346000 a DC statement, and is used as the XSNAP heading if it prints anything00348000 at all. The register area label (XX####B) is used if LABEL= is omitted.00350000 , 00352000 XDUMP/XSNAP - 04 00354000 00356000 STORAGE=(list) (areas of main STORAGE to be dumped) 00358000 00360000 This option accepts a list of ADDRESS PAIRS, each pair specifying00362000 the limits of an area of memory to be printed, from the address given00364000 by the first operand to that given by the second, from the third to the00366000 fourth, etc. There may be any even number of addresses, separated by00368000 commas. Each of the address specifications in each pair may be written00370000 in either of the following forms (in any combination): 00372000 00374000 a) any label or expression usable in an A-type address constant.00376000 00378000 b) *expression , where expression is 40 or less characters long, and00380000 is acceptable as the second operand of a Load Address instruction. Thus,00382000 base-displacement forms, doubly-indexed expressions, and dummy section00384000 symbols can all be used if preceded by an * . The following is a legal00386000 example of a STORAGE= operand: 00388000 00390000 STORAGE=(A,B+7000,*4(2,R3),*AREA+3(4),*DSECT1,*DSECT1A,A,*A) 00392000 00394000 00396000 IF=(opa,relation,opb) (perform XSNAP only IF condition exists)00398000 00400000 Operands opa and opb are compared in some way. The XSNAP prints00402000 output only whenever the relation between the two operands is true.00404000 The relation is specified using the same codes as the Extended Mnemonics00406000 of the Branch on Condition: H,L,E,O,P,M,Z,NH,NL,NE,NO,NP,NM,NZ. Thus,00408000 an XSNAP WITH IF=(FLAG,NE,1) dumps only when value of FLAG is Not Equal00410000 to 1. The operands are compared in different ways depending on whether00412000 they are registers, storage, or immediate operands. The 3 cases are:00414000 00416000 OPERAND FORMS COMPARISON GENERATED MEANING 00418000 (opa) (opb) CR (opa),(opb) opa, opb both designate registers00420000 (opa) opb C (opa),opb opa: register, opb: storage fullword00422000 opa opb CLI opa,opb opa: address, opb: Immediate operand00424000 00426000 For flexibility, adding a fourth operand to the sublist allows it00428000 to be used as the opcode in the comparison: IF=(TAG,O,X'F0',TM) would00430000 generate TM TAG,X'F0' and print only if result is Ones condition.00432000 00434000 The IF option can be a powerful debugging tool. Dumping can be00436000 allowed only when a specific condition exists. For example, if an error00438000 occurs only after a loop is executed several thousand times, IF can make00440000 an XSNAP print nothing the first (2000, for example) times, then print:00442000 IF=((register with loop counter),H,=F'2000') . For programs which00444000 process many input cards, it becomes possible to turn debug output on00446000 just before an input card known to be causing trouble, without printing00448000 output for the preceding cards. This is done by checking the input for00450000 a special debug flag value, then setting a flag byte in memory, which00452000 can be tested by many XSNAPs to determine whether printing is desired.00454000 In fact, if an 8-bit value can be obtained from an input card, 800456000 separate groups of XSNAPs can be individually controlled. 00458000 , 00460000 XDUMP/XSNAP - 05 00462000 00464000 SUPPRESSION OF XDUMP AND XSNAP CODE GENERATION 00466000 00468000 After a program is debugged, it is often useful to be able to00470000 suppress all debug code, without actually removing the cards from the00472000 deck. Coding XSET XSNAP=OFF suppresses all XDUMP and XSNAP code00474000 following the XSET. They can be restored by coding XSET XSNAP=ON ,00476000 and this process repeated as desired. Also note that XSET can be used00478000 similiarly for other X-MACROS, with multiple operands a desired:00480000 XSET XSNAP=OFF,XSAVE=OFF,XRETURN=OFF is quite common. 00482000 00484000 RESTRICTIONS AND NOTES 00486000 00488000 XDUMP and XSNAP are usable ONLY where addressibility exists. A00490000 common error is to write the following code at an exit point of a CSECT 00492000 00494000 L 13,4(13) RETORE SAVE AREA POINTER 00496000 LM 14,12,12(13) RESTORE REGISTERS 00498000 XSNAP . . . 00500000 BR 14 RETURN 00502000 00504000 The above code sequence typically results in a branch SOMEWHERE,00506000 since the program has destroyed whatever base register the XSNAP was00508000 assembled under. Such errors are extremely difficult to locate.00510000 00512000 00514000 In order to receive dumping output from XSNAP or XDUMP, the user00516000 should supply a DD card for the execution step of his program, 00518000 using the DDNAME XSNAPOUT. Typical such cards are: 00520000 00522000 //DATA.XSNAPOUT DD SYSOUT=A (at Penn State) 00524000 //GO.XSNAPOUT DD SYSOUT=A (standard IBM cataloged procedures)00526000 00528000 If XSNAPOUT is omitted, XSNAP will use one of the following DD names: 00530000 XPRNT, SYSPRINT, FT06F001 (in that order) 00532000 00534000 XDUMP and XSNAP operate by calling a CSECT named XXXXSNAP, which00536000 performs the actual dumping. If it does not find the DDNAME XSNAPOUT00538000 it will issue a message to the system log and ABEND U0300. It should00540000 be noted that it is impossible for XXXXSNAP to cause an interrrupt00542000 unless the user program has destroyed some of its code. Thus, any00544000 abnormal end with PSW inside XXXXSNAP is probably caused by user error.00546000 00548000 If XSNAP and XPRNT are used in the same program, the output of each00550000 is usually separate. The following XSNAPOUT card may be used instead to00552000 obtain XPRNT and XSNAP output merged together: 00554000 00556000 //DATA.XSNAPOUT DD UNIT=AFF=FT06F001 (at PSU, may not work elsewhere)00558000 00560000 00562000 REFERENCES 00564000 00566000 The following documents of other X-macros may be of use :00568000 XMSYSGEN, XREAD/XPRNT/XPNCH . 00570000 00572000 , 00574000 THE PENNSYLVANIA STATE UNIVERSITY 00576000 Computation Center 00578000 00580000 CONTRIBUTED PROGRAM 00582000 Contributor: Richard W. Fowler 00584000 00586000 XGET/XPUT 00588000 360 ASSEMBLER V.5.0. Jan 1973 00590000 00592000 EXTENDED ASSEMBLER I/O COMMANDS 00594000 00596000 PURPOSE 00598000 Two macros XGET (eXtended GET) and XPUT (eXtended PUT), provide 00600000 easy assembler I/O facilities for up to 20 files each simultaneously. 00602000 a) Only 2 statements are needed for each operation. 00604000 LA R1,=CL8'ddname' 00606000 XGET or XPUT area address,length 00608000 Example: 00610000 LA 1,=CL8'CARDS' 00612000 XGET AREA,80 00614000 //DATA.CARDS DD * 00616000 00618000 The above example will read in a card file. 00620000 00622000 b) Only register 1 is destroyed, but the user destroys it with the 00624000 LA instruction. 00626000 c) Condition code is set to indicate end-of-file, error conditions,00628000 and normal execution. 00630000 00632000 THESE MACROS ARE EXACTLY LIKE THE XREAD/XPRNT/XPNCH MACROS IN 00634000 their form of calling sequence, except that the maximum length is 32767.00636000 I.e., the area address may be any RX-type address, or (0) or (R0), the 00638000 latter two indicating that the address is already present in register 0.00640000 Likewise, the length is an absolute expression giving the length, a 00642000 register enclosed in parentheses (such as (1) or (R2)), or a default 00644000 value (80 for XGET, 133 for XPUT) if the operand is omitted. 00646000 00648000 CONDITION CODES 00650000 XGET and XPUT set the CC as follows: 00652000 CC=0 --- I/O occurred; 00654000 CC=1 --- XGET only --- end-of-file encountered; 00656000 CC=2 or 3 --- ERROR occurred. Either file not opened or error 00658000 occurred while processing, file closed if possible or 00660000 necessary. 00662000 00664000 CARRIAGE CONTROLS 00666000 If XPUTting to a printer file, the first character of the area must00668000 a valid carriage control character. 00670000 00672000 CLOSING OF FILE 00674000 Performing an XGET or XPUT with a length of zero causes the 00676000 designated file to be closed, so that it may be reread, for example. 00678000 , 00680000 XGET/XPUT - 02 00682000 00684000 JOB CONTROL LANGUAGE 00686000 There are no extra DD cards in the catalogued procedures, 00688000 therefore, unless using a dd that is in the procedure, the user must 00690000 specify everything. 00692000 00694000 Card Reader //DATA.XXXXX DD * any DD name allowed 00696000 Printer //DATA.XXXXX DD SYSOUT=A,DCB=(RECFM=FA,BLKSIZE=133) 00698000 Card Punch //DATA.XXXXX DD SYSOUT=B,DCB=(RECFM=F,BLKSIZE=80)00700000 Tape //DATA.XXXXX DD VOL=SER=YYYYY,DSN=ZZZ,UNIT=2400, 00702000 // DCB=(RECFM=FB,LRECL=dd,BLKSIZE=ddd) 00704000 Disk //DATA.XXXXX DD DSN=&&TEMP,UNIT=SYSDA, 00706000 // SPACE=(CYL,(5,1)),DCB=(RECFM=FB,BLKSIZE=ddd) 00708000 Note that these macros need the dcb to be specified, (or on the file), 00710000 Thus, many DD cards in the procedure may require the DCB to be added. 00712000 00714000 GENERAL INFORMATION 00716000 Each macro has an associated CSECT which it calls to perform the 00718000 actual I/O operations. The characteristics are as follows: 00720000 MACRO MAX LENGTH CSECT NAME CSECT LENGTH 00722000 XGET 32767 XXXXGET 964 00724000 XPUT 32767 XXXXPUT 996 00726000 00728000 STORAGE REQUIREMENTS 00730000 Each call on any of the macros generates from 32-42 bytes of code, 00732000 depending on initial alignment and options use. This is in addition to 00734000 the storage required by any of the CSECTS used. 00736000 Each macro calls the inner macro XIONR, which is the same macro 00738000 called by the XREAD, etc, macros. 00740000 00742000 ***NOTE*** User must load into register 1 the address of an eight byte 00744000 character string, left justified and padded with blanks if necessary 00746000 This string represents the XXXXX of the //DATA.XXXXX DD cards. 00748000 00750000 REFERENCES: see the XREAD/XPRNT/XPNCH writeup for the simpler and 00752000 more specific I/O commands provided. Also see the XMSYSGEN writeup 00754000 which describes the various properties and generation of the entire 00756000 X-MACRO system. 00758000 , 00760000 XGET/XPUT - 03 00762000 00764000 EXAMPLE OF XGET AND XPUT USAGE 00766000 00768000 The following program reads/writes several files in parallel. 00770000 00772000 TEST1 CSECT 00774000 BALR 12,0 00776000 USING *,12 00778000 SR 0,0 00780000 * 00782000 * THIS PROGRAM WILL PROCESS A FEW FILES IN PARRALLEL, 00784000 * 00786000 LOOP LA 1,=CL8'CARD' point to an input file 00788000 XGET AREA,80 do the input 00790000 BNE DONE branch on endfile, 00792000 * file automatically closed 00794000 XREAD AREA2,80 do normal input 00796000 LA 1,=CL8'PAPER' point to a printer file 00798000 XPUT AREA-1,81 do output, note carriage control 00800000 LA 1,=CL8'PAPER2' point to other printer file 00802000 XPUT AREA2-1,81 do output on other file 00804000 B LOOP try again 00806000 DONE BR 14 RETURN, IMPLICITLY CLOSE OTHER FILES 00808000 DC CL1' ' 00810000 AREA DS CL80 00812000 DC CL1' ' 00814000 AREA2 DS CL80 00816000 END 00818000 00820000 The extra JCL for the above is as follows: 00822000 //DATA.PAPER DD SYSOUT=A,DCB=(RECFM=FA,LRECL=133,BLKSIZE=133) 00824000 //DATA.PAPER2 DD SYSOUT=A,DCB=(RECFM=FA,LRECL=133,BLKSIZE=133) 00826000 //DATA.CARD DD * 00828000 THIS STUFF IS READ 00830000 AT THE SAME TIME AS ANOTHER 00832000 FILE IS READ 00834000 ****** THE LAST CARD ******* 00836000 //DATA.INPUT DD * 00838000 THIS IS THE NORMAL INPUT FILE 00840000 AND IS READ AT THE SAME TIME AS ANOTHER FILE 00842000 IS READ 00844000 ********* THE LAST CARD ********* 00846000 , 00848000 00850000 THE PENNSYLVANIA STATE UNIVERSITY 00852000 Computation Center 00854000 00856000 CONTRIBUTED PROGRAM 00858000 Contributor: Alan Artz 00860000 00862000 XHEXI/XHEXO 00864000 360 Assembler language April,1972 00866000 00868000 Extended Hexadecimal Conversion Macros 00870000 00872000 INTRODUCTION 00874000 00876000 XHEXI and XHEXO provide easy conversion of hexadecimal numbers00878000 for input and output. The value of a hexadecimal number can be00880000 read from a card using XREAD, converted from character mode to a00882000 hexadecimal number, and the converted number is placed in the specified00884000 general purpose register with XHEXI. XHEXO provides an easy way00886000 to convert internal hexadecimal to an output form that can be00888000 printed using XPRNT. 00890000 XHEXI also places the address of the first non-hexadecimal00892000 number in register one, but if more than eight digits are scanned,00894000 the address of the ninth is placed in register 1. 00896000 00898000 TYPICAL USAGE 00900000 00902000 The following shows the most common usage of the macros XHEXI00904000 and XHEXO: 00906000 00908000 A) Take a character number from an area called CARD and convert00910000 it to hex in Register 2. 00912000 00914000 XHEXI 2,CARD convert number 00916000 00918000 B) Take a series of numbers from a card and store them on a full-00920000 word-boundary. 00922000 00924000 LA 3,AREA address of storage 00926000 LA 1,CARD address of numbers 00928000 TOP XHEXI 2,0(1) convert number 00930000 ST 2,0(3) store it 00932000 LA 3,4(3) advance storage pointer 00934000 BNO TOP keep on going 00936000 00938000 This bit of code takes character numbers from an area called CARD,00940000 converts them to internal hex, and then stores them in a location called00942000 AREA. The card was probably read in with the XREAD instruction. 00944000 00946000 C) Take a number in a register and convert it and place it in00948000 an output area to be printed. 00950000 00952000 XHEXO 2,AREA+1 convert number 00954000 XPRNT AREA,8 print number 00956000 AREA DC CL9' ' storage for number 00958000 , 00960000 XHEXI - 02 00962000 00964000 XHEXI 00966000 00968000 USE: 00970000 00972000 XHEXI REGISTER,ADDRESS 00974000 00976000 XHEXI, in the general form shown above where REGISTER is any general00978000 purpose register and ADDRESS is anything legal in an RX instruction, is00980000 used to do the following: 00982000 00984000 1. Beginning at the location ADDRESS, memory is scanned until the00986000 first non-blank character is found. 00988000 00990000 2. If the first character found is anything but a legal hexa-00992000 decimal character(0-9,A-F), the condition code is set to overflow00994000 and this address is placed in register 1. If the REGISTER is00996000 anything but register 1, its contents remain unchanged. 00998000 01000000 3. One to eight hexadecimal characters are scanned, the number01002000 converted to hexadecimal, and the result is placed in REGISTER.01004000 The value placed in the register is internal hexadecimal with01006000 leading zeros included and the number is right justified. 01008000 01010000 4. Register one is set to the address of the first non-hexadecimal01012000 character. With this in mind, the user should not code register one as01014000 REGISTER. This allows you to scan across the card for any number of01016000 character strings. The strings should be separated by blanks. The end01018000 of the string could be flagged with any non-hexadecimal character and a01020000 test could be made after a Branch Overflow (see sample program). 01022000 01024000 01026000 5. If more than eight hex digits are found, register one is set to01028000 the address of the ninth. This allows the user to scan across long01030000 strings of numbers. 01032000 01034000 01036000 XHEXO 01038000 01040000 USE: 01042000 01044000 XHEXO REGISTER,ADDRESS 01046000 01048000 01050000 XHEXO in the general form shown above converts the value01052000 in REGISTER and places it in a right-justified 8-byte field beginning at01054000 ADDRESS. It can be easily printed using an XPRNT instruction. 01056000 01058000 , 01060000 XHEXI - 03 01062000 01064000 SAMPLE PROGRAM USING XHEXI AND XHEXO 01066000 01068000 This program reads a data card with an unknown number01070000 of hexadecimal numbers on it. The end of the data01072000 string is denoted by a '%' punched after the last number.01074000 The numbers are stored after being converted using01076000 XHEXI, and then converted for output using XHEXO.01078000 01080000 LA 3,STORAGE WHERE NUMBERS STORED 01082000 XREAD CARD,80 READ IN CARD 01084000 XPRNT CARD,80 ECHO PRINT 01086000 LA 1,CARD ADDRESS OF CARD FOR SCANNING 01088000 LOOP XHEXI 2,0(1) CONVERT NUMBER PUT IN 2 01090000 BO ILLEGAL CHECK FOR END 01092000 XHEXO 2,AREA PUT NUMBER IN OUTPUT AREA 01094000 XPRNT REP,28 PRINT CARD AND MESSAGE 01096000 ST 2,0(3) STORE NUMBER 01098000 LA 3,4(3) INCREASE INDEX 01100000 B LOOP GET NEXT NUMBER 01102000 ILLEGAL CLI 0(1),C'%' SEE IF END OF STRING 01104000 BE DONE YES DONE 01106000 XPRNT =CL50' ILLEGAL CHARACTER STOP',50 01108000 DONE ....MORE INSTRUCTIONS..... 01110000 CARD DC 81C' ' STORAGE FOR CARD 01112000 STORAGE DS 20F STORAGE FOR NUMBERS 01114000 REP DC C' THE NUMBER IN R2 IS' 01116000 AREA DC CL8' ' STORAGE FOR OUTPUT NUMBER 01118000 01120000 REFERENCES 01122000 01124000 The following documents of the other X-macros may be of use:01126000 XREAD/XPRNT/XPNCH, XMSYSGEN. 01128000 , 01130000 01132000 01134000 The Pennsylvania State University 01136000 Computation Center 01138000 01140000 Contributed Program 01142000 Contributor: John R. Mashey 01144000 Computer Science Department 01146000 01148000 360 ASSEMBLER XREAD/XPRNT/XPNCH 01150000 V.5.0. Jan 1973 01152000 01154000 ASSEMBLER UNIT-RECORD INPUT-OUTPUT MACROS 01156000 01158000 PURPOSE 01160000 Three macros XREAD (card READer), XPRNT (line PRINTer), 01162000 and XPNCH (card PuNCH) provide easy assembler 1/0 facilities 01164000 with the following features: 01166000 a) Only 1 statement is needed for each operation. No 01168000 OPEN's, CLOSE's, DCB's, etc are required. 01170000 b) REGISTERS - no registers are destroyed by these macros. 01172000 c) CONDITION CODE - XPRNT and XPNCH preserve the con- 01174000 dition code. XREAD sets it to indicate end-of-file 01176000 occurrence. 01178000 d) JOB CONTROL LANGUAGE - under most circumstances, 01180000 little or no extra JCL will be needed. 01182000 e) number of characters - may be specified in several 01184000 different ways, may be any length up to maximum 01186000 for device, and can be varied at execution time for 01188000 maximum flexibility. 01190000 f) XSET macro may be used to temporarily cancel output 01192000 messages, input statements to be omitted, etc, during 01194000 assembly time. 01196000 01198000 USE 01200000 All three macros use the same form of calling sequence: 01202000 01204000 01206000 label is an optional statement label 01208000 01210000 Xmacro is one of XREAD, XPRNT, XPNCH 01212000 01214000 area the address of the area to be read or written. 01216000 This may be specified in two different ways: 01218000 a) Anything valid in a LA instruction, for example HERE, 01220000 SYM+8(5), 2(4,6), =CL10'OMESSAGE' are all acceptable. 01222000 b) Either (O) or (RO), indicating that register O con- 01224000 tains the area address. 01226000 01228000 length specifies the number of bytes to be transferred. 01230000 This length should be in the range 1 to maximum 01232000 length for the device (80 for XREAD, XPNCH, l33 for XPRNT). 01234000 , 01236000 XREAD/XPRNT/XPNCH - 0201238000 01240000 01242000 If the length is incorrect, it will be ignored, and the maxi- 01244000 mum length used. The length may be specified in three dif- 01246000 ferent ways: 01248000 01250000 a) Directly, by providing an expression in the macro 01252000 call. 01254000 b) By default, by providing only an area address, which 01256000 will cause the appropriate maximum length to be used. 01258000 c) Indirectly, at execution time, by coding an ex- 01260000 pression enclosed in parentheses, indicating a general 01262000 purpose register which contains the number of bytes 01264000 to be read or written. 01266000 01268000 CONDITION CODE 01270000 XREAD sets the CC as follows: 01272000 CC = 0 - a card was read, and length characters transferred 01274000 CC = 1 - end-of-file was encountered-no more cards 01276000 01278000 01280000 CARRIAGE CONTROLS 01282000 XPRNT requires the first character of the area to be 01284000 a valid carriage control character. 01286000 01288000 JOB CONTROL LANGUAGE 01290000 The macros will accept DD cards with various DDNAMES, 01292000 but have been designed to use JCL already present in cer- 01294000 tain cataloged procedures, in order to minimize the 01296000 amount of extra JCL. The DD cards required for each macro 01298000 are listed below. Note that the PSU catalogued procedure 01300000 ASGCLG already contains a FT06F001 DD card, so this need 01302000 not usually be supplied by the user. 01304000 01306000 MACRO DD CARD FORM DDNAMES ALLOWED(for xxxxx) 01308000 XREAD //DATA.xxxxx DD * XREAD, INPUT, FT05F001 01310000 XPRNT //DATA.xxxxx DD SYSOUT=A XPRNT, FT06F001 01312000 XPNCH //DATA.xxxxx DD SYSOUT=B XPNCH, FT07F001 01314000 01316000 ***NOTE*** if you want to use the macros in combined FORTRAN- 01318000 Assembler programs, you must supply the X-ddnames, rather 01320000 than using the FORTRAN ones. 01322000 01324000 USAGE OF XSET 01326000 The macro XSET (described in writeup on XSNAP/XSTOP/XSET), 01328000 may be used to selectively cancel and restore generation of 01330000 any of these macros. It is used as follows: 01332000 XSET name=onoff 01334000 where name is XREAD, XPRINT, or XPNCH, and onoff is either 01336000 ON or OFF, which either permits or deletes generation of 01338000 the specified macro until it is changed again by another XSET. 01340000 , 01342000 XREAD/XPRNT/XPNCH - 0301344000 01346000 01348000 GENERAL INFORMATION 01350000 Each macro has an associated CSECT which it calls to 01352000 perform the actual 1/0 operations. The characteristics of 01354000 these CSECTS are listed below, together with their DCB's. 01356000 If the DCB's are unsatisfactory, they may be altered prior 01358000 to the first macro call, since the DCB names are all entry 01360000 point names also. 01362000 01364000 MACRO MAX LENGTH CSECT NAME CSECT LENGTH DCB NAME 01366000 XREAD 80 XXXXREAD 576 XXREDCB 01368000 XPRNT 133 XXXXPRNT 700 XXPRDCB 01370000 XPNCH 80 XXXXPNCH 596 XXPNDCB 01372000 XXXXOPEN 532 01374000 01376000 XXXXOPEN is called by all the csects to do the openning 01378000 of their dcb's for them. 01380000 01382000 The relevant paramaters of the current DCB's used are 01384000 as follows: 01386000 01388000 XXREDCB DCB DSORG=PS,MACRF=GM,RECFM=F,BUFNO=1,LRECL=80, 01390000 BLKSIZE=80 01392000 01394000 XXPRDCB DCB DSORG=PS,MACRF=PM,RECFM=FA,BUFNO=1,LRECL=133, 01396000 BLKSIZE=133 01398000 01400000 XXPNDCB DCB DSORG=PS,MACRF=PM,RECFM=F.BIFMP=1,LRECL=80, 01402000 BLKSIZE=80 01404000 01406000 STORAGE REQUIREMENTS 01408000 Each call on any of the macros generates from 32-42 bytes 01410000 of code depending on initial alignment and options used. This 01412000 is in addition to the storage required by any of the three 01414000 CSECT's used. 01416000 01418000 GLOBAL SET VARIABLES 01420000 Each of the macros used a GBLB variable of the form 01422000 &nameST, where name is the name of the given macro. These 01424000 are used in conjunction with XSET to control macro generation. 01426000 01428000 INNER MACROS CALLED 01430000 Each of the macros uses the inner macro XIONR. 01432000 , 01434000 XREAD/XPRNT/XPNCH - 0401436000 01438000 SAMPLE PROGRAM 01440000 The following program reads, prints, and punches cards, 01442000 and shows some the various ways of specifying the macro 01444000 operands. 01446000 01448000 // EXEC ASGCLG 01450000 //SOURCE.INPUT DD * 01452000 TITLE ' TEST PROGRAM FOR 1/0 MACROS' 01454000 TESTX10 CSECT 01456000 XSAVE TR=NO set up linkage, base register 01458000 XSET XPRNT=OFF cancel XPRNT for a while 01460000 XPRNT =CL50' THIS MESSAGE IS NOT GENERATED', 50 01462000 XSET XPRNT=ON allow XPRNT's again 01464000 LA 0,CARD save address of card 01466000 XPRNT =CL40'1 TEST EXAMPLES', 40 skip to new page 01468000 LA 2,50 set up length in register 01470000 XPRNT =CL50'0 WILL READ,PRINT,PUNCH',(2) 01472000 TLOOP XREAD CARD use default length=80 01474000 BNZ TDONE branch on end-of-file 01476000 XPNCH (0) use previously loaded address 01478000 XPRNT CARD-1,81 print card, with carriage cont 01480000 B TLOOP go back for next card 01482000 TDONE XPRNT MESSAGE,L'MESSAGE print ending message 01484000 XRETURN SA=*,TR=NO 01486000 MESSAGE DC CL100'OSUCCESSFULL COMPLETION OF TEST' 01488000 CARD DS CL80 01490000 end 01492000 //DATA.XPNCH DD SYSOUT=B required for card punch 01494000 //DATA.INPUT DD * 01496000 THIS IS THE FIRST TEST CARD 01498000 THIS IS THE SECOND TEST CARD 01500000 THIS IS LAST TEST CARD-END-OF-FILE FOLLOWS 01502000 01504000 01506000 01508000 REFERENCES: see the XGET/XPUT writeup for more generalized macros 01510000 allowing access to any sequential files. Also see XMSYSGEN for an 01512000 overview of the X-MACRO system. 01514000 , 01516000 01518000 THE PENNSYLVANIA STATE UNIVERSITY 01520000 Computation Center 01522000 01524000 CONTRIBUTED PROGRAM 01526000 Contributor: John R. Mashey, Computer Science Department 01528000 01530000 XSAVE/XRETURN 01532000 360 ASSEMBLER LANGUAGE writeup revised April 1972 (v.4.0)01534000 01536000 EXTENDED SAVE AND RETURN MACROS 01538000 01540000 INTRODUCTION 01542000 01544000 XSAVE and XRETURN provide various services for assembler language01546000 program linkage using OS/360 conventions. While offering many more01548000 options than SAVE and RETURN, they use defaults, thus allowing that01550000 few operands need be coded. Some of the services provided are:01552000 01554000 a) Saving or restoring any range or ranges of registers on program entry01556000 or exit, in a more general way than SAVE or RETURN. 01558000 b) Automatic initialization of 1 or more base registers for a program.01560000 c) Creating standard entrypoint identifier coding at a program entry.01562000 d) Generating reentrant code, using GETMAIN and FREEMAIN calls.01564000 e) Creating an AUTOMATIC PROGRAM TRACE or REGISTER DUMP whenever a01566000 module is entered or exited. 01568000 f) Permitting easy usage in CSECT's with multiple entries/exits.01570000 01572000 TYPICAL USAGE 01574000 01576000 The following shows the most common ways to use XSAVE and XRETURN:01578000 01580000 a) CSECT with a single entry point, at the CSECT name: 01582000 01584000 ACSECT CSECT 01586000 XSAVE 01588000 ..... the code for the csect. 01590000 XRETURN SA=* EXIT POINT: ALSO CREATE SAVE AREA 01592000 01594000 b) CSECT with single entry and exit, using register 13 as both a base01596000 register and save area pointer, generating save area inside XSAVE:01598000 01600000 BCESCT CSECT 01602000 XSAVE BR=13 CAUSE SAVE AREA TO BE HERE 01604000 ..... the code for the csect. 01606000 XRETURN 01608000 01610000 c) CSECT with multiple entry points: 01612000 01614000 CCSECT CSECT 01616000 ENTRY C1,C2 SEVERAL ENTRIES 01618000 C1 XSAVE 01620000 ..... the code for section C1 of CCSECT. 01622000 C1EXIT XRETURN 01624000 C2 XSAVE 01626000 ..... the code for C2. 01628000 C2EXIT XRETURN SA=* SAVE AREA AFTER LAST XRETURN ONLY 01630000 , 01632000 XSAVE/XRETURN - 02 01634000 01636000 The macros are described below, with arguments listed basically in01638000 order of importance. A programmer not yet familiar with S/360 linkage01640000 should concentrate on the options: RGS=,SA=, and BR= where they exist.01642000 01644000 XSAVE 01646000 PURPOSE 01648000 01650000 XSAVE is used at any entry point (CSECT, START, or ENTRY label) in01652000 an assembler program to save registers acccording to the standard01654000 conventions, set up new base register(s), and possibly perform program01656000 tracing and various other optional services. 01658000 01660000 USE 01662000 01664000 The macro allows 8 keyword operands, which can be used in almost01666000 any combination or omitted as desired. Reasonable defaults values are01668000 supplied so that few operands need normally be coded. It is called:01670000 01672000 label XSAVE RGS=,BR=,SA=,ID=,TR=,REEN=,OPT=,AD= 01674000 01676000 label is an optional statement label. 01678000 01680000 01682000 RGS= (ReGisterS) 01684000 01686000 This operand specifies the register(s) to be saved into the calling01688000 program's save area in the standard locations. It can specify that NO01690000 registers, a single range of registers, or multiple ranges of registers01692000 be saved, with the following operand types: 01694000 01696000 RGS=NO no registers are saved. 01698000 01700000 RGS=(list) list specifies the the registers to be saved, where each01702000 item in the list is either: 01704000 a) a single register designation (number or equate symbol) OR01706000 b) a pair of register designations, separated by a dash, showing the01708000 (inclusive) range of registers that should be stored. 01710000 For example, RGS=(14-15,2-12) causes registers 14,15, and all of 201712000 through 12 to be saved appropriately. 01714000 01716000 **DEFAULT VALUE** If omitted, RGS=(14-12) is assumed (normal linkage).01718000 01720000 BR= (Base Register(s)) 01722000 01724000 BR lists the base register(s) to be set up for the program just01726000 entered. It is either a single register, or a list of 2-4 of them,01728000 enclosed in parentheses, and separated by commas. If the latter format01730000 is used, a multiple USING statement and appropriate register-loading01732000 statements are generated. If the first (or only) register is 13, a save01734000 area is generated in the middle of the XSAVE, so that register 13 can be01736000 used both as a base register and as a save area pointer. WARNING: if01738000 register 13 is specified, do not code XRETURN SA=* later in the csect.01740000 01742000 **DEFAULT** BR=12 is assumed if this option is omitted. 01744000 , 01746000 XSAVE/XRETURN - 03 01748000 01750000 SA= (Save Area) 01752000 01754000 This option specifies the name of a save area to be used, and also01756000 controls whether the program actually has a save area or not (if it is a01758000 lowest-level routine calling no others, it might not have one).01760000 01762000 SA=NO no code is generated for linking save areas, and no save area01764000 is referenced by XSAVE code. Register 13 is unchanged, so this01766000 option should only be used by a routine which calls no others.01768000 01770000 SA=* this is normal linkage, with following actions: 01772000 01774000 a) register 13(calling program's save area) is loaded into another reg.01776000 b) the address of the called program's save area is placed into R13.01778000 c) the two registers are saved correctly to fill in the standard forward01780000 and backward linkage between calling and called programs' save areas.01782000 01784000 Part b) creates the statement LA 13,saveareaname , as follows:01786000 a) If this is the first XSAVE in a CSECT, a 'standard name' (unique to01788000 that CSECT) is created by the macro and referenced. 01790000 b) If this is not the first XSAVE, the current 'standard name' is used01792000 regardless of how it was originally created. 01794000 01796000 SA=name this specifies the same kind of linkage as SA=*, except that01798000 the name becomes the 'standard name' . 01800000 01802000 Briefly, the 'standard name' allows XSAVE and XRETURN macros to use01804000 and generate appropriately-named save areas, allowing either complete01806000 control over naming, or the convenience of giving no names. 01808000 01810000 **DEFAULT** If omitted, SA=* is assumed, giving standard linkage, with01812000 all XSAVE(s) in a CSECT referring to the SAME save area name.01814000 01816000 01818000 ID= (IDentifier) 01820000 01822000 ID specifies an identifying character string to be created just01824000 after the entry point. It aids debugging by making the entry point easy01826000 to locate in the dump, and may be printed in dump save area traces.01828000 01830000 ID=NO no identifier is created. This saves space and time.01832000 01834000 ID=* the identifier created is the first of the following found:01836000 the statement label, if one is coded on the XSAVE; the name of the01838000 CSECT in which the XSAVE is used, or $PRIVATE if the CSECT is unnamed.01840000 01842000 ID=string the string (1-255 characters) is the identifier. 01844000 01846000 **DEFAULT** If omitted, ID=* is assumed, thus creating some kind of ID.01848000 , 01850000 XSAVE/XRETURN - 04 01852000 01854000 TR= (TRace) 01856000 01858000 TR provides for automatic program tracing or register dumping01860000 whenever the entry point is given control, a useful debug feature.01862000 01864000 TR=NO no trace code is provided . 01866000 01868000 TR=* the message '*** name ENTERED ***' is printed on entry, where01870000 name is either the label on the XSAVE, or the name of its CSECT.01872000 01874000 TR='message' 'message' is printed on entry to the program. 01876000 01878000 TR=SNAP the message (as in TR=*) is printed, followed by a dump of the01880000 GP registers, before they get changed by called program.01882000 01884000 TR=('message',SNAP) 'message' and registers are printed. 01886000 01888000 **DEFAULT** TR=* is assumed, thus normally providing a dump (but see01890000 section at end called SPECIAL CONSIDERATIONS FOR TRACE CODE). 01892000 01894000 01896000 REEN=exp (REENtrant code) 01898000 01900000 REEN requires that reentrant code be generated, and give the number01902000 of bytes to be acquired via GETMAIN, IN ADDITION TO the 72 bytes needed01904000 for the standard savearea. The address of the acquired area is placed01906000 in register 13, so that first usable working storage begins at 72(13).01908000 If the called program uses the original values of register 15,0,1, they01910000 must be included in the registers saved by the RGS= option. The value01912000 exp may be any absolute expression. WARNING: this method is slow for01914000 heavily-used routines. 01916000 01918000 01920000 OPT= (OPTional declarations) 01922000 01924000 OPT provides for declaration of CSECT or ENTRY and/or TITLE.01926000 01928000 OPT=CSECT the label (required) on the XSAVE is declared a CSECT.01930000 01932000 OPT=ENTRY the label(required) on the XSAVE is declared to be an ENTRY.01934000 01936000 OPT=TITLE a TITLE is generated before any other code, and displays the01938000 label on the XSAVE statement. 01940000 01942000 OPT=(TITLE,xxxxx) xxxxx is either CSECT or ENTRY, combining the above.01944000 01946000 01948000 AD= (ADdress constant addressibility) 01950000 01952000 In some cases it may be necessary to have several entry points in01954000 a CSECT which share common USING conditions; AD can be used to do this.01956000 An address constant of the name specified is loaded into the first (or01958000 only) base register (BR=), and addressiblity declared. Typically the01960000 address constant refers to the name of the CSECT. 01962000 , 01964000 XSAVE/XRETURN - 05 01966000 XRETURN 01968000 01970000 PURPOSE 01972000 01974000 XRETURN is used to return from a module entered at an XSAVE, and is01976000 used to restore registers, set return code in R15, perform program trace01978000 and possibly generate a 72-byte save area referenced by XSAVE code.01980000 01982000 USE 01984000 The macro has 7 keyword operands, coded or omitted as desired:01986000 01988000 label XRETURN RGS=,SA=,RC=,RP=,T=,TR=,REEN= 01990000 01992000 label is an optional statement label 01994000 01996000 RGS= (ReGisterS) 01998000 02000000 This specifies the registers to be restored from the original02002000 calling program's save area, and is coded just like XSAVE RGS= option.02004000 02006000 **DEFAULT** RGS=(14-12) is assumed, restoring all registers.02008000 02010000 SA= (Save Area) 02012000 02014000 This option can be used to control the return linkage code, and if02016000 desired, creates an 18-fullword save area (filled with zeroes for debug02018000 purposes), immediately following XRETURN's executable code. 02020000 02022000 SA=NO the macro assumes that the routine is a lowest-level routine02024000 which calls no others. It generates neither the save area itself,02026000 nor code to reload register 13 with the address of th caller's save02028000 area. R13 is assumed to still point at the caller's save area.02030000 WARNING: use only paired with XSAVE SA=NO, else errors will occur.02032000 02034000 SA=* an 18-fullword save area is generated, labeled with the02036000 current 'standard name' described under XSAVE SA=* above.02038000 02040000 SA=name the save area is generated, and labeled with the name given.02042000 02044000 **DEFAULT** If SA is completely omitted, no save area is generated,02046000 but a save area is assumed to exist somewhere, and code generated02048000 to restore the previous save area pointer. The reason for this default02050000 is that any CSECT having several entry points still needs only 1 save02052000 area, which is typically generated only by the LAST XRETURN, so that it02054000 is addressible by ALL of the XSAVEs. Typically, a maximum of 1 SA=*02056000 should appear in the XSAVEs and XRETURNs in one CSECT. 02058000 02060000 RC= (Return Code) 02062000 02064000 Specifies a return code value to exist in register 15 on return to02066000 the calling program. The user need not worry about possible conflicts02068000 with RGS=, since RC overrides any inclusion of R15 in the RGS= option.02070000 02072000 RC=exp expression less than 4096 to be placed in register 15.02074000 02076000 RC=(r) specifies register currently containing the return code.02078000 , 02080000 XSAVE/XRETURN - 06 02082000 02084000 RP=exp (Return Past register 14) 02086000 02088000 RP provides a form of multiple (nonstandard) return to the calling02090000 program. The last instruction generated is not the usual BR 14, but02092000 B exp(14) instead. The value of exp is usually a multiple of 4, so02094000 that the calling program has 1 or more Branch statements following the02096000 call to the routine. 02098000 02100000 02102000 T=* (Tag save area) 02104000 02106000 This requests that byte 12 of the calling program's save area be02108000 set to X'FF' just before control is returned. This is useful for02110000 debugging, and is sometimes used by FORTRAN error-handling routines.02112000 02114000 02116000 TR= (TRace code) 02118000 02120000 This option is coded exactly as is XSAVE TR=, and does the same02122000 thing, except that the message printed is '*** name EXITED ***', where02124000 name is either the label on the XRETURN or the CSECT name. 02126000 02128000 02130000 REEN=exp (REENTRANT code) 02132000 02134000 REEN specifies reentrant code generation, and should be matched02136000 only with an XSAVE REEN=exp, where the two expressions are the same.02138000 The area addressed by register 13, of length exp+72, is freed using the02140000 FREEMAIN macro. WARNING: if this option is used, it is impossible for02142000 the XRETURN code to ever restore the values of registers 15, 0, 1 which02144000 existed in the calling program prior to entering the called module. Note02146000 that normal conventions require only that registers 2-12 be restored.02148000 02150000 SPECIAL CONSIDERATIONS FOR TRACE CODE 02152000 02154000 Note that the TR= options call the macro XSNAP (for SNAP options),02156000 or XPRNT for the others, so that the relevant writeups should be studied02158000 if any problems arise. In particular, the SNAP options may require a02160000 card like the following to be inserted for the execution step of the02162000 program (before or after a SYSUDUMP card): 02164000 02166000 //DATA.XSNAPOUT DD SYSOUT=A (non-PSU users may replace DATA with GO).02168000 02170000 The trace code (and ONLY the trace code) created by XSAVE and02172000 XRETURN can be eliminated by coding XSET XSAVE=OFF,XRETURN=OFF , and02174000 can be allowed again by replacing OFF by ON, as many times as desired.02176000 This allows leaving trace code in a program until it is debugged, then02178000 eliminating it by adding 1 XSET card at the beginning of the program.02180000 02182000 SYMBOLIC REGISTER EQUATES 02184000 02186000 Symbolic register equates may be used anywhere, and can be any02188000 symbols, except that any used for registers 13,14, or 15 must end in02190000 those characters, i.e., WORK13, R14, REG15 are acceptable. 02192000 , 02194000 XSAVE/XRETURN - 07 02196000 02198000 SAMPLE USAGE 02200000 The following sample program assumes that EQU's have been set up02202000 for R0 EQU 0, ... R15 EQU 15 . 02204000 02206000 * TYPICAL USAGE FOLLOWS. 02208000 XSAVE 02210000 CALL PROG2 02212000 XRETURN SA=*,RC=4 RETURN TO OS WITH RETURN CODE OF 4 02214000 * FOLLOWING CALLS EXTREME AND UNTYPICAL. 02216000 PROG2 XSAVE RGS=(R14,R0-R1,5-12),BR=(11,10),OPT=(TITLE,CSECT) 02218000 CALL LOWEST CALL LOWEST LEVEL ROUTINE 02220000 LA R3,5 SET UP LIMIT ON RECURSION DEPTH 02222000 CALL RECURSE CALL RECURSIVE ROUTINE 02224000 CALL PROG3 02226000 CALL PROG4 02228000 B BAD RETURN HERE| OR SKIP BRANCH VIA RP= 02230000 SR 15,15 CLEAR FOR RETURN CODE = 0 02232000 BAD XRETURN RGS=(14,0-1,5-12),SA=*,T=*,RC=(R15) 02234000 * LOWEST LEVEL ROUTINE FOLLOWS: NOTE CODE GENERATED. 02236000 LOWEST CSECT 02238000 XSAVE SA=NO,BR=15,TR=NO,ID=NO ZAP OPTIONS 02240000 XRETURN SA=NO,TR=NO 02242000 * FOLLOWING CSECT USES REEN FOR RECURSIVE CALLS. 02244000 PROGRAM CSECT 02246000 RECURSE XSAVE TR=('RECURSION',SNAP),REEN=0,OPT=ENTRY 02248000 BCT R3,CONTINU LOOP, RECURSING 02250000 B RETB GIVE UP NOW 02252000 CONTINU CALL RECURSE CALL MYSELF AGAIN 02254000 RETB XRETURN REEN=0 RETURN, FREE STORAGE 02256000 * ENTIRES PROG3 AND PROG4 HAVE SAME ADDRESSIBILITY, WITH AD. 02258000 PROG3 XSAVE OPT=ENTRY,SA=P3SAVE,BR=(12,11,10),AD=PROG3 02260000 PROG3A XRETURN RC=(R3),T=* 02262000 PROG4 XSAVE OPT=ENTRY,AD=PROG3,BR=(12,11,10),ID=PROG3ENTRYOFPROGRAM 02264000 LTR R0,R0 TEST TO DECIDE 02266000 BZ ZERO SKIP TO RP=0 02268000 XRETURN RP=4 BRANCH OVER BAD ABOVE 02270000 ZERO XRETURN RP=0,T=*,SA=* SAVE AREA, RP 02272000 END 02274000 02276000 REFERENCES 02278000 02280000 The following documents of other X-macros may be of use:02282000 XMSYSGEN, EQUREGS, XDUMP/XSNAP, XREAD/XPRNT/XPNCH. 02284000 02286000 The reader is also referred to the following manuals: 02288000 02290000 C28-6827 IBM S/360 OS FORTRAN IV (G&H) Programmer's Guide - Appendix C.02292000 (a concise explanation on save areas and linkage). 02294000 02296000 C28-6646 IBM S/360 OS Supervisor and DAta Management Services02298000 (pp. 10-18 approx: linkage, reentrancy). 02300000 02302000 C28-6647 IBM S/360 OS Supervisor and Data Management Macro Instructions02304000 (macros CALL, SAVE, RETURN) 02306000