Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Aron Insinga <aki@insinga.com>
To: coff@tuhs.org
Subject: [COFF] Re: ancient macros, machine code translation,as mental architecture models
Date: Sun, 14 Jul 2024 21:44:37 -0400	[thread overview]
Message-ID: <980ed84f-8d93-4940-bd01-51bea7b10d18@insinga.com> (raw)
In-Reply-To: <v713rr$1foh$1@gal.iecc.com>

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

On 7/14/24 14:02, John Levine wrote:
> According to Aron Insinga<aki@insinga.com>:
>> On 7/13/24 19:46, John Levine wrote:
>>> I looked at the manual and I think he's misreading it. The "words" in
>>> question are the tokens in the macro definition. ...
>> Possibly, but they use 'syllables' for tokens (symbols or integers), and
>> they say here that they advance the location counter after each word
>> copied.  If they were copying characters into the input stream, they
>> would not be incrementing the location counter ('.') after each word
>> transferred.
> If you really want to know what it did, here's the internals manual.
> The description of the macro facility starts on page 19 and it is
> quite clear that they're storing a tokenized version of the macros, so
> they're not copying characters, but they're not just copying assembled
> instructions either.
>
> https://bitsavers.org/pdf/dec/pdp1/F36P_PDP1_Macro_Internals.pdf

Thank you!!  I found the PDP-1 and TX-0 MACRO sources and was sadly 
unsurprised by the lack of comments, so they are difficult reading.

    http://www.bitsavers.org/bits/DEC/pdp1/papertapeImages/20040106/macro_6-63/_text/part2.txt

They are not storing tokens.  In fact, the list of 'codes' for items 
stored as the macro body on p 20 is:
     a storage word,
     a dummy symbol specification.
     a constant,
     a dummy symbol parameter assignment, or
     an end marker.
So it is not storing tokens for instructions, just storage words 
(instructions or data) as mentioned in the user manual.

In the discussion in the internals manual, after the paragraph 
mentioning the year this was designed (a nice touch), they say that they 
are storing the macro body as 'partially assembled' 'words' into which 
the dummy symbols are 'inserted'.  (And in a single-address architecture 
with a small memory address, addition is enough to do that insertion.)  
They explain why they did this instead of storing characters:

They do not look at the opcode as I suggested was possible, they have a 
more general solution that works for a word containing either code or data.

I think that this may be (at least as far as any of us know) a unique 
case from the early days of computing where, on the TX-0 and a port to 
the PDP-1, a macro body *is* stored as a list of 'machine words' instead 
of source text.  The macro  body is not manipulated as a 'higher-level 
construct', it is just used for quite limited macro expansion.

This has NO bearing on what DEC/HP/VSI did more than two decades later 
for the Alpha, Itanic, and x86_64 (where macros are expanded by the 
conventional insertion of characters from the macro body into the source 
text stream).

- Aron

[-- Attachment #2.1: Type: text/html, Size: 4118 bytes --]

[-- Attachment #2.2: 1RaBLgOaK9W7nogv.png --]
[-- Type: image/png, Size: 101224 bytes --]

  reply	other threads:[~2024-07-15  1:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-13 22:00 [COFF] " Douglas McIlroy
2024-07-13 23:46 ` John Levine
2024-07-14  0:54   ` Dan Cross
2024-07-14  1:04     ` Aron Insinga
2024-07-14  0:56   ` Aron Insinga
2024-07-14 18:02     ` [COFF] Re: ancient macros, " John Levine
2024-07-15  1:44       ` Aron Insinga [this message]
2024-07-15 14:09         ` Paul Winalski
2024-07-15 12:37 Douglas McIlroy
2024-07-15 14:26 ` Paul Winalski
2024-07-15 14:38   ` Bakul Shah via COFF
2024-07-15 19:39 ` John Levine
2024-07-16 19:55   ` Aron Insinga
2024-07-16 20:09     ` Aron Insinga

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=980ed84f-8d93-4940-bd01-51bea7b10d18@insinga.com \
    --to=aki@insinga.com \
    --cc=coff@tuhs.org \
    /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).