1 ;;; -*- Mode: Midas -*-
2 ;;; Copyright (c) 1999 Massachusetts Institute of Technology
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 2 of the
7 ;;; License, or (at your option) any later version.
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.
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.
20 ;;; Canonical symbol definition macro, FOO==BAR with error check.
27 IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
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
41 ;;; RH11/TM78 Unibus register addresses:
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
55 ;;; Commands, with GO bit or'd in.
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 '*'.
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
90 DEFSYM %ARWC==%ARBAS+2 ;UNIBUS DMA WORD COUNT. (RH11)
91 ; Negative count of the number of PDP11 (18-bit) words to DMA
93 DEFSYM %ARBA==%ARBAS+4 ;UNIBUS ADDRESS. (RH11)
94 ; Unibus address of start of DMA transfer
96 DEFSYM %ARFC==%ARBAS+6 ;TAPE FRAME BYTE COUNT (MB Reg 05)
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
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
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
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.
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.
145 DEFSYM %ARBUF==%ARBAS+22 ;DATA BUFFER REGISTER (RH11)
147 DEFSYM %ARMR1==%ARBAS+24 ;MAINTENANCE REGISTER 1 (MB Reg 03)
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
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.
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
168 DEFSYM %ARMR2==%ARBAS+32 ;MAINTAINANCE REGISTER 2 (MB Reg 011)
170 DEFSYM %ARMR3==%ARBAS+34 ;MAINTAINANCE REGISTER 3 (MB Reg 012)
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
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
184 DEFSYM %ARIA==%ARBAS+50 ;INTERNAL ADDRESS (MB Reg 020)
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
192 IFN $$TEMP,EXPUNG DEFSYM