strangest systems I've sent email from
Jerome H. Fine
jhfinedp3k at compsys.to
Mon May 9 22:42:02 CDT 2016
>Mouse wrote:
>Note that PDP-11 autoincrement and autodecrement exist only when
>operating on pointers that are being indirected through, and even then
>only when the pointers are in registers. C ++ and -- work fine on
>things other than pointers, and on pointers when not indirecting
>through them.
>
Maybe users of C and C++ don't bother, but those user who write
in assembler for the PDP-11 will often take advantage of the ability
of the autoincrement (and on rare occasions the autodecrement)
properties of the instructions set to add (and rarely subtract) 2 and
sometimes 4 within a given register:
TST (R3)+
CMP (R3)+,(R3)+
CMP (R2)+,(R3)+
rather than
ADD #2,R3
ADD #4,R3
ADD #2,R2 / ADD #2,R3
Naturally, the original value MUST be even and the original value
in R3 can't be the address of an area in the IOPAGE which could
then result in an address exception. These opportunities occur
more often that would be expected and many users took advantage
of a tiny reduction in the size of a program, especially in the early
days when core storage was severely limited.
Jerome Fine
More information about the cctalk
mailing list