litwr (litwr) wrote,
litwr
litwr

Emotional stories about first processors for computers: part 2 (DEC PDP-11)

Processors of DEC PDP-11



Since the early 70's in the world began a 10-year era of domination of the company DEC. DEC computers were significantly cheaper than those produced by IBM and therefore attracted attention from small organizations for which IBM systems were unaffordable. With these computers also begins the era of mass professional programming. PDP-11 computer series was very successful. Various PDP-11 models were produced from the early 70's to the early 90's. They were successfully cloned in the SU and became the first mass popular computer systems there. Some of SU made PDP-11 compatible computers have several unique traits. For example, several models like DVK are rather personal computers than minicomputers and several models like UKNC and BK are pure personal computers. BTW the mentioned BK became the first PC available for SU ordinary people to buy since 1985.

DEC also promoted the more expensive and complex computers of the VAX-11 family, the situation around which was somewhat politicized. And from the second half of the 70s, DEC practically stopped development in the PDP-11 line, in particular, the support of hexadecimal numbers for the assembler was not introduced. The performance of PDP-11 systems has also remained virtually unchanged since the mid-70s.

PDP-11 used various processors compatible with the main command system, for example, LSI-11, F-11, J-11. In the late 70's, DEC made a cheap processor T-11 for microcomputers. However, for unclear reasons, despite the seemingly large and high-quality software that could eventually be transferred to the system using it, it was not seen by the manufacturers of computer systems. The only exception was one model of the Atari gaming console. The T-11 found itself a mass application only in the world of embedded equipment, although in terms of capabilities it was slightly higher than the z80. SU produced processors K1801VM1, K1801VM2, K1801VM3, ... similar to DEC processors and also exact copies of DEC processors. The latter were much more expensive and were produced in small quantities.

The PDP-11 processor command system is almost completely orthogonal, a pleasant quality, but when it is brought to the extreme, it can create ridiculous commands. The command system of the PDP-11 processors has had an impact on many architectures and in particular on the Motorola 68000.

PDP-11 system of commands is strictly 16 bit. All 8 general purpose registers (and the program counter in this architecture is the usual R7 register) are 16 bit, the processor status word (it contains typical flags) 16 bit too, the size of instructions is from 1 to 3 16-bit words. Any operand of an instruction can be (although there are exceptions, for example, the XOR instruction) any type – this is orthogonality. Among the types are registers and memory locations. SU's programmers in the 80s sometimes didn't understand why Intel x86 instruction system misses memory to memory types of instructions. This was the influence of the PDP-11 school, where you can easily write the full addresses of each operand. This, indeed, is slow and especially slow for systems with typical since the early 90's slow RAM. It is possible to form a memory address using a register, a register with an offset, a register with autoincrement or autodecrement. Particularity of the PDP-11 instruction system is a possibility to use double indirect access to memory through a register, for example, MOV @(R0)+,@-(R1) means the same as the operator **–r1 = **r1++; of the C/C++ programming languages, where r0 and r1 are declared as signed short **r0, **r1;.

Another example, an instruction MOVB @11(R2),@-20(R3) corresponds to **(r3-20) = **(r2+11);, where r2 and r3 are declared as char **r2, **r3;.

In the modern popular architectures, one instruction for such cases can be not enough, it may require at least than 10 instructions. It is also possible to get an address relative to the current value of the program counter. I will give another example with more simple addressing. The x86 instruction ADD [BX+11],16 corresponds to ADD #16,11(R4). In DEC assemblers, it is common to write operands from left to right, unlike Intel, where they write from the right-left. There is a reason to believe that the GNU assembler for x86 was made under the influence of the PDP-11 assembler.

Division and multiplication instructions are only signed and not available on all processors. The arithmetic of the decimal numbers is optional too – it is so-called commercial arithmetic in DEC terminology. As a curiosity of full orthogonality, I will give an example of the command MOV #11,#22, which after execution turns into MOV #11,#11 – it is an example of using a direct constant as an operand. Another curious instruction is a unique instruction MARK which code needs to be placed on the stack and which can never be used explicitly. Calling subroutines in the architecture of the PDP-11 is also somewhat peculiar. The corresponding instruction first saves the allocated register (can be any) on the stack, then saves the program counter in this register and only then writes a new value to the program counter. The return from the subroutine instruction must do the reverse and know which register was used when calling the subroutine. Strange effects can be sometimes obtained using the program counter as a normal register.

It is interesting that among the programmers on PDP-11 there is a culture of working directly with machine codes. Programmers could, for example, work without a disassembler when debugging. Or even write small programs directly into memory, not assembling!

Indeed, instruction timings are not too fast. It was surprising to find out that on a BK home computer the instruction to send from a register to register takes as much as 12 clocks (10 clocks when using the code from ROM), and the instructions with two operands with double indirect addressing are executed for more than 100 clocks. Z80 does 16-bit register transfer for 8 clocks. However, the slowness of BK is caused not so much by the processor, but by the poor quality of SU made RAM, under the features of which BK had to be adapted. If fast enough memory was used, BK would send 16 register bits for 8 clock cycles too. Once there was a lot of controversy, which is faster than BK or Sinclair ZX Spectrum? I must say that the Spectrum is one of the fastest mass 8-bit personal computers when using the top 32 KB of memory. Therefore it is not surprising than the Spectrum is faster than BK, but not much. And if BK worked with fast enough memory it could be even a bit faster.

The code density is also rather a weak point in the PDP-11 architecture. Instruction codes must be multiples of the machine word length – 2 bytes, which is especially frustrating when working with byte arguments or simple commands like setting or resetting a flag.

There were interesting attempts to make a personal computer on the basis of PDP-11 architecture. One of the first PCs in the world that appeared only a bit later that Apple ][ and Commodore PET and rather a bit earlier than Tandy TRS-80, was Terak 8510/a, which has black and white graphics and an ability to load an incomplete variant of Unix. This computer was quite expensive and, as far as I know, was only used in the system of higher education in the USA. DEC itself also tried to make its PC, but very inconsistently. DEC, for example, produced PCs based on z80 and 8088 explicitly playing against its own main developments. PDP-11 architecture based PCs DEC PRO-325/350/380 have some rather contrived incompatibilities with the underlying architecture that impeded the use of some software. Best of all personalization of technologies of mini-computers turned out in the USSR, where produced BK, DVK, UKNC, ... By the way, the Electronica-85 is a quite accurate clone of the DEC PRO-350.



Made in USSR 16-bit home computer (model of 1987) – it is almost PDP-11 compatible



K1801VM2 processor which is used in DVK is about two times faster than K1801VM1, K1801VM3 is even faster and has the performance close to Intel 8086.

Processors of top PDP-11 computers can address up to 4 MB of memory but for one program can be allocated no more than 64 KB. The performance of these processors in the number of operations per megahertz is also close to Intel 8086 too, still slower than it though.

Tags: 8086, computer, cpu, dec, gnu, hardware, history, intel, pdp-11, processor, vax-11, x86
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments