![]() ![]() ![]() |
MVC 0(0,R4),0(R5) ** Executed ** EX R3,*-6 Move string to output lineI use to code like this but now move the executed statement out of program flow. Even worse are things like "B *+12"
MVC 0(12,R5),=C'somedatahere' *** BAD *** MVC 0(L'DATA,R5),DATA *** GOOD line 1 *** DATA DC C'somedatahere' *** GOOD line 2 ***Sometimes I'm lazy and don't always follow this practice.
L R4,CVTPTR -> CVT L R4,CVTJESCT-CVTMAP(R4) -> JESCT L R4,JESSSCT-JESCT(R4) -> SSCVTA lot of people would have two extra USING and DROPs for the CVT and JESCT DSECTS. I feel this obscures the code with extra statements that get in the way. If you're looking at a lot of fields in a DSECT, use a USING, if only one or two, use the FIELD-DSECT(R?) method.
Dave's personal recommendation: If all you need is the current date and time, don't invoke LE/370 routines, use the IBM TIME macro. If you need the julian date converted to gregorian, you could use the CONVTOD, and STCKCONV macros to do this for you.
To subtract two TOD clock values (64-bit unsigned integers), I generally use something like (for A-B): LM R0,R1,A Load A SL R1,B+4 Subtract low order part of B BC 11,*+6 Branch if no borrow BCTR R0,0 Perform borrow SL R0,B Complete the subtraction . . A DS 2F B DS 2F
CVT DSECT=YES,LIST=NO ... AIF (NOT D'CVTH4430).MVS43X At MVS 4.3 maclib or higher? CSVQUERY ... .MVS43X ANOP ,To see a program that does extensive MVS macro library level checking, see Gilbert Saint-flour's SHOWMVS which is in File492 of the CBT tape
MVC OUT(7),=X'4020206B202020' ED OUT(7),YEARwill correctly edit this result and leave the variable OUT = X'4040F26BF0F0F0'.
The recommended format is: Bytes 0-3: reserved Bytes 4-7: character string 'F4SA' (analogous to 'F1SA' at this offset when regs are saved in the linkage stack) Bytes 8-127: 8-byte GPRs in order 14-12 Bytes 128-135: address of previous savearea Bytes 136-143: address of next savearea It is z/OS 1.2 that will introduce storage above 2G. But that release does not support passing control between programs in AMODE 64. Modules are expected to get control in AMODE 31 and switch when needed to AMODE 64. The system will not give control to modules in AMODE 64. When you control your caller, you can have the caller provide a 144-byte savearea and then you can use the linkage convention described above. When you cannot control your caller (or your caller is the system) you likely need to live with the 72-byte savearea that an unchanged caller would provide, and that means that you need to save registers on the linkage stack, or need to save the high halves of the GPRs in your own dynamic storage after you have obtained it. This latter case is the "F5SA" case which looks just like the "F4SA" case except it has the character string "F5SA" at bytes 4-7, and has an additional 72 bytes following byte 143, for saving the high halves of GPRs 0-15 (plus 8 reserved bytes). The savearea types are as follows: -- 72-byte standard savearea that we know and love -- F1SA at bytes 4-7: 72-byte SA, caller's regs saved on linkage stack -- F4SA at bytes 4-7: 144-byte SA, caller's regs saved in caller's 144-byte SA in the F4SA format above -- F5SA at bytes 4-7: 216-byte SA, low halves of caller's regs saved in caller's 72-byte save area, high halves saved in callee's dynamic area as described earlier -- F6SA at bytes 4-7: 144-byte SA, caller's regs saved on linkage stack Please note carefully that just as certain registers are "expected" to remain unchanged when using standard linkage, a target program should take care to preserve the high halves of registers 2 through 14 so that they are unchanged upon return.
Warning: Just because you CAN disassemble a module doesn't mean that you LEGALLY have the right to do so...
**CCHHR- 0343000A0A RECORD LENGTH- 000008 MEMBER NAME IEFBR14 000000 1BFF 07FE SR BCR |
The next sequential instruction to be executed in program GETABEND was at displacement 000000A6. 00000098 18D1 LR R13,R1 0000009A 58101004 L R1,4(,R1) 0000009E 58101018 L R1,24(,R1) 000000A2 50000000 ST R0,0 NSI==> 000000A6 D2130000E008 MVC 0(20,R0),8(R14) 000000AC 58D0D004 L R13,4(,R13) 000000B0 41F00000 LA R15,0 000000B4 58E0D00C L R14,12(,R13) 000000B8 980CD014 LM R0,R12,20(R13) |
ED 3823(174,11),2814(12)
Dave's HLASM web pages IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |