By mistake I stumbled upon some very old libraries of mine, with mainframe assembler code. Not just a few programs with a few lines of code, but tons of code, complete program products from days gone by. I had almost forgotten my days as a mainframe assembler developer, While browsing the code it all came back I was an autodidact, starting by reading Principles of operations, and some assembler manuals and endless sleepless nights, it was fun. I started with a simple program reading the master operator console, responding to some prompts. After some years I created mini operating systems, a database manager, a super fast search engine, interacting with CICS,IMS, DB2, RACF. During a few years I was mesmerized by the possibilities the assembler language gave you. Then I gave it all up for consulting with SAS Institute program products. When I started my consulting career, I just had a weekend of private studies of the entire SAS Institute package. First weeks I just faked, but that's another story.
If you really know assembler and have a good library of macros, you can be amazingly productive, since you have direct contact with the operating system and the computer. If you also can do you hexadecimal calculating well, operating system dumps are easy like books to read. It would be fun to go back to my roots and start a second career as an assembler programmer.
MACRO
&NAME LJENTRY &BREGS,&VERSION=,&WAREA=GETMAIN,&RSAVE=(14,12), X
&WAREAN=WAREA 00030074
.**********************************************************************
.* THIS MACRO SHOULD BE USED TO START ALL THE MODULES WHICH FORM *
.* PART OF THE PROPER PROGRAM PRODUCT. *
.* *
.* FUNCTIONS INCLUDE:- *
.* *
.* 1. SAVING CALLERS REGISTERS. *
.* 2. CHAINING SAVE AREAS. *
.* 3. BASE REGISTER ASSIGNMENT. *
.* 4. SET UP OF COPYRITE NOTICE. *
.* 5. CLEAR ASSIGNED WORKING STORAGE TO X'00'. *
.* TO CLEAR THE WORK AREA THIS MACRO USES REGISTER 6,7,8 AND 9.*
.* *
.* PARMS: *
.* BREGS - NUMBERS OF BASE-REGISTERS *
.* VERSION - RELEASE VERSION AND PTF LEVEL (X.X.X) *
.* WAREA: *
.* NONE MODULE DO NOT HAVE A WORKING STORAGE SECTION *
.* (R) A(WORKING STORAGE) PROVIDED BY CALLER IN R *
.* GETMAIN WORKING STORAGE IS OBTAINED BY PROGRAM. *
.* A-TYPE ADDRESS WORKING STORAGE RESIDES IN PROGRAM CSECT *
.* *
.* IF WAREA IS (R) OR GETMAIN THIS MODULE REQUIRES THAT THE *
.* PROGRAM HAS A DSECT DEFINED AS FOLLOWS: *
.* *
.* NAME DSECT *
.* SAVEAREA DS 18F'0' *
.* NAMEL EQU *-NAME *
.* *
.* NAME IS SPECIFIED IN WAREAN UNLESS WAREA IS AN *
.* A-TYPE ADDRESS *
.* *
.* IF WAREA IS AN A-TYPE ADDRESS THIS MODULE REQUIRES THAT *
.* SPACE IS RESERVED FOR REGISTER SERVING PURPOSE AT THE *
.* BEGINING OF WAREA *
.* *
.* RSAVE: *
.* IGNORE CALLERS REGISTERS WILL NOT BE SAVED *
.* (RX,RY) CALLERS REGISTERS WILL BE SAVE BY A STM OPERATION *
.* IF CALLED MODULE REQUEST REGISTERS TO BE SAVED (AND CHAINED)*
.* THIS MACRO REQUIRES THAT THE CALLER PROVIDES AN 18F AREA *
.* POINTED TO BY R13. *
.* *
.* THE FIRST 18 FULLWORDS OF THE WORK AREA CONTAIN THE SAVE AREA FOR *
.* THIS MODULE. ANY WORKING STORAGE WHICH MUST BE UPDATED SHOULD BE *
.* DEFINED WITHIN THIS WORK AREA AFTER THE SAVEAREA DEFINITION. *
.* *
.* CREATED APRIL 1986. BY L. JOHANSSON LAJ SOFTWARE PRODUCTION. *
.**********************************************************************
GBLC &SREGS REGS TO SAVE GLOBAL FOR END MACRO
GBLC &WORK AQUIRE WAREA GLOBAL FOR END MACRO
GBLC &WAREAN1 WORK AREA NAME GLOBAL FOR END MACRO
LCLC &BREG1 BASE REGISTER 1
&BREG1 SETC '&BREGS(1)'
&SREGS SETC '&RSAVE'(2,5)
&WORK SETC '&WAREA'
&WAREAN1 SETC '&WAREAN'
.*
AIF ('&SREGS' EQ 'GNORE').SAVE1 SAVE CALLERS REGS?
.SAVE ANOP YES WE SAVE CALLERS REGS
STM &SREGS.,12(R13) SAVE CALLERS REGISTERS
AGO .BASE
.SAVE1 ANOP NO WE DONT SAVE CALLERS R
BC 0,4(0,15) STEP LOC COUNT EQ WITH STM
.BASE ANOP
LR &BREG1,15 SET UP 1:ST BASE.
AIF (N'&BREGS EQ 1).BASE1
AIF (N'&BREGS EQ 2).BASE2
MNOTE 16,'LJENTRY - SPECIFY ONE OR TWO BASE REGISTER(S)'
MEXIT
.BASE1 ANOP
USING &SYSECT,&BREG1 ONE BASE REGISTER
AGO .CONST
.BASE2 ANOP
LCLC &BREG2 BASE REGISTER 2
&BREG2 SETC '&BREGS(2)'
USING &SYSECT,&BREG1,&BREG2 TWO BASE REGISTERS
.CONST ANOP
B CONS&SYSNDX BRANCH AROUND CONSTANT AREA.
AIF ('&WAREA' EQ 'NONE').CONST1
AIF ('&WAREA'(1,1) NE '(' AND '&WAREA' NE 'GETMAIN').CONST1
DC A(&WAREAN1.L) LENGTH OF WORK AREA
AGO .CONST4
.CONST1 ANOP WORKAREA STARTS AT A LABEL IN MODULE
DC A(*-*) NO WORKAREA LENGTH = 0
.CONST4 ANOP
DC AL1(CONS&SYSNDX-*) LENGTH OF LABEL
DC CL8'MODULE -' EYE CATCHER.
DC CL8'&SYSECT' MODULE NAME.
DC CL8'VERSION-' EYE CATCHER.
DC CL8'&VERSION' VERSION.RELEASE.LEVEL .
DC CL8'&SYSDATE' DATE COMPILED.
COPYRITE
CONS&SYSNDX DS 0H
AIF (N'&BREGS LT 2).WAREA
LA &BREG2,2048(0,&BREG1) LOAD UP ...
LA &BREG2,2048(0,&BREG2) 2ND BASE REGISTER.
.WAREA ANOP
AIF ('&WAREA' EQ 'NONE').SLUT
AIF ('&WAREA' NE 'GETMAIN').WAREA1
GETMAIN R,LV=&WAREAN1.L GET WORKING STORAGE FOR MODULE.
LR R6,R1 CLEAR ...
LA R7,&WAREAN1.L GOTTEN ...
SR R9,R9 WORK AREA ...
SR R8,R8 TO ...
MVCL R6,R8 ZEROES.
AGO .CHAIN
.WAREA1 ANOP
AIF ('&WAREA' EQ '(1)').CHAIN
AIF ('&WAREA'(1,1) EQ '(').WAREAR
LA R1,&WAREA LOAD A(WORKAREA)
AGO .CHAIN
.WAREAR ANOP
LR R1,&WAREA LOAD A(WORKAREA)
.CHAIN ANOP
ST 13,4(0,1) CHAIN
ST 1,8(0,13) SAVE AREAS.
LR 13,1 NEW S-A ADDRESS.
USING &WAREAN1.,R13 MAKE WAREA ADDRESSABLE.
L R1,4(R13) R1 ==> CALLERS SAVE AREA.
L R0,20(R1) R0 = R0 ON ENTRY.
L R1,24(R1) R1 = R1 ON ENTRY.
.SLUT MEND