4.4. LSI, RT-11, TSX

4.4.1. ONLINE DEBUG TECHNIQUE ON THE LSI-11/02

The prompt character fo the LSI is the 'at' sign (@). To enter values into LSI memory, open the location by typing n/ where n is the memory address. ODT will display the current contents of the location and wait for a new value and/or a close command (e.g.[Return]). For example, to enter the value 003467 at location 1000, type

@ 1000/ nnnnnn 3467 [Return]

To start execution of a program that is in memory, type nG, where n is the starting address.

The following is a summary of ODT commands:

n/                open location n and display contents.                     
                                                                            
Rn/               open general register Rn and display contents.            
                                                                            
RS/               open status register and display contents.                
                                                                            
[Return]          close location.                                           
                                                                            
[Linefeed]        close location and open next location.                    
                                                                            
^                 close location and open previous location.*               
                                                                            
@                 close location but use contents as next location to       
                  open.*                                                    
                                                                            
_                 close location but use PC+contents as next location to    
                  open.*                                                    
                                                                            
nG                begin executing program at location n (GO).               
                                                                            
P                 execute next instruction (PROCEED).                       

If your program is in an endless loop you can press the break key to return you to the @ prompt. If this fails try turning the LSI off and on.

* These commands do not work under ODT on the RT-11 systems.

4.4.2. RT-11 ON THE LSI-11/02

4.4.2.1. INTRODUCTION TO RT-11

RT-11 is a single-user operating system, like many systems running on personal computers today. When the LSI is powered on, RT-11 produces a message, runs a check program, and gives the system prompt (a dot):

RT-11FB V05.04 D

.R MSCPCK

.

At this point you can enter commands to the system. Though most documentation on RT-11 shows all commands in upper-case letters, RT-11 does not generally distinguish between upper and lower-case, so either can be used. Some of the more frequenty used commands are illustrated in the following table.

DIR                       - gives a directory listing.                      
                          - DIR/BRIEF gives a shorter version.              
                                                                            
DEL file                  - deletes file(s).                                
                          - separate multiple filenames with commas (no     
                          spaces).                                          
                                                                            
TYPE file                 - types the contents of a file onto the console.  
                                                                            
COPY file1 file2          - copies file1 to file2.                          
                                                                            
RENAME file1 file2        - give a file another name.                       
                                                                            
EDIT file                 - edit a file using the KED editor.               
                          - use EDIT/CREATE to create a new file.           
                                                                            
MACRO file                - assembles a Macro-11 file.                      
                                                                            
LINK file                 - links object files created by MACRO.            
                                                                            
RUN file                  - runs an executable file created by LINK.        

Filenames consist of three parts:

(1) the logical device name,

(2) the file name, and

(3) the file type or extension.

Since our LSI-11s have only one device (the disk), this is the default device and does not have to be specified. The filename can have a maximum of six characters, the first of which must be alphabetic. The extension begins with a dot and is followed by three characters. Though any extension may be used, the system uses several extensions to consistently identify certain file types. Some of these are:

.BAK          backup files produced by the editor                    
.MAC          Macro-11 source program                                
.OBJ          object module produced by the Macro-11 assembler       
.LST          listing file produced by the Macro-11 assembler        
.SAV          a load module produced by LINK (the executable         
              program)                                               
.SYS          system files                                           

Some commands (e.g. DEL) allow you to specify several files using the wildcard character, an asterisk (*). For example. you can delete all the backup files using

DEL *.BAK [Return]

or all files related to theTEST program using

DEL TEST.* [Return]

4.4.2.2. ASSEMBLING, LINKING, AND RUNNING MACRO-11 PROGRAMS

4.4.2.2.1. ASSEMBLING

Once a Macro-11 program is entered into a file using the editor, it must be converted to machine language. The first step in this process is to assemble the program using the Macro-11 assembler. The simplest form of this command is

MACRO filename [Return]

If no extension is specified with the filename, .MAC is assumed. This command will produce the file filename.OBJ.

Several options may be given after the file specification. They include:

/LIST - produces a listing file ("filename.LST") in your directory

/DISABLE:GBL - produces error for undefined symbols

(instead of assuming they are globals)

If the program contains macros that are defined in a library, the library may be specified at assembly time:

MACRO filename+libname/LIBRARY [Return]

where libname is the name of the library file; it is assumed to have a .MLB extension.

4.4.2.2.2. LINKING

The object file produced by the assembler contains machine language instructions beginning at location 0. The linker will relocate the program to the position it will reside in memory when it is loaded and executed. The LINK command has the form

LINK filename [Return]

It assumes the extension of the file is .OBJ, and it produces the file filename.SAV.

Often several source files are combined to produce one executable program. To do this, each source file is assembled separately and then the .OBJ files are linked together. It is the linker that resolves the global references between the files. To produce a load map of the complete program, use the /MAP option:

LINK/MAP:filename.MAP file1,file2,... [Return]

Linking over five files :

Normally when you link files you enter: LINK main,sub1,sub2. However only a limited number of files can be linked in this manner. To link a group of files you can create a command file that contains the names of the files you wish to link. For example:

.type linker.com [Return]

link/library:sy:io11sr.olb/prompt

main

sub1

sub2

//

^C

Note that the last line of the command file is the shift-6 key followed by the letter 'C'; it is not a control-C sequence.

To run the command file enter: @linker [Return]

4.4.2.2.3. RUNNING THE PROGRAM

Once the program has been assembled and linked, it can be executed with the command:

RUN filename [Return]

(The filename is assumed to have a .SAV extension.)

4.4.3. TSX-PLUS

TSX-Plus is a multi-user extension to the RT-11 operating system, running on a PDP-11/44. This means that system commands are virtually identical to RT-11, with the added security of user accounts.

To use the TSX system, log on through the dataswitch. Though any terminal may be used, the KED editor requires a VT100-type terminal. Type the return key on the terminal until the dataswitch responds with Request:. The TSX system names are Minerva and Hydra. For example:

Request: minerva [Return]

or

Request: hydra [Return]

4.4.3.1. .LOGGING IN AND OUT

Log in to TSX by giving your login name and password at the prompts. Note that the system prompt for Minerva is "Minerv" because the system is restricted to 6 character names.

Login please: (enter your login name)

Password: (enter your password - it will not be echoed)

Welcome to the system

Minerv .

Although the standard prompt for RT-11 is a dot "." the TSX prompt has been changed to resemble the system name in order to clarify to procedure of using Kermit to transfer files between RT-11 and TSX.

e.g. Minerv . and Hydra .

You may change your password as you log in by typing the current password followed by a slash ('/') and then a new password. None of this will be echoed.

Log out by typing bye [Return] or off [Return].

4.4.3.2. LOGGING IN FROM HOME

Users may log into the TSX machines in the same way that they log into other campus machines from home. Campus modems work at speeds from 300 to 2400 BAUD and can be reached at the number 586-5550. The communication software you use must be capable of emulating a VT100 terminal. It must also provide some way of emulating the VT100 numeric keypad which is used for the KED editor. Yterm software is available from Computing Services which emulates a VT100 terminal. The VT100 keyboard is mapped to the function keys as shown in the following table.

GOLD HELP FINDNEXT DELLINE

FIND UNDELLINE

X(F1) X(F2) X(F3) X(F4)

PAGE SECTION APPEND DELWORD

COMMAND FILL REPLACE UNDELWORD

[F5) [F6) X(F7) X(F8)

ADVANCE BACKUP CUT DELCHAR

BOTTOM TOP PASTE UNDLECHAR

X(F9) X(F10) X(X(Shift)[F1)) X(X(Shift)[F2))

WORD EOL CHAR ENTER

CHNGCASE DELEOL SPECINS X(X(Shift)[F6))

X(X(Shift)[F3)) X(X(Shift)[F4)) X(X(Shift)[F5))

BLINE SELECT SUBSTITUTE

OPENLINE RESET

X(X(Shift)[F7)) X(X(Shift)[F8))

4.4.3.3. HELP

TSX includes a help command to provide information about all system commands. Type

HELP command-name [Return]

4.4.3.4. DISK PARTITIONS

The disk on the TSX system is divided into several partitions: one for each user, and one for the system. Files from the system disk must be preceded by SY:. For example, the I/O macro library is in the system partition and must be referenced as SY:300LIB. For example, in the .LIBRARY directive:

.LIBRARY /SY:300LIB/

Each user's partition is assigned to A:. After your account has been in use for some time your disk space may become very fragmented resulting in some of your disk space being wasted. You can see this fragmentation by typing DIR/FREE [Return]. To gain back this space lost to fragmenting the squeeze command should be used:

SQUEEZE/NOQUERY A: [Return]

A partition NEW: has been set up to hold files that you can access. For example, to obtain the assignment cover sheet, enter the command:

COPY NEW:COVER.TXT A:COVER.TXT [Return]

4.4.3.5. ASSEMBLING, LINKING, AND RUNNING

TSX provides the same editor (KED), assembler, and linker as RT-11. A simple method of obtaining a printout of a small run on TSX is to dump the screen image to a file. This is accomplished by entering ^P which copies the screen image to a file that begins with WIN e.g. WIN10A.001 A file is sent to a TSX line printer with the command:

LPR username filename.filetype [Return]

Programs that use IO-11 macros can be run under TSX. However, you cannot run programs on the TSX system which use the CS300 macros or directly write to I/O registers. These programs must be transferred to one of the RT-11 systems, or to one of the LSIs.

4.4.3.5.1. RUNNING ON RT-11

Either the source file (file.MAC) or the executable module (file.SAV) may be transferred to an RT-11 system using kermit (refer to the manual section: File Transfers). Generally, the source file is transferred, and then assembled, linked, and run under RT-11. This allows the file to be debugged and editted on the RT-11 system.

Remember to transfer the updated source file back to the TSX system, and delete all your files from the RT-11 system when you are finished.

4.4.3.5.2. RUNNING ON LSI

In this case, the source file must be assembled and linked under TSX, and the executable module downloaded into the memory of the LSI.

To download the file, run the terminal emulation program on the LSI. It is invoked by typing

160000G

Type the return key to get the data switch prompt, and log in to your TSX account.

To download the executable into LSI memory, type

LDLSI file [Return]

When the transfer is complete, ldlsi will log out of your TSX account and the LSI will halt. The program can then be run by giving its start address (generally, 1000):

1000G

The red button on the side of the LSI terminal is provided to allow you to drop the current dataswitch line you are using.

4.4.3.6. KILLING HUNG PROCESSES

You can look at all the current jobs on the machine with the WHO command. For example:

who [Return]

Uptime: 5 16:34:19

System use: Run=0%, I/O-wait=0%, Swap-wait=0%, Idle=99%

I/O Activity: User I/O=0%, Swapping I/O=0%

Job    Line     Pri   State    Size     Connect       CPU time     Program    JobName     
 --    -----    ---   -----    -----    ---------     --------     -------    -------     
 11*   11(0)    50    IN       37Kb     00:01:00      00:00:04     KMON       HAIDL       
12     12(0)    50    TI       12Kb     01:50:00      00:00:10     KERMIT     HAIDL       
16     Det.     50    SL       30Kb     136:35:00     00:00:01     DTR        DTR Reset   
17     Det.     50    SL       30Kb     136:35:00     00:00:00     WINPRT     WinPrn      

The example shows 4 jobs. Your current job will be marked with an "*". If your username appears more than once in the Job name column then it is likely that you have left a hung process. In the example above job 12 is a hung kermit process and it should be removed so that the next person who logs in doesn't get connected directly to your account. To kill the job enter:

KILL 12 [Return]

4.4.4. FILE TRANSFERS

Kermit is a standard program for transferring files. It is available on all the systems used for CS300, as well as most PCs on campus. From any of these systems, Kermit can be used to connect to the data switch, log on to the system of your choice, and send/receive files between the two systems. These notes describe how to transfer files from an RT-11 system to Meena, a PC, or a Unix system.

In the following examples, output from the calling machine (where kermit is initiated) will be in plain text; on the called machine, it will be in italics.

4.4.4.1. RT-11 KERMIT

If you are transferring files to or from RT-11, you must be working at the RT-11 console terminal, since it is impossible to log on to RT-11 from another terminal. Since kermit requires a clock, the PDP-11/23's line time clock MUST be enabled (using the LTC switch). The scenario for tranferring a file to TSX (another RT-11 based system) follows.

Note that [x(Ctrl)[\)) [c) is the "local escape sequence" and will not echo on the terminal. Type the control[Ctrl) and backslash [\) keys together, release them, and then type the letter 'c'.

. kermit [Return]

.R

. .

.

Kermit-11> set line xl [Return]

link device: XL Speed not settable

Kermit-11> connect [Return]

Connecting to XL Speed: Unknown

Type your local escape sequence to return to RT11

DEVELSWITCH HAL

Request: minerva [Return]

Logon please: username [Return]

Password: ... [Return]

Welcome to the system

Minerv. kermit [Return]

...

MINERVA> receive [Return]

[ [Ctrl] [\]] [c]

Kermit-11> send filename.mac [Return]

Kermit: Sending file DK:filename.MAC as file filename.MAC

Kermit: Send complete

Kermit-11> connect [Return]

Connecting to XL Speed: Unknown

Type your local escape sequence to return to RT-11

MINERVA> exit [Return]

Minerv. off [Return]

[ [Ctrl] [\]] [c]

Kermit-11> exit [Return]


4.4.4.2. TRANSFERRING FILES TO MEENA

As the files on Minerva are not backed up you will want to backup important files like project and assignment work. You can do this by using kermit to transfer your files from Minerva to Meena.

Though kermit is a standard transfer program, there are always local differences. On Meena, kermit has a "front-end procedure" to set up the kermit session. The session below illustrates the front end section and how to transfer a file from Minerva to Meena:

$ kermit [Return]

This is Meena-Kermit's front-end Procedure

* Enter YES if you will use CONNECT command

from Meena-Kermit: y [Return]

%DCL-I-ALLOC, _TXH0: allocated

VMS Meena-Kermit version 3.2

Default terminal for transfers is _TXH0:

Meena-Kermit > connect [Return]

[MEENA::Connecting to _TXH0:. Type ^]C to return to Meena-Kermit]

Request: minerva [Return]

Logon please: username [Return]

Password: ... [Return]

Welcome to the system

Minerv. kermit [Return]

...

MINERVA> send filename.mac [Return]

[ [Ctrl] []] ] [c]

[MEENA:: Returning to Meena-Kermit]

Meena-Kermit> receive [Return]

Receiving: filename.MAC as M2:[UGRAD.username]filename.MAC;1 [OK]

Meena-Kermit> connect [Return]

...

MINERVA> exit [Return]

Minerv. off [Return]

...

Meena-Kermit> exit [Return]

$

4.4.4.3. TRANSFERRING FILES TO A PC

Since both RT-11 systems and PCs are single-user systems with no log-ins, transfers must be accomplished in two steps. First, from the RT-11 console terminal, transfer the file to a larger system (e.g. Minerva or Meena). Then, from the PC, use kermit again to connect to this system and transfer the file to your own disk.

For MS-DOS machines, the session should be the same as described for RT-11, except that there is no need to "set line", and the local escape sequence is [[Ctrl][])) [c) .


4.4.4.4.KERMIT ON A UNIX SYSTEM

Tranferring a file to a Unix system is identical to the RT-11 session described above, except that the program is called ckermit on Unix.


4.4.4.5. TRANSFERRING BINARY FILES

If you wish to transfer .SAV files using kermit you will have to tell kermit that the files you are transferring are binary. To do this you must SET FILETYPE BINARY on both machines before doing the transfer.

4.4.5. TSX-PLUS DEBUGGER

A debugging aid similar to ODT is available under TSX-PLUS. It allows memory locations to be examined, breakpoints to be set, and memory locations to be monitored for changes. A program can be run normally and control transferred to the debugger by pressing control-D. These features greatly aid program debugging.

4.4.5.1. INVOKING THE DEBUGGER

The debugger can be invoked in one of two ways. The program can be run with the debug option(RUN/DEBUG) or if a SET CTRL DEBUG has been previously issued then the program can be interrupted and control passed to the debugger by pressing [[Ctrl] d)

Run/Debug

A program can be started under debugger control with the /DEBUG option of the run command. For example:

RUN/DEBUG filename [Return]

TSX-Plus debugger

DBG:

Whenever the debugger is in control the prompt will be the DBG: prompt. On entry into the debugger the program can be run by issuing the ;G command. The program counter is incremented automatically as the program runs. It remains at the address after a HALT or breakpoint occurs. To start running the program again enter start_address;G

e.g. 1000;G

[[Ctrl] d] Break

Normally[[Ctrl] d) only interrupts a program if the program was run with the /DEBUG option. However if SET CTRL DEBUG has been previously set at the TSX-Plus prompt then[[Ctrl] d) will transfer control to the debugger regardless of whether the /DEBUG option was used when the program was run.

[[Ctrl] c] Exit

Enter[[Ctrl] c] to exit the debugger.

BPT Instruction

A program which includes a BPT instruction can trigger execution of the system debugger. If you absolutely need to use a BPT instruction in your program ask your lab instructor for more information.


4.4.5.2. DEBUGGER COMMANDS

Debugger commands are similar to ODT commands. All values are assumed to be octal unless the value is terminated with a period. Case is not important.

Command Meaning

address/ Display the contents of the addressed word.

address\ Display the contents of the addressed byte.

$S/ Display the contents of the status register.

value [Return] Store value into the currently open cell. If value is omitted close the current location without changing its contents.

value[Linefeed] Store value into the currently open cell and then advance to the next word or byte. If value is omitted, advance to the next location without changing the contents of the current location.

value^ Sore value into the currently open cell and then advance to the previous word or byte. If value is omitted, backup to the previous location without changing the contents of the current location.

<backspace> Equivalent to "^"

@ Open the cell whose address is specified by the contents of the currently open cell

_(underscore) Open the cell whose address is specified by the contents of the currently open cell plus the current location plus 2.

address[ Open the cell whose address is specified and display its contents as a symbolic instruction. If address is omitted, decode the contents of the currently open cell into symbolic instruction form.

address] Open the cell whose address is specified and display its contents as a symbolic instruction. If address is omitted and a cell is currently open as an instruction , close the current cell and open the next cell and display its contents in symbolic instruction format. The location of the next cell opened is determined by the number of words used by the instruction in the currently open cell.

value[Tab] Execute the next instruction in single step mode. It is not necessary to issue the ";1S" command to single step using the TAB key. If value is non-blank , the value is used to calculate the address of the next instruction to be single stepped(similar to ";1S", then value;P). If zero is substituted for value before <tab> is typed and the next instruction is a JSR(or CALL), then a temporary breakpoint is set beyond the JSR to catch the return from the called subroutine and the subroutine is executed without single stepping. This can be used to avoid single stepping through subroutines called from code that is being single stepped.

address;nR Set relocation base register n to address. There are 8 relocation registers, numbered 0 through 7

nR Convert the contents of the currently open cell into an offset relative to relocation register n

n! Convert the current address to an offset relative to relocation register n.

address;nB Set an instruction breakpoint at address. There are 8 instruction breakpoints, numbered 0 through 7. To clear a breakpoint, substitute 0 for address. The period character may be used to indicate the current value of the program counter. For example, to set breakpoint 1 at the current address use .;1B

address;G Goto location address and start program there.

repeat;P Proceed from a breakpoint. If repeat is non-blank, do not break again until repeat breakpoints have been hit. If repeat is omitted, proceed until the next breakpoint is hit.

;nS Set or reset single stepping mode. If n is 1 (or any other non-zero value), begin single step mode. When single stepping, execution will proceed one instruction for each execution of ";P". If n is 0 or is omitted, single stepping mode is cancelled and the program will resume normal execution when the ";P" command is issued(See also the <TAB> command.)

address;valueM Set a data watchpoint. The word specified by address is monitored. If value is specified, a data watchpoint occurs when the value of the word matches value. It is possible to watch only selected bits of the monitored address by setting the mask register(see $M and data watchpoint description below). If value is omitted, a data watchpoint occurs any time the value of the word changes.


4.4.5.3. CTRL-D BREAKPOINTS

If the program is invoked using the /debug option of run or a SET CTRLD DEBUG is issued to the operating system before the program is run then the program can be interrupted and control transfered to the debugger by pressing[[Ctrl] d) The DBG: prompt will appear and any valid debugger command may be entered. The command ";P" will cause program execution to resume. If a system service call (EMT) is executing when [[Ctrl] d] is pressed, control will not be returned to the debugger until after the system call is finished.

4.4.5.4. ADDRESS RELOCATION

Address values in commands may be specified absolutely or in the form [n,offset], where n is a relocation register number and offset is the offset relative to that relocation register. When an instruction is decoded into symbolic form, relative addresses are displayed in the form [n,offset] as an offset from the nearest relocation register whose value is lower than the address. The format register ($F) can be used to control the display format of addresses.

Only two bits are significant in the $F register, bits 0 and 1. Bit 0 controls the display of instruction address operands, and bit 1 controls the display of location values. Setting either bit causes the corresponding addresses to be displayed in relative format. Both default to relative format($F=0).

$F    Locations        Operands          
0     relative         relative          
1     relative         absolute          
2     absolute         relative          
3     absolute         absolute          


4.4.5.5. INTERNAL REGISTERS

The following special address symbols are used to specify machine registers:

$0-$5    registers R0 through R5             
$6       register 6, the stack pointer(SP)   
$7       register 7, the program             
         counter(PC)                         
$S       Processor status word               

The following special address symbols are used to specify internal debugger registers:

$M     Mask register, used with data         
       watchpoints(see below)                
$F     Print format control register(see     
       above)                                
$B     Start of instruction breakpoint       
       registers                             
$R     Start of relocation registers         


4.4.5.6. DATA WATCHPOINTS

Data watchpoints are a powerful feature of the debugger which let you determine which part of your program is modifying a word of memory. The form of the command is:

address;valueM

where address is the address of the word to be monitored, and value is an optional parameter that specifies the value to be watched for. If value is omitted a break occurs when any change is made to address. If value is specified then a break only occurs when an instruction changes address to the specified value. When a break occurs the PC will be pointing at the instruction immediately following the instruction that modified address.

A data mask may be specified to allow only a portion of the word at address to be monitored. The mask value is stored in the register $M. Initially the mask is set to 177777 which watches all the bits in the word. If some other value is used for the mask then only those bits are monitored.


4.4.5.7. SYMBOLIC INSTRUCTION DECODING

Symbolic instruction encoding is used to interpret numerical opcodes and display them in the equivalent assembly language form. The display format for address operands is controlled by the contents of the $F register. When a breakpoint is reached, the instruction that the breakpoint was set on is automatically symbolically displayed.

The "[" operator is used to symbolically display the instruction at an address previously opened with a "/" or to symbolically decode a specified address. For example:

DBG: 2030 / 010246 [ MOV R2,-(SP)

DBG: 3000[ BIC #100,177560

The "]" operator closes the currently open cell and opens the next cell based on the length of the current operation. The next cell is symbolically decoded. The "]" is very useful for examining consecutive locations.


4.4.5.8. SPECIAL NOTES

Because [[Ctrl] d] is used by the debugger to interrupt a program this keystroke cannot

be used by a user program easily.

In the status register only the four lower bits (NZVC) are significant. Under TSX-Plus the priority bits are not significant.

Traps 4 and 10 are normally intercepted by the debugger. However if a .TRPSET call is included in the user's program they will not be intercepted by the program.

EXAMPLE:

Minerv. type add.mac [Return]

start:

mov #3, r0

mov #2, r1

add r0, r1

mov r1, r2

halt

.end start

Minerv. macro add [Return]

Minerv.link add [Return]

Minerv.run/debug add [Return]

TSX-Plus debugger

1> DBG: 1000/ 012700 [ MOV #3,R0 ]

1004 [ MOV #2,R1 ]

1010 [ ADD R0,R1 ]

1012 [ MOV R1,R2 ]

1014 [ HALT [Return]

2> DBG: 1000;G

Trap to 4 at location 1016 (this is caused by the HALT)

3> DBG: $2/ 000005 [Return]

4> DBG:[[Ctrl] c)

Minerv.

Explanation of user entries:

1> Enter "1000/" to open location 1000.

Enter "[" to display the contents as a symbolic instruction.

Enter "]" to open the next cell and display its contents as a symbolic instruction.

Continue to enter "]" for each cell to be displayed.

2> Enter "1000;G" to run the program.

3> Enter "$2" to display the contents of register 2.

4> Enter "^C" to exit the debugger.

4.4.6. THE PDP-11/40

4.4.6.1. THE SWITCH REGISTER

On the front of the PDP 11/40 there are two rows of lights labelled ADDRESS and DATA, 18 switches numbered 0 through 17, plus six labelled switches.

The row of lights labelled ADDRESS displays the current address in the program counter (PC). The DATA lights display the contents at that memory address. The 18 numbered switches can be used to load a new address into the PC (LOAD ADRS), or a new value into the current location of the PC (DEP). The six labelled switches perform the following functions:

Switch               Purpose                                              
LOAD ADRS            load address given by the 18 switches into the PC    
EXAM                 display the contents of the address in the PC        
CONT                 continue execution with current value of PC (after   
                     HALT)                                                
ENABLE/HALT          put the processor in either enable or halt mode      
START                begin execution at the current value of the PC.      
DEP                  deposit value given by the 18 switches into the      
                     address contained in the PC                          


4.4.6.2. BOOTSTRAPPING

A 'bootstrap' is the name given to the program which is toggled (through the switches) into the computer and run to cause the operating system to be loaded and executed (generally from disk). Often the bootstrap reads in another longer program which then loads the operating system.

The bootstrap program for the RK05 is:

012700

177406

012710

177400

012740

000005

105710

100376

005007

4.4.6.3. PERIPHERAL DEVICES

Each device on the system has some form of controller for communicating with the processor. In the case of terminals and other "simple" devices (e.g. paper tape reader/punch), this consists of a 16-bit status word and an 8-bit buffer for each function: input and output. Other devices have more complex controllers to handle the many functions they can perform.

4.4.6.3.1. THE RK05 DISK

The RK05 disk drive contains of 2 surfaces, 200 cylinders, 12 sectors/track, and 256 words/sector.

The controller consists of 8 registers at locations 177400 through 177416. The purpose of each register is described below.

Address Register Purpose

177400 drive status register Contains status information on selected drive.

(RKDS)

177402 error register Contains bits for individual error types.

(RKER) The error bit in the control status register is set

if any of these bits are set.

177404 control status register Contains bits to set the function and check

(RKCS) its status:

- bit 0 - instructs controller to execute when set

- bits 1-3 - what function is to be performed.

- 000 - control reset

- 001 - write

- 010 - read

- 011 - write check

- 100 - seek

- 101 - read check

- 110 - drive reset

- 111 - write lock

- bit 6 - interrupt enable

- bit 7 - ready bit

- cleared when bit 0 is set

- set when requested operation is finished

- bit 15 - error bit

177406 word count register The 2's complement of the number of words

(RKWC) to be transferred.

177410 bus address register The bus address to transfer data to or from.

(RKBA)

177412 disc address register The disk address to transfer data to or from:

(RKDA) - bits 0-3 - sector address

- bit 4 - surface (upper=0, lower=1)

- bits 5-12 - cylinder address

- bits 13-15 - logical drive

177414 unused

177416 data buffer register All data transferred to or from the drive

(RKDB) passes through this register.

The interrupt vector for the RK05 is at address 220.


4.4.6.3.2. DECTAPE

DECtape is a form of magnetic tape that allows individual blocks to be accessed randomly. This means that it can be used as a file system device similar to a disk. The purpose of each register in the controller is described below.

Address Register Purpose

177340 control status register Contains status information

(TCST) on selected drive.

177342 command register Contains bits to indicate the function

(TCCM) to be performed.

- bit 0 - DO bit - begin executing function

- bits 1-3 - function to perform

000 - stop all

001 - read block number into TCDT

010 - read data

011 - read all (data plus check bits)

100 - stop selected unit

101 - write format info

110 - write data

111 - write all

- bit 6 - interrupt enable

- bit 7 - ready bit

- set when function is completed

- bits 8-10 - tape unit

- bit 11 - tape direction

- 0 forward, 1 reverse

- bit 15 - error bit

177344 word count register The 2's complement of the number of words

(TCWC) to be transferred.

177346 bus address register The bus address to transfer data to or from.

(TCBA)

177350 data register All data tranferred to or from the drive

(TCDT) passes through this register.

The interrupt vector for the DECtape is at address 214.


4.4.6.3.3. OTHER DEVICES

The PDP-11/40 may also contain the following devices:

Name              Registers     Vector                      
Card Reader       CRS           177160         230          
                  CRB1          177162                      
                  CRB2          177164                      
                                                            
Paper Tape        PRS           177550         70 (reader)  
Reader/Punch      PRB           177552         74 (punch)   
                  PPS           177554                      
                  PPB           177556