Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

IBM Mainframe Assembly and CLIST #10

Merged
merged 2 commits into from over 2 years ago

2 participants

Jahgro Ivan Kanakarakis
Jahgro

This is a hello, world program for the IBM Mainframe assembly language. This was written on the z/OS operating system, but it would work on most older mainframe Operating systems.

I have also (belatedly) included a hello, world CLIST program. I'm not quite sure how pull requests work, i hope you pick that one up also.

Ivan Kanakarakis c00kiemon5ter merged commit 5a01c0b into from December 02, 2011
Ivan Kanakarakis c00kiemon5ter closed this December 02, 2011
Ivan Kanakarakis

Hi and thanks!
This is nice stuff :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
59  a/mainframe_assembly
... ...
@@ -0,0 +1,59 @@
  1
+R0       EQU   0                                                      
  2
+R1       EQU   1                                                      
  3
+R2       EQU   2                                                      
  4
+R3       EQU   3                                                      
  5
+R4       EQU   4                                                      
  6
+R5       EQU   5                                                      
  7
+R6       EQU   6                                                      
  8
+R7       EQU   7                                                      
  9
+R8       EQU   8                                                      
  10
+R9       EQU   9                                                      
  11
+R10      EQU   10                                                     
  12
+R11      EQU   11                                                     
  13
+R12      EQU   12                                                     
  14
+R13      EQU   13                                                     
  15
+R14      EQU   14                                                     
  16
+R15      EQU   15                                                     
  17
+**********************************************************************
  18
+* HELLO WORLD IN ASSEMBLY FOR THE IBM MAINFRAME COMPUTER             *
  19
+**********************************************************************
  20
+*                                                                     
  21
+HELLOW   CSECT ,                                                      
  22
+HELLOW   AMODE ANY                                                    
  23
+HELLOW   RMODE 24                                                     
  24
+*                                                                     
  25
+         STM   R14,R12,12(R13)    SAVE REGISTERS IN OLD SAVE AREA     
  26
+         LR    R12,R15            ESTABLISH NEW BASE REG              
  27
+         USING HELLOW,R12         USE BASE REG                        
  28
+*                                                                     
  29
+         LA    R14,SAVEAREA       GET OUR SAVE AREA                   
  30
+         ST    R14,8(,R13)        KEEP A(NEW SA) IN OLD SA            
  31
+         ST    R13,4(R14)         KEEP A(OLD SA) IN NEW SA            
  32
+         LR    R13,R14            R13 -> NEW SA                       
  33
+**********************************************************************
  34
+* BEGIN LOGIC                                                        *
  35
+**********************************************************************
  36
+         OPEN  (SYSPRINT,(OUTPUT)) OPEN OUTPUT                        
  37
+         PUT   SYSPRINT,PRINTLN   PRINT LINE                          
  38
+         CLOSE SYSPRINT           CLOSE OUTPUT                        
  39
+**********************************************************************
  40
+* END LOGIC                                                          *
  41
+**********************************************************************
  42
+RETURN   DS    0H                                                     
  43
+         XR    R15,R15            CLEAR RETURN CODE                   
  44
+         L     R13,4(R13)         GET OLD SAVE AREA                   
  45
+         L     R14,12(R13)        GET BACK ALL REGISTERS              
  46
+         LM    R0,R12,20(R13)     GET BACK ALL REGISTERS              
  47
+         BR    14                           RETURN                    
  48
+         DROP  R12                DROP USING                          
  49
+**********************************************************************
  50
+* HELLOW SAVE AREA                                                   *
  51
+**********************************************************************
  52
+*                                                                     
  53
+* CONSTANT SAVE AREA                                                  
  54
+         LTORG ,                                                      
  55
+         DS    0F                                                     
  56
+SAVEAREA DS    18F                REGISTER SAVE AREA                  
  57
+SYSPRINT DCB   LRECL=133,MACRF=PM,DSORG=PS,RECFM=FB,DDNAME=SYSPRINT   
  58
+PRINTLN  DC    CL133'HELLO, WORLD!'                                   
  59
+         END   ,                                                      
6  c/clist
... ...
@@ -0,0 +1,6 @@
  1
+/***********************************/
  2
+/* HELLO WORLD PROGRAM WRITTEN     */
  3
+/* IN CLIST ON THE IBM Z/OS        */
  4
+/* OPERATING SYSTEM                */
  5
+/***********************************/
  6
+WRITE HELLO, WORLD!                  
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.