register variable

D

dandelion

Chris Croughton said:
Also it allowed values to be keyed directly into the registers from the
front panel switches, which was necessary with some of the bootstrap
code (for instance to determine whether you wished to load from paper
tape, card, DECTape, etc., and which particular device). It also
allowed a register to be examined in the same way as other memory, hence
saving cost (and front panel space).


The early PDP-11 machines didn't have instruction (or data) cache, they
only had the magnetic core store.

It actually took more hardware to prevent the registers from being
executable, so why bother? TTL chips were expensive, and nothing else
was protected...

(alt.folklore.computers has a number of people who remember PDP-11
machines fondly...)

Chris C

In todays standards it's *still* Yuck... However, your explaination (and the
one of the other poster) clarifies a lot: Long live VLSI.

Thanks.

dandelion.
 
D

Dan Pop

In said:
[...] No sensible compiler would allocate such a
variable into a register

Except perhaps on a system where registers have addresses, such as
some members of the PDP-11 family.

Bad example. The addresses of the registers of the PDP-11 family are
usable only for accessing the registers from the console switches. You
can't do it in software for the simple reason that each 16-bit register
is allocated an 8-bit byte address in the PDP-11 I/O space: R0-R7 are
mapped on the 777700-777707 address range. A 16-bit access on an odd
address (e.g. 777701 for R1) would generate a UNIBUS error.

There are architectures where the registers can be accessed as genuine
memory locations or where ordinary memory locations are used as registers,
but I doubt any compiler writer would bother using this feature when
handling incorrect C code that takes the address of a register variable.

Dan
 
D

Dave Thompson

Is a register address on that member of the PDP-11 family the same as a
memory address? If not... Well... I

Reading or writing certain addresses near the top of the address space
would read or write the registers instead of external memory. I don't
have a PDP-11 handbook here to check the details.
[/QUOTE]
In addition to not being "word" (even) addresses as Dan has noted,
they were in the part of the address space used for I/O devices,
access to which was (for good reason) usually prohibited in user mode.
At least on models with modes (and memory management) and my
recollection -- ICBW -- is that all models with registers-in-I/O did.
Although of course at least one quite significant C (nonhosted)
program did run in kernel mode on such machines. said:
There were even machines in which the registers were executable. If I
recall correctly, you could fit short loops into registers on the
PDP-10, where they would execute much faster. (Semiconductor
registers were an optional add-on - I used to have a price list that
included them.)
Formally, but AIU the consensus on alt.sys.pdp10 of (some) people who
were there is that no KA10 (the first model) was ever shipped to an
actual customer without the "option" -- although some were built and
used inhouse -- and on later models "fast registers" were standard.


- David.Thompson1 at worldnet.att.net
 
D

Dan Pop

In said:
In addition to not being "word" (even) addresses as Dan has noted,
they were in the part of the address space used for I/O devices,
access to which was (for good reason) usually prohibited in user mode.
At least on models with modes (and memory management) and my
recollection -- ICBW -- is that all models with registers-in-I/O did.

You're wrong. All the models with console switches, even the most basic
ones (/05, /10, /20) with no CPU modes and no memory management had
registers-in-I/O because this was the only way for the operator to
access their contents. By the time console switches have been replaced
by firmware console emulators (the second generation of PDP-11s), having
the registers mapped in I/O space was no longer a must.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top