2 ms·
That's interesting, as I'd assumed the BCPL/B/C progression happened alongside the PDP-7 to PDP-11 progression with the PDP-11 being the design that regularised
by hazeii 6y ago
That's interesting, as I'd assumed the BCPL/B/C progression happened alongside the PDP-7 to PDP-11 progression with the PDP-11 being the design that regularised things.
The full set of addressing modes uses 3 bits, thus 8 addressing modes. Using these addressing modes on the program counter (R7) gave a lot of flexibility and was how constants and memory were loaded and stored. It might sound complex but in practice was incredibly easy:-
mov #141,@#177566 ; Output 'a' to the terminal
That's a "MOV (PC)++,@(PC)++" instruction that loads the next word from memory (octal 141) and increments the PC and stores in the address given by the next word (after the constant, as the PC has just been auto-incremented) and finally autoincrements the PC again to leave it pointing to the next instruction. The layout in memory would thus be:-
12737 # Instruction: MOV (PC)++,@(PC)++
00141 # ASCII 'a'
177566 # Address of terminal outer buffer
Given these games using the PC to address data and memory, PDP-11 programmers had little difficulty when it came to understanding C pointers.