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

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

Path: 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 09:14:00 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 24
Message-ID: <2025Mar12.101400@mips.complang.tuwien.ac.at>
References: <vpufbv$4qc5$1@dont-email.me> <5e696219dedf30d0095dfd7671a4c87f@www.novabbs.org> <vqpuja$22eta$1@dont-email.me> <XT1AP.458543$2zn8.23180@fx15.iad> <vqqkca$1uln$1@gal.iecc.com> <vqql32$28fls$4@dont-email.me>
Injection-Date: Wed, 12 Mar 2025 10:21:21 +0100 (CET)
Injection-Info: dont-email.me; posting-host="e153970a2f02b13d8544fa3a32e66bd4";
	logging-data="2659219"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+6Y7DIrUy4n6i+Ys4oaeqi"
Cancel-Lock: sha1:Dk583vFjN/hcSKI37ZKJormG000=
X-newsreader: xrn 10.11

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Wed, 12 Mar 2025 00:26:50 -0000 (UTC), John Levine wrote:
>
>> Next was PDP=11 where MOV R1,R2 copies R1 into R2.
>
>What about CMP (compare) versus SUB (subtract)? CMP does the subtract 
>without updating the destination operand, only setting the condition 
>codes. But are the operands the same way around as SUB (i.e. backwards for 
>comparison purposes) or are they flipped?

In AT&T syntax for IA-32 and AMD64, the operands are the same way
round as for SUB (i.e., flipped compared to Intel syntax).  This leads
to counterintuitive combinations of compare and branches.  E.g., "cmp
%rax,%rbx; jlt ..." jumps if %rax is greater than %rbx.

For the PDP-11, where the mnemonics etc. were created with that order
in mind, the mnemonics of the flags-using instructions could be named
appropriately.  I.e., after "cmp x,y" or "sub x,y", "blt" could branch
if x<y.  I have not checked if that's the case for the PDP-11, though.

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