Deutsch   English   Français   Italiano  
<2025Mar12.090207@mips.complang.tuwien.ac.at>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Why VAX Was the Ultimate CISC and Not RISC
Date: Wed, 12 Mar 2025 08:02:07 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 70
Message-ID: <2025Mar12.090207@mips.complang.tuwien.ac.at>
References: <vpufbv$4qc5$1@dont-email.me> <vqdrh9$3cdrc$1@dont-email.me> <vqek6h$3fro6$1@dont-email.me> <fe70b48cd6fef0aaf89278163d8b6322@www.novabbs.org> <vqfmr4$3npgk$1@dont-email.me> <vqg04o$3p80h$1@dont-email.me> <vqgbao$3rbkh$1@dont-email.me> <9371fe9be75cdd606c876f539e1d2d78@www.novabbs.org> <vqnps4$1j63b$1@dont-email.me> <0da86de26bac1912b190793512255aa4@www.novabbs.org> <vqo8b1$1ln7o$1@dont-email.me> <5e696219dedf30d0095dfd7671a4c87f@www.novabbs.org> <vqpuja$22eta$1@dont-email.me>
Injection-Date: Wed, 12 Mar 2025 09:41:38 +0100 (CET)
Injection-Info: dont-email.me; posting-host="e153970a2f02b13d8544fa3a32e66bd4";
	logging-data="2659219"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18gAY3WHP90+M6orfy1GzgZ"
Cancel-Lock: sha1:UY1WgeHYAxtQ/54c5jSAipDynuo=
X-newsreader: xrn 10.11
Bytes: 4364

Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>I wonder if the different preferences is at least partially due to 
>whether the person has a hardware or a software background?  The idea is 
>that when hardware guys see the instruction, they think in terms of 
>register ports (read versus write), what is required of the memory 
>system (somewhat different for loads versus stores), etc.  However 
>software guys think of a language construct, e.g. X = Y, which is 
>logically a move.  I don't know if this is right, but I think it is 
>interesting.

I am a software person.  When talking about register-memory copies, I
prefer to talk about load and store operations, whether I talk about
assembly language (even one where the mnemonic for these operations is
MOV) or C; in Forth the spoken names for these operations are "fetch"
(written: @) and "store" (written: !).

My first programming was on the TI-58C programmable calculator, which
has RCL (recall) and STO (store).

Then some BASIC, where you write A = Expr.

Then some 6502 assembly language, which has, e.g., LDA (load into
accumulator) and STA (store from accumulator).

In his HOPL paper Ritchie describes a number of competitors of C
(e.g., BLISS), most of which make the use of addresses explicit,
unlike C.  So copying from one variable to another in one of these
languages was along the lines of

a = .b

where a and b are addresses of variables, and "." fetches the value
from the address (i.e., C's *).  C won out over these languages, and
it seems to me that Ritchie thought that the different approach in C
with lexprs and (value) exprs was a major contributing factor.

Back to assembly languages:

In PDP-11-style architectures (e.g., 8086, IA-32, AMD64, 68000), where
you have instructions of the form

op r  ,m/r
op m/r,r

it's pretty obvious that you implement load, store, and
register-register copy as special cases of this scheme.  And the
common mnemonic for these three operations in all these architectures
is MOV.  This does not come out of higher-level software
considerations, this comes out of the architecture, and how to
implement the assembler and disassembler for it in the simplest way.

By contrast, RISC architectures do not follow this scheme, so they
have mnemonics starting with L (for load) and S (for store).

Looking at <https://www.righto.com/2023/08/datapoint-to-8086.html>,
the Datapoint 2200 and the 8008 called both LAM (load A from M(emory))
and LMA (store A to M(emory)) a load.  This continues in the 8008.
The 8080 assembly language replaces LAM with MOV A,M and LMA with
MOV A,M.  On the 8086 they are replaced with MOV AL,[BX] and
MOV [BX],AL.

>A somewhat related question, if one wants to copy the contents of R3 
>into R2, is that a load or a store? :-)

It's a register-register copy.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>