[Info-vax] How much of VMS is still in MACRO-32?

Andrew Commons andrew.commons at bigpond.com
Wed Jun 2 03:13:27 EDT 2021


On Wednesday, 2 June 2021 at 10:07:31 am UTC+9:30, Arne Vajhøj wrote:
> On 6/1/2021 8:33 PM, Michael Moroney wrote: 
> > On 5/31/2021 9:07 AM, Simon Clubley wrote: 
> > 
> >> Is there any self-modifying code in VMS ? (I hope the answer to that 
> >> is no, BTW. :-)) 
> > 
> > There's self-modifying code on the CDC 6x00 systems -- IN THE HARDWARE. 
> > You see, the procedure call instruction (RJ nnn) jumps to address nnn+1 
> > (60 bits) and writes a branch to the instruction after the RJ 
> > instruction at address nnn. To return from the procedure, branch to the 
> > entry point nnn and execute the (branch) instruction written by the RJ 
> > instruction. 
> > 
> > Obviously this prevents recursive code or anything like that. 
> > 
> > If I recall correctly, a register save/restore procedure (ab)used the RJ 
> > instruction to write a bunch of self-modifying code.
> I remember that. 
> 
> Pascal could do recursion. 
> 
> Fortran could not. 
> 
> Unless one wrote two small Compass routines to get and set the 
> saved address and managed that in a small array. 
> 
> Arne

The CDC 6X00 systems did not have a hardware stack pointer which left you with the RJ kludge.

I recall writing one small Compass routine that implemented and managed a return stack that
allowed me to have quasi-recursive Fortran routines.



More information about the Info-vax mailing list