Mike,

You should get yourself a good intro to the PDP-11, for example one of the 
PDP-11 Processor Handbook copies you can find on Bitsavers.  It answers that 
question and many others.

The key point is that you have to distinguish virtual addresses from physical 
ones.  The I/O device addresses are physical addresses.  The program uses 
virtual addresses.  Physical addresses can be 16, 18, or 22 bits depending on 
the model; virtual addresses are always 16 bits.

The power on default mapping is that physical addresses 0-157777 map to 
physical addresses with leading zeroes; virtual addresses 160000 and up map to 
physical adddresses with leading ones.  So, for example,

        mov     #101, @#177566

moves the value 0101 (decimal 65, the ASCII code for "A") to physical address 
17 777 566 which should result in A appearing on the console output.

On machines with an MMU (which is most of them) the mapping from virtual to 
physical can be changed, and for example the "I/O page" (top 4kW of physical 
memory) might not be accessible.  But by universal software convention, in 
kernel mode 160000 and up (MMU page 7) are always mapped to the physical I/O 
page address range.  

        paul


> On Feb 16, 2018, at 10:05 AM, Mike Stramba <mikestra...@gmail.com> wrote:
> 
> Greetings,
> 
> I'm trying to figure out how console I/O works with the PD11.
> 
> Or more generally I/O addressing
> 
> E.g.
> A  "sh TTO"  gives :
> 
> TTO, address=17777564-17777567, vector=64, 7p
> 
> And 17777564 (octal) is 4,194,164 dec, which is obviously out of range
> of the 64K addressable by any MOV instruction.
> 
> But various diagnostic routines, e.g. below, are using
>     movb rX,@#177566       ; output to console
> 
> https://www.ak6dn.com/PDP-11/M9312/23-248F1/23-248F1.mac
> 
> Are I/O devices always at the "top 64k" of memory ?
> 
> If so, why doesn't  SH DEV display :
> 
> xxx xxx-177 777  ?
> 
> Mike
> _______________________________________________
> Simh mailing list
> Simh@trailing-edge.com
> http://mailman.trailing-edge.com/mailman/listinfo/simh

_______________________________________________
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to