Computer Old Farts Forum
 help / color / mirror / Atom feed
From: "Greg 'groggy' Lehey" <grog@lemis.com>
To: Paul Winalski <paul.winalski@gmail.com>
Cc: coff@tuhs.org
Subject: [COFF] Re: Terminology query - 'system process'?
Date: Sat, 16 Dec 2023 13:04:08 +1100	[thread overview]
Message-ID: <ZX0FmK-lK8K5MVjB@hydra.lemis.com> (raw)
In-Reply-To: <CABH=_VTV+ypgEVvbRTNwxC5os_2PuZLXJPSB0ai8n7r_-tQXbA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2216 bytes --]

On Friday, 15 December 2023 at 12:51:47 -0500, Paul Winalski wrote:
> The usual programming convention for IBM S/360/370 operating systems
> (OS/360, OS/VS, TOS and DOS/360, DOS/VS) did not involve use of a
> stack at all, unless one was writing a routine involving recursive
> calls, and that was rare.  Addressing for both program and data was
> done using a base register + offset.  PL/I is the only IBM HLL I know
> that explicitly supported recursion.  I don't know how they
> implemented automatic variables assigned to memory in recursive
> routines.  It might have been a linked list rather than a stack.

Yes, the 360 architecture doesn't have a hardware stack.  Subroutine
calls worked with was something like a linked list.  Registers were
saved in a “save area", and they were linked.

At least in assembler (I never programmed HLLs under MVS), by
convention R13 pointed to the save area.  From memory, subroutine
calls worked like:

  LA    15,SUBR        load address of subroutine
  BALR  14,15          call subroutine, storing address in R14

The subroutine then starts
with

  STM  14,12,12(13)    save registers 14 to 12 (wraparound) in old save area
  LA   14,SAVE         load address of our save area
  ST   14,8(13)	       save in linkage of old save area
  LR   13,14           and point to our save areas

Returning from the subroutine was then

  L    13,4(13)        restore old save area
  LM   14,12,12(13)    restore the other registers
  BR   14              and return to the caller

Clearly this example isn't recursive, since it uses a static save
area.  But with dynamic allocation it could be recursive.

> I remember when I first went from the IBM world and started
> programming VAX/VMS, I thought it was really weird to burn an entire
> register just for a process stack.

Heh.  Only one register?

/370 was an experience for me, one I never wanted to repeat.

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2023-12-16  2:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 23:29 Noel Chiappa
2023-12-14 23:54 ` Larry McVoy
2023-12-15  1:15 ` Bakul Shah
2023-12-15 17:51   ` Paul Winalski
2023-12-15 18:08     ` Warner Losh
2023-12-16  2:04     ` Greg 'groggy' Lehey [this message]
2023-12-16 19:21       ` Paul Winalski
2023-12-16 19:44         ` Paul Winalski
2023-12-15 13:43 ` Dan Cross
2023-12-19 13:54 ` Derek Fawcus via COFF
  -- strict thread matches above, loose matches on Subject: below --
2023-12-20 20:35 Noel Chiappa
2023-12-20 19:31 Noel Chiappa
2023-12-20 20:29 ` Paul Winalski
2023-12-31  3:51 ` steve jenkin
2023-12-14 21:48 [COFF] " Noel Chiappa
2023-12-14 22:06 ` [COFF] " Bakul Shah
2023-12-14 22:12   ` Warner Losh
2023-12-14 22:09 ` Clem Cole
2023-12-15 14:20   ` Dan Cross
2023-12-15 16:25     ` Warner Losh
2023-12-15 17:13     ` Bakul Shah
2023-12-15  6:24 ` Lars Brinkhoff
2023-12-15 18:30   ` Stuff Received

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZX0FmK-lK8K5MVjB@hydra.lemis.com \
    --to=grog@lemis.com \
    --cc=coff@tuhs.org \
    --cc=paul.winalski@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).