On Sat, Mar 11, 2017 at 6:52 AM, Tony Thigpen <[email protected]> wrote:

> I am working on some REALLY old code. Some of the code has dates back in
> 1967! The oldest date found is 5/9/67.
>
> This code is still running daily. That's as good as 50 years later. The
> only reason we are touching the code is because we are migrating this
> application from z/VSE to z/OS.
>
> I don't know the original operating system, but I expect it was DOS/360.
> But, it could have been an early OS/360.
>
> Anyway, I am seeing some code that am interested to know about,
> historically.
>
> For instance, it appears that USING could not support multiple registers.
> I see this code sequence in the 'start' macro:
>
>          USING *,3         ESTABLISH REG 3
>          USING *+4095,4    AND REG 4
>          USING *+2*4095,5  AND REG 5 AS BASE REGS
>
> Also, it appears that R15 was not standardized to have the programs entry
> address because they used:
>
> &NAME    BALR  3,0         INITALIZE REG 3
>          LA    3,0(3)
>          BCTR  3,0
>          BCTR  3,0
>          LA    4,4095(3)         AND REG 4
>          LA    5,4095(4)       AND REG 5
>
> (FYI: The above code snippets were contiguous.)
>
> Also, when they needed to call a subroutine, it appears they did not yet
> have =A(xxx) constants, because they had to manually adjust the address:
>
>          L     15,=V(UPSI)   LOAD REG 15 WITH UPSI ROUTINE ADDRESS
>          AR    15,3  ADD RELOCATION FACTIR FROM REG 3
>          BAL   14,4(15)   BRANCH TO UPSI RETURN IN REG 14


This definitely looks like DOS. Back then, the executable libraries were
called: "Core image" libraries. Why? Because the linkage editor resolved
VCONs to an _absolute_ address based on the "partition" in which it was
running. So if you linked a program in F1, you could not run it in F2. That
is, the "program loader" did not have RLD ability. The code you showed is
how the programmers of the day wrote "position independent" code which
could run in any partition.

Back in my days of multiple base registers (on MVS, not DOS), I did code
similar to:

MYPROG CSECT
                 USING *,R11,R10,R9
                 LR        R11,R15
                 LA        R2,2048
                 LA        R10,2048(R2,R11)  R10=2048+(R2)+(R11)==4096+(R11)
                 LA        R9,2048(R2,R10)    R9=2048+(R2)+(R10) ==
4096+(R11) == 8192+(R10)



> --
> Tony Thigpen
>



-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

Reply via email to