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: <5e696219dedf30d0095dfd7671a4c87f@www.novabbs.org> 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 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