Consolidate license copies
[its.git] / system / tm78s.defs2
1 ;;; -*- Mode: Midas -*-
2 ;;; Copyright (c) 1999 Massachusetts Institute of Technology
3 ;;;
4 ;;; This program is free software; you can redistribute it and/or
5 ;;; modify it under the terms of the GNU General Public License as
6 ;;; published by the Free Software Foundation; either version 3 of the
7 ;;; License, or (at your option) any later version.
8 ;;;
9 ;;; This program is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 ;;; General Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with this program; if not, write to the Free Software
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 .AUXIL
19
20 ;;; Canonical symbol definition macro, FOO==BAR with error check.
21 IFNDEF DEFSYM,[ 
22 DEFINE DEFSYM X/
23 IRPS Z,,[X]
24 IFNDEF Z,X
25 .ELSE [ $$TEM1==Z
26         X
27         IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
28       ]
29 .ISTOP
30 TERMIN TERMIN
31 $$TEMP==1
32 ] ;IFNDEF DEFSYM
33 .ELSE, $$TEMP==0
34 \f
35
36 ;;; RH11/TM78 Interrupt vector:
37 DEFSYM  %ARVEC==224             ;(224/4 = 45) Interrupts occur on level 6
38                                 ; (high priority) on UBA #1.
39 DEFSYM  %ARBAS==772400          ;Unibus address of first register 
40
41 ;;; RH11/TM78 Unibus register addresses:
42
43 DEFSYM  %ARCS1==%ARBAS          ;CONTROL AND STATUS 1 (RH11 and MB Reg 00)
44  DEFSYM %A1SC==1_15.            ; Special Condition
45  DEFSYM %A1TE==1_14.            ; Transfer Error
46  DEFSYM %A1MCP==1_13.           ; Massbus Control Bus Parity Error
47  DEFSYM %A1DA==1_11.            ; Drive (TM78) Available
48  DEFSYM %A1A7==1_9.             ; UB Address Extension Bit 17
49  DEFSYM %A1A6==1_8.             ; UB Address Extension Bit 16
50  DEFSYM %A1RDY==1_7.            ; Ready
51  DEFSYM %A1IE==1_6.             ; Interrupt Enable
52  DEFSYM %A1CMD==77              ; Bits 0-5 specify commands.
53  DEFSYM %A1GO==1_0.             ; GO bit
54
55 ;;; Commands, with GO bit or'd in.
56 ;;; --NOTE-- 
57 ;;; Commands are passed to the controller in two ways. Data transfer
58 ;;; command get written into the CS1 register, as usual. Non-data-transfer
59 ;;; commands are written to the %ARNDC register for the desired drive
60 ;;; unit (see below). Non-data-transfer commands are marked with a '*'.
61
62 DEFSYM  %ACNOP==3               ;(*) No Operation
63 DEFSYM  %ACUNL==5               ;(*) Unload
64 DEFSYM  %ACREW==7               ;(*) Rewind
65 DEFSYM  %ACSNS==11              ;(*) Sense (Get status from TM)
66 DEFSYM  %ACDSE==13              ;(*) Data Security Erase! (Erase rest of tape)
67 DEFSYM  %ACWPM==15              ;(*) Write Phase Encoded (1600bpi) Tape Mark
68 DEFSYM  %ACWGM==17              ;(*) Write GCR (6250bpi Tape Mark
69 DEFSYM  %ACSFR==21              ;(*) Space Forward Record
70 DEFSYM  %ACSRR==23              ;(*) Space Reverse Record
71 DEFSYM  %ACSFF==25              ;(*) Space Forward File
72 DEFSYM  %ACSRF==27              ;(*) Space Reverse File
73 DEFSYM  %ACSFE==31              ;(*) Space Forward Either (record or file)
74 DEFSYM  %ACSRE==33              ;(*) Space Reverse Either
75 DEFSYM  %ACE3P==35              ;(*) Erase Three-inch gap, set PE
76 DEFSYM  %ACE3G==37              ;(*) Erase Three-inch gap, set GCR
77 DEFSYM  %ACCFP==41              ;(*) Close File PE (write two marks, back one)
78 DEFSYM  %ACCFG==43              ;(*) Close File GCR
79 DEFSYM  %ACEOT==45              ;(*) Space to Logical EOT
80 DEFSYM  %ACSFU==47              ;(*) Space forward usefully (to file or EOT)
81 DEFSYM  %ACWCF==51              ;Write Check Forward
82 DEFSYM  %ACWCR==57              ;Write Check Reverse
83 DEFSYM  %ACWRP==61              ;Write Forward PE
84 DEFSYM  %ACWRG==63              ;Write Forward GCR
85 DEFSYM  %ACRDF==71              ;Read Forward
86 DEFSYM  %ACRES==73              ;Read Extended Sense Information
87 DEFSYM  %ACRDR==77              ;Read Data Reverse
88
89 \f
90 DEFSYM  %ARWC==%ARBAS+2         ;UNIBUS DMA WORD COUNT. (RH11)
91  ; Negative count of the number of PDP11 (18-bit) words to DMA
92
93 DEFSYM  %ARBA==%ARBAS+4         ;UNIBUS ADDRESS. (RH11)
94  ; Unibus address of start of DMA transfer
95
96 DEFSYM  %ARFC==%ARBAS+6         ;TAPE FRAME BYTE COUNT (MB Reg 05)
97
98 DEFSYM  %ARCS2==%ARBAS+10       ;CONTROL AND STATUS 2. (RH11)
99  DEFSYM %A2DL==1_15.            ; Data Late
100  DEFSYM %A2UPE==1_13.           ; Unibus Parity Error
101  DEFSYM %A2NF==1_12.            ; Non-existant Formatter (TM78)
102  DEFSYM %A2NM==1_11.            ; Unibus mem NXM during DMA
103  DEFSYM %A2PE==1_10.            ; Program Error
104  DEFSYM %A2MT==1_9.             ; Missed Transfer
105  DEFSYM %A2MDP==1_8.            ; Massbus Data Bus Parity Error
106  DEFSYM %A2OR==1_7.             ; Output Ready (for Silo buffer diag.)
107  DEFSYM %A2IR==1_6.             ; Input  Ready (for Silo buffer diag.)
108  DEFSYM %A2CC==1_5.             ; Controller Clear
109  DEFSYM %A2PT==1_4.             ; Parity Test
110  DEFSYM %A2UAI==1_3.            ; Unibus Address Increment Inhibit
111
112 DEFSYM  %ARDER==%ARBAS+12       ;DATA TRANSFER ERROR REPORT (MB Reg 01)
113  DEFSYM %ADEIC==77              ; Interrupt Code
114  DEFSYM %ADEDP==1_8.            ; DPR ???
115  DEFSYM %ADEFC==77_10.          ; Failure Code
116
117 DEFSYM  %ARDCA==%ARBAS+14       ;DATA COMMAND ARGUMENTS (MB Reg 02)
118  DEFSYM %ADACA==3               ; Command Address (TU78 unit number)
119  DEFSYM %ADARC==77_2.           ; Record Count
120  DEFSYM %ADASC==17_8.           ; Skip Count
121  DEFSYM %ADAFT==7_12.           ; Format
122  DEFSYM %ADASR==1_15.           ; Supress Repositioning on error
123
124 DEFSYM  %ARASN==%ARBAS+16       ;ATTENTION SUMMARY. (MB Reg 04)
125  ;Each bit 3-0 corresponds to a drive wanting attention
126  ; You must explicitly -RESET- an attention bit by writing a
127  ; one into it before the controller can interrupt you again.
128
129 DEFSYM  %ARDS==%ARBAS+20        ;DRIVE STATUS (MB Reg 07)
130  ;;; This register is valid only after a SENSE command
131  ;;; (or possibly an unsolicited ONLINE interrupt)
132  DEFSYM %ASRDY==1_15.           ; Tape Ready
133  DEFSYM %ASPRE==1_14.           ; Present (TM78 powered up)
134  DEFSYM %ASONL==1_13.           ; Online
135  DEFSYM %ASREW==1_12.           ; Tape Rewinding
136  DEFSYM %ASPE==1_11.            ; Tape is Phase Encoded
137  DEFSYM %ASBOT==1_10.           ; Tape at BOT
138  DEFSYM %ASEOT==1_9.            ; Tape at EOT
139  DEFSYM %ASWPT==1_8.            ; Tape is Write Protected
140  DEFSYM %ASUA==1_7.             ; Unit Available
141  DEFSYM %ASUS==1_6.             ; Unit is shared
142  DEFSYM %ASMMD==1_5.            ; Unit is in Maintainance mode
143  DEFSYM %ASDSE==1_4.            ; Data Security Erase in progress.
144
145 DEFSYM  %ARBUF==%ARBAS+22       ;DATA BUFFER REGISTER (RH11)
146
147 DEFSYM  %ARMR1==%ARBAS+24       ;MAINTENANCE REGISTER 1 (MB Reg 03)
148 \f
149 DEFSYM  %ARTYP==%ARBAS+26       ;DRIVE TYPE. (MB Reg 06)
150  ;;; This register is valid only after a SENSE command
151                                 ;2.7  Not Sector addressed
152                                 ;2.6  Tape
153                                 ;2.5  Moving Head (always 0)
154                                 ;2.4  7 track (always 0)
155                                 ;2.3  Dual port (must do arbitration)
156                                 ;2.2  Slave present (always 1)
157                                 ;2.1  Writable Control Store (always 0)
158                                 ;1.9 - 1.1  Drive Type Number.
159                                 ;   TU78=101
160
161 DEFSYM  %ARSER==%ARBAS+30       ;SERIAL NUMBER (MB Reg 010)
162  ;;; This register is valid only after a SENSE command
163  ;0-3   SN digit 0, in BCD
164  ;4-7   SN digit 1
165  ;8-11  SN digit 2
166  ;12-15 SN digit 3
167
168 DEFSYM  %ARMR2==%ARBAS+32       ;MAINTAINANCE REGISTER 2 (MB Reg 011)
169
170 DEFSYM  %ARMR3==%ARBAS+34       ;MAINTAINANCE REGISTER 3 (MB Reg 012)
171
172 DEFSYM  %ARNDE==%ARBAS+36       ;NON-DATA CMD ERROR REGISTER (MB Reg 013)
173  DEFSYM %ANEIC==77              ; NDT Interrupt code
174  DEFSYM %ANEAA==3_8.            ; Attention Address (drive that caused this)
175  DEFSYM %ANEFC==77_10.          ; NDT Failure Code
176
177 DEFSYM  %ARNDA==%ARBAS+40       ;NON-DATA CMD ARG REGISTERS (MB Reg 014 - 017)
178  ;;; There are four of these, one for each of the possible slave TU78
179  ;;; units on the TM78. This is where you write commands that don't
180  ;;; move data over the massbus.
181  DEFSYM %ANCMD==77              ; Command to execute
182  DEFSYM %ANCNT==377_8.          ; Count
183
184 DEFSYM  %ARIA==%ARBAS+50        ;INTERNAL ADDRESS (MB Reg 020)
185
186 DEFSYM  %ARID==%ARBAS+52        ;HARDWARE CONTROL (MB Reg 021)
187  DEFSYM %AHRDY==1_15.           ; Set when controller is ready. (read only)
188  DEFSYM %AHCLR==1_14.           ; Write 1 here to reset controller.
189  ;;; And a bunch of other stuff
190
191
192 IFN $$TEMP,EXPUNG DEFSYM
193
194 \f