Questions tagged [pdp-11]

The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years.

The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years. The PDP-11 had several uniquely innovative features, and was easier to program than its predecessors with its use of general registers. Its successor in the mid-range minicomputer niche was the 32-bit VAX-11.

Design features of the PDP-11 influenced the design of microprocessors such as the Motorola 68000; design features of its operating systems, as well as other operating systems from Digital Equipment, influenced the design of other operating systems such as CP/M and hence also MS-DOS. The first officially named version of Unix ran on the PDP-11/20 in 1970. It is commonly stated that the C programming language took advantage of several low-level PDP-11–dependent programming features, albeit not originally by design.

Source.

35 questions
10
votes
6 answers

Is "for(;;)" idiom for infinite loop correctly attributed to PDP-11 C compiler?

Recently I found this article that claims that the idea to prefer for(;;) over while(1) for infinite loop came because the C compiler originally available on PDP-11 generated an extra machine instruction for while(1). Btw now even Visual C++…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
4
votes
1 answer

UNIX V6 processes swap time

Trying to get how famous UNIX level six kernel works. The question is about where in the source code https://pages.lip6.fr/Pierre.Sens/srcv6/ process switching is triggered? In the Lions commentary on UNIX source code I meet clock() function in the…
Shkodzer
  • 69
  • 4
4
votes
3 answers

sub-routines on Assembly

can I do something like this on Assembly bne jsr swap, if not how can I solve this problem from C, thanks in advance if(start!=pivot_index){ swap(board,start,pivot_index); } I was taught that I must write jsr and sub-routine but can I do…
lego69
  • 1,403
  • 3
  • 12
  • 15
3
votes
2 answers

Is there any documentation for pre-K&R c?

I was playing around with an online PDP11 emulator (link) and was looking at the programming section of its FAQ. It says this about programming in C on the emulator: You need to write pre-K&R C which is quite a bit different from modern C I…
user14189755
2
votes
1 answer

Beginner bare-metal pdp11 console output

I am trying to understand the elementary basics of using a pdp-11 (learned the instruction set in college, want to revisit this), wanting to shoot some characters out the TTO/DL11 as a first program (unless that is too complicated a first…
old_timer
  • 69,149
  • 8
  • 89
  • 168
2
votes
3 answers

clock on pdp-11

I'm a little bit confused about simple program which I wrote, can You please explain why it quits after printing only one character, I expected it will print me character every 5 seconds, thanks in advance tks = 177560 tkb = 177562 tps = 177564 tpb…
helloWorld
  • 2,929
  • 7
  • 24
  • 19
2
votes
2 answers

printer in pdp-11

I have this snippet of the code. can somebody explain why It doesn't work, I want every 5 seconds print "Syntax Error" thanks in advance tks = 177560 tkb = 177562 tps = 177564 tpb = 177566 lcs = 177546 . = torg + 2000 main: mov #main, sp mov…
helloWorld
  • 2,929
  • 7
  • 24
  • 19
2
votes
1 answer

swap on assembly

I wrote swap on assembly, but I'm not sure that my code is right, this is the code swap: mov r1, -(sp) mov (sp) r1 mov 2(sp) (sp) mov r1 2(sp) mov (sp)+, r1 rts pc swap receives pointer from stack
lego69
  • 767
  • 1
  • 12
  • 20
2
votes
3 answers

Optimizing comparison instruction count (PDP-11)

For PDP-11, how can I change the following snippet of assembly so that it's only two instructions, yet does the same work as these four? tst r0 blt label cmp r0, #75 bgt label
lego69
  • 1,403
  • 3
  • 12
  • 15
2
votes
2 answers

addressing modes in PDP-11

I have this instruction: Move @-4(pc), 766(r5) pc : 1000 (start point) Can you explain how this instruction should run?
Rawhi
  • 6,155
  • 8
  • 36
  • 57
1
vote
0 answers

GNU Assembler for PDP-11 does not check BR range limit

I'm using gas to build a project for the PDP-11 compatible machine. And I noticed unexpected behavior in some cases. But I'm not sure - is it a bug or I did something wrong. First, it does not display an error or warning in a case when the…
Oleg Tsymbalyuk
  • 345
  • 1
  • 4
  • 10
1
vote
1 answer

pdp 11 assembler - problems with sub command

so we are using a pdp 11 simulator and i am trying to subtract one register from another this way: sub r2, r4 what i want is that r4 will contain the difference between the values kept in r2 and r4, instead i get a huge, unrelated number. i tried…
timsa7
  • 69
  • 3
  • 9
1
vote
1 answer

Panic function in UNIX

I'm currently trying to get some version of the function idle() from the UNIX OS working. I've got the source code, but I'm not good with assembly language (something I've recently been trying to change). Could somebody help me get a better…
b0kiii
  • 48
  • 6
1
vote
2 answers

PDP-11 assembler: how do "single operand instructions" work

I'm trying to understand PDP-11 assembly. For that I'm going through this document. The PDP-11 has several sets of instruction-types. One being single operand instructions, an other is double operand instructions. A double operand instructions would…
Folkert van Heusden
  • 433
  • 4
  • 17
  • 38
1
vote
0 answers

pdp-11 assembly-error 8-illegal charcater

Good evening i am a new programmer ,trying to compile the below code at assembly using pdp-11 simulator. But im stack with errors,i'm sure about the syntax but can't define where the error or what to change. the code : movb @#tkb, r0 bic #177600,…
doronbs11
  • 15
  • 1
  • 4
1
2 3