Planet MVS Dave's unofficial HLASM web page Dave's z/Architecture Assembler FAQ |
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.
Non-Commerical products | |
z390 portable mainframe macro assembler and emulator. | The z390 macro assembler, linker, and emulator toolkit provides a way to develop, test, and deploy mainframe compatible assembler programs using any computer that supports the Sun Microsystems Java J2SE 1.5.0 runtime. The entire toolkit is distributed in both Java source and executable form under the open source GPL license. |
Assembly and execution | |
ASSIST (copy hosted by Northern Illinois University). | ASSIST (Assembler System for Student Instruction and Systems Teaching) is an IBM System/370-compatible assembler/interpreter developed in the 1970s at Penn State University. Originally, ASSIST was available only to universities and was implemented at over one hundred of them. In 1998, Penn State declared that ASSIST was no longer copyrighted and that the program was freely available. |
Assembly and execution | |
PC/370 v4.2 IBM 370 assembler and emulator | This link is to a ZIP file which was last updated in 1991. This package was written by Donald S. Higgins and has been turned it into a product sold by Micro Focus. |
Assembly and execution | |
Commerical products | |
Micro Focus Mainframe Express | "To support applications that need to access mainframe assembler routines, an assembler run-time facility is now embedded in Mainframe Express." |
Assembly and execution | |
SimoX390 | SimoX390 is a mainframe Assembler Analysis Tool. This tool is provided to assist in the initial evaluation phase of offloading, maintaining, developing, and/or testing of mainframe assembler programs using Mainframe Express from MERANT. SimoX390 is also very useful for getting a quick overview of the mainframe assembler programs and their dependent macro and copy files. |
Analysis only (no assembly or execution) | |
Systems/ASM |
Systems/ASM is Dignus' HLASM compatible assembler product for the
IBM mainframe. Systems/ASM assembler software allows users to
develop mainframe applications on a mainframe, or on UNIX and
Windows workstations.
Their Systems/C product also generates HLASM-compatible assembler code. |
Generates S/390 Assembler code | |
Tachyon 390 Cross Assembler |
Develop And Maintain 370/390 Assembler Programs From Your Workstation!
Runs on Windows, OS/2, UNIX and Linux. Quoting the vendor:
The Tachyon Operating System includes the powerful Tachyon 390 Emulator and its integrated symbolic debugger. Most of the ESA/390 instruction set and many of the IBM OS/390 and DFSMSdfp services and control blocks are emulated, enabling the Tachyon Operating System to execute application-level programs and even some system-level programs.Feature Article: New Relationship With Tachyon Software to Benefit SAS/C Cross-Platform Compiler Users Sites |
Assembly and Execution |
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 S/390 Assembler FAQ web page 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. |