a style question
Byron Rakitzis
byron at archone.tamu.edu
Tue Oct 16 01:38:16 AEST 1990
In article <1990Oct12.225501.15701 at cbnewsm.att.com> lfd at cbnewsm.att.com (leland.f.derbenwick) writes:
>
>One of the main heritages of the PDP-11 is that most people use
>the constructs "*p++" and "*--p" more often than "*++p" and "*p--";
>for char or int arguments, the first two could be compiled into a
>single PDP-11 instruction, while the other two required an extra
>instruction. (Of course, if C were really intended only as a
>structured assembler, the two forms that didn't conform to the
>instruction set would never have been included.)
>
> -- Speaking strictly for myself,
> -- Lee Derbenwick, AT&T Bell Laboratories, Warren, NJ
This is not true for the PDP-11 alone. Don't several architectures
(notably the VAX) support predecrement and postincrement register
addressing modes? Correct me if I'm wrong, but I thought the m68k was
the same way.
Of course, on a RISC, the post- form will fill the delay slot with the
increment/decrement. This is equally true for incrementing and decrementing
though. So perhaps we will be seeing more of "*p++" and "*p--"...
---
Byron Rakitzis.
More information about the Comp.lang.c
mailing list