1 |
207 |
jeremybenn |
; @(#)cpudef.h 2.3 90/10/14 20:55:56, Copyright 1989, 1990 AMD
|
2 |
|
|
;-----------------------------------------------------------------------
|
3 |
|
|
; Useful equates
|
4 |
|
|
;-----------------------------------------------------------------------
|
5 |
|
|
;
|
6 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
7 |
|
|
; Copyright 1989, 1990 Advanced Micro Devices, Inc.
|
8 |
|
|
;
|
9 |
|
|
; This software is the property of Advanced Micro Devices, Inc (AMD) which
|
10 |
|
|
; specifically grants the user the right to modify, use and distribute this
|
11 |
|
|
; software provided this notice is not removed or altered. All other rights
|
12 |
|
|
; are reserved by AMD.
|
13 |
|
|
;
|
14 |
|
|
; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
|
15 |
|
|
; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
|
16 |
|
|
; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
|
17 |
|
|
; USE OF THIS SOFTWARE.
|
18 |
|
|
;
|
19 |
|
|
; So that all may benefit from your experience, please report any problems
|
20 |
|
|
; or suggestions about this software to the 29K Technical Support Center at
|
21 |
|
|
; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
|
22 |
|
|
; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
|
23 |
|
|
;
|
24 |
|
|
; Advanced Micro Devices, Inc.
|
25 |
|
|
; 29K Support Products
|
26 |
|
|
; Mail Stop 573
|
27 |
|
|
; 5900 E. Ben White Blvd.
|
28 |
|
|
; Austin, TX 78741
|
29 |
|
|
; 800-292-9263
|
30 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
31 |
|
|
|
32 |
|
|
; Processor status registers OPS (sr1) and CPS (sr2)
|
33 |
|
|
.equ CA,0x8000 ; Coprocessor active
|
34 |
|
|
.equ IP,0x4000 ; Interrupt pending
|
35 |
|
|
.equ TE,0x2000 ; Trace enable
|
36 |
|
|
.equ TP,0x1000 ; Trace pending
|
37 |
|
|
.equ TU,0x0800 ; Trap unaligned access
|
38 |
|
|
.equ FZ,0x0400 ; Freeze
|
39 |
|
|
.equ LK,0x0200 ; Lock
|
40 |
|
|
.equ RE,0x0100 ; ROM enable
|
41 |
|
|
.equ WM,0x0080 ; Wait mode
|
42 |
|
|
.equ PD,0x0040 ; No translation for Data
|
43 |
|
|
.equ PI,0x0020 ; No translation for Instr
|
44 |
|
|
.equ SM,0x0010 ; Supervisor mode
|
45 |
|
|
.equ IM,0x000C ; Interrupt mask
|
46 |
|
|
.equ IM1,0x0100 ; enable INTR0-1
|
47 |
|
|
.equ IM2,0x1000 ; enable INTR0-2
|
48 |
|
|
.equ IM3,0x1100 ; enable INTR0-3
|
49 |
|
|
.equ DI,0x0002 ; Disable ints
|
50 |
|
|
.equ DA,0x0001 ; Disable ints and traps
|
51 |
|
|
|
52 |
|
|
; Configuration register CFG (sr3)
|
53 |
|
|
.equ PRL,0xFF000000 ; Processor release level
|
54 |
|
|
.equ VF,0x10 ; Vector fetch
|
55 |
|
|
.equ RV,0x08 ; ROM Vector area
|
56 |
|
|
.equ BO,0x04 ; Byte order
|
57 |
|
|
.equ CP,0x02 ; Coprocessor present
|
58 |
|
|
.equ CD,0x01 ; BTC disable
|
59 |
|
|
|
60 |
|
|
; Channel control register CHC (sr6)
|
61 |
|
|
.equ LS,0x8000 ; Load store
|
62 |
|
|
.equ ML,0x4000 ; Multiple operation
|
63 |
|
|
.equ ST,0x2000 ; Set
|
64 |
|
|
.equ LA,0x1000 ; Lock active
|
65 |
|
|
.equ TF,0x0400 ; Transaction faulted
|
66 |
|
|
.equ TR,0x03FC ; Target register
|
67 |
|
|
.equ NN,0x0002 ; Not needed
|
68 |
|
|
.equ CV,0x0001 ; Contents valid
|
69 |
|
|
|
70 |
|
|
; Timer reload register TMR (sr9)
|
71 |
|
|
.equ IE,0x01000000 ; timer int enable
|
72 |
|
|
.equ IN,0x02000000 ; timer int pending
|
73 |
|
|
.equ OV,0x04000000 ; timer Overflow
|
74 |
|
|
|
75 |
|
|
; MMU configuration register MMU (sr13)
|
76 |
|
|
.equ PS,0x300 ; Page size
|
77 |
|
|
.equ PID,0xFF ; Process identifier
|
78 |
|
|
|
79 |
|
|
; ALU status register ALU (sr132)
|
80 |
|
|
.equ DF,0x800 ; Divide flag
|
81 |
|
|
.equ V,0x400 ; Overflow
|
82 |
|
|
.equ N,0x200 ; Negative
|
83 |
|
|
.equ Z,0x100 ; Zero
|
84 |
|
|
.equ C,0x080 ; Carry
|
85 |
|
|
|
86 |
|
|
; TLB entry
|
87 |
|
|
.equ VTAG,0xFFFF8000 ; Virtual tag
|
88 |
|
|
.equ VE,0x4000 ; Valid entry
|
89 |
|
|
.equ SR,0x2000 ; Supervisor read
|
90 |
|
|
.equ SW,0x1000 ; Supervisor write
|
91 |
|
|
.equ SE,0x0800 ; Supervisor execute
|
92 |
|
|
.equ UR,0x0400 ; User read
|
93 |
|
|
.equ UW,0x0200 ; User write
|
94 |
|
|
.equ UE,0x0100 ; User execute
|
95 |
|
|
.equ TID,0x00FF ; Task identifier
|
96 |
|
|
.equ RPN,0xFFFFFC00 ; Real page number
|
97 |
|
|
.equ PGM,0x00C0 ; User programmable
|
98 |
|
|
.equ U,0x0002 ; Usage
|
99 |
|
|
.equ F,0x0001 ; Flag
|
100 |
|
|
|
101 |
|
|
;-----------------------------------------------------------------------
|
102 |
|
|
;Global registers
|
103 |
|
|
;-----------------------------------------------------------------------
|
104 |
|
|
|
105 |
|
|
.reg rsp, gr1 ; local register stack pointer
|
106 |
|
|
|
107 |
|
|
; System-wide statics
|
108 |
|
|
.reg s0, gr64
|
109 |
|
|
.reg spillreg, s0 ; pointer to user spill handler
|
110 |
|
|
.reg s1, gr65
|
111 |
|
|
.reg fillreg, s1 ; pointer to user fill handler
|
112 |
|
|
.reg s2, gr66
|
113 |
|
|
.reg heapptr, s2 ; pointer to heap area
|
114 |
|
|
.reg s3, gr67
|
115 |
|
|
.reg s4, gr68
|
116 |
|
|
.reg s5, gr69
|
117 |
|
|
.reg s6, gr70
|
118 |
|
|
.reg s7, gr71
|
119 |
|
|
.reg s8, gr72
|
120 |
|
|
.reg s9, gr73
|
121 |
|
|
.reg s10, gr74
|
122 |
|
|
.reg s11, gr75
|
123 |
|
|
.reg s12, gr76
|
124 |
|
|
.reg s13, gr77
|
125 |
|
|
.reg s14, gr78
|
126 |
|
|
.reg s15, gr79
|
127 |
|
|
|
128 |
|
|
; Interrupt handler temporaries
|
129 |
|
|
.reg i0, gr80
|
130 |
|
|
.reg i1, gr81
|
131 |
|
|
.reg i2, gr82
|
132 |
|
|
.reg i3, gr83
|
133 |
|
|
.reg i4, gr84
|
134 |
|
|
.reg i5, gr85
|
135 |
|
|
.reg i6, gr86
|
136 |
|
|
.reg i7, gr87
|
137 |
|
|
.reg i8, gr88
|
138 |
|
|
.reg i9, gr89
|
139 |
|
|
.reg i10, gr90
|
140 |
|
|
.reg i11, gr91
|
141 |
|
|
.reg i12, gr92
|
142 |
|
|
.reg i13, gr93
|
143 |
|
|
.reg i14, gr94
|
144 |
|
|
.reg i15, gr95
|
145 |
|
|
|
146 |
|
|
; Subroutine/function temporaries
|
147 |
|
|
; also used for function return values
|
148 |
|
|
.reg t0, gr96
|
149 |
|
|
.reg rtn, t0
|
150 |
|
|
.reg t1, gr97
|
151 |
|
|
.reg t2, gr98
|
152 |
|
|
.reg t3, gr99
|
153 |
|
|
.reg t4, gr100
|
154 |
|
|
.reg t5, gr101
|
155 |
|
|
.reg t6, gr102
|
156 |
|
|
.reg t7, gr103
|
157 |
|
|
.reg t8, gr104
|
158 |
|
|
.reg t9, gr105
|
159 |
|
|
.reg t10, gr106
|
160 |
|
|
.reg t11, gr107
|
161 |
|
|
.reg t12, gr108
|
162 |
|
|
.reg t13, gr109
|
163 |
|
|
.reg t14, gr110
|
164 |
|
|
.reg t15, gr111
|
165 |
|
|
|
166 |
|
|
; User process statics
|
167 |
|
|
.reg u0, gr112
|
168 |
|
|
.reg u1, gr113
|
169 |
|
|
.reg u2, gr114
|
170 |
|
|
.reg u3, gr115
|
171 |
|
|
|
172 |
|
|
; More subroutine/function temporaries
|
173 |
|
|
.reg t16, gr116
|
174 |
|
|
.reg t17, gr117
|
175 |
|
|
.reg t18, gr118
|
176 |
|
|
.reg t19, gr119
|
177 |
|
|
.reg t20, gr120
|
178 |
|
|
|
179 |
|
|
; Older names for the same registers
|
180 |
|
|
.reg tmp0, gr116
|
181 |
|
|
.reg tmp1, gr117
|
182 |
|
|
.reg tmp2, gr118
|
183 |
|
|
.reg tmp3, gr119
|
184 |
|
|
.reg tmp4, gr120
|
185 |
|
|
|
186 |
|
|
; Trap handler temporaries
|
187 |
|
|
.reg tav, gr121 ; arg/temp
|
188 |
|
|
.reg tpc, gr122 ; rtn/temp
|
189 |
|
|
|
190 |
|
|
; Linkage pointers
|
191 |
|
|
.reg lrp, gr123 ; large rtn ptr
|
192 |
|
|
.reg slp, gr124 ; static link ptr
|
193 |
|
|
.reg msp, gr125 ; memory stack ptr
|
194 |
|
|
.reg rab, gr126 ; register allocate bound
|
195 |
|
|
.reg rfb, gr127 ; register free bound
|
196 |
|
|
|
197 |
|
|
;-----------------------------------------------------------------------
|
198 |
|
|
;Local compiler registers
|
199 |
|
|
; (only valid if frame has been established)
|
200 |
|
|
;-----------------------------------------------------------------------
|
201 |
|
|
|
202 |
|
|
.reg p15, lr17 ; outgoing arg 16
|
203 |
|
|
.reg p14, lr16 ; outgoing arg 15
|
204 |
|
|
.reg p13, lr15 ; outgoing arg 14
|
205 |
|
|
.reg p12, lr14 ; outgoing arg 13
|
206 |
|
|
.reg p11, lr13 ; outgoing arg 12
|
207 |
|
|
.reg p10, lr12 ; outgoing arg 11
|
208 |
|
|
.reg p9, lr11 ; outgoing arg 10
|
209 |
|
|
.reg p8, lr10 ; outgoing arg 9
|
210 |
|
|
.reg p7, lr9 ; outgoing arg 8
|
211 |
|
|
.reg p6, lr8 ; outgoing arg 7
|
212 |
|
|
.reg p5, lr7 ; outgoing arg 6
|
213 |
|
|
.reg p4, lr6 ; outgoing arg 5
|
214 |
|
|
.reg p3, lr5 ; outgoing arg 4
|
215 |
|
|
.reg p2, lr4 ; outgoing arg 3
|
216 |
|
|
.reg p1, lr3 ; outgoing arg 2
|
217 |
|
|
.reg p0, lr2 ; outgoing arg 1
|
218 |
|
|
.reg fp, lr1 ; frame pointer
|
219 |
|
|
.reg raddr, lr0 ; return address
|
220 |
|
|
|
221 |
|
|
;-----------------------------------------------------------------------
|
222 |
|
|
; Vectors
|
223 |
|
|
;-----------------------------------------------------------------------
|
224 |
|
|
|
225 |
|
|
.equ V_ILLEG, 0 ; Illegal opcode
|
226 |
|
|
.equ V_ALIGN, 1 ; Unaligned access
|
227 |
|
|
.equ V_RANGE, 2 ; Out of range
|
228 |
|
|
.equ V_COPRE, 3 ; Coprocessor not present
|
229 |
|
|
.equ V_COEXC, 4 ; Coprocessor exception
|
230 |
|
|
.equ V_PROT, 5 ; Protection violation
|
231 |
|
|
.equ V_INSTR, 6 ; Instruction access exception
|
232 |
|
|
.equ V_DATA, 7 ; Data access exception
|
233 |
|
|
.equ V_UITLB, 8 ; User-mode instruction TLB miss
|
234 |
|
|
.equ V_UDTLB, 9 ; User-mode data TLB miss
|
235 |
|
|
.equ V_SITLB, 10 ; Supervisor-mode instr TLB miss
|
236 |
|
|
.equ V_SDTLB, 11 ; Supervisor-mode data TLB miss
|
237 |
|
|
.equ V_ITLB, 12 ; Instruction TLB violation
|
238 |
|
|
.equ V_DTLB, 13 ; Data TLB violation
|
239 |
|
|
.equ V_TIMER, 14 ; Timer
|
240 |
|
|
.equ V_TRACE, 15 ; Trace
|
241 |
|
|
.equ V_INTR0, 16 ; Interrupt 0
|
242 |
|
|
.equ V_INTR1, 17 ; Interrupt 1
|
243 |
|
|
.equ V_INTR2, 18 ; Interrupt 2
|
244 |
|
|
.equ V_INTR3, 19 ; Interrupt 3
|
245 |
|
|
.equ V_TRAP0, 20 ; Trap 0
|
246 |
|
|
.equ V_TRAP1, 21 ; Trap 1
|
247 |
|
|
|
248 |
|
|
;-----------------------------------------------------------------------
|
249 |
|
|
;constants for LOAD and STORE operations
|
250 |
|
|
;-----------------------------------------------------------------------
|
251 |
|
|
|
252 |
|
|
; CE operand values
|
253 |
|
|
.equ CE, 0b1 ;coprocessor enable
|
254 |
|
|
.equ ME, 0b0 ; memory enable
|
255 |
|
|
|
256 |
|
|
; CNTL operand values
|
257 |
|
|
.equ IO, 0b1000000 ;set for I/O
|
258 |
|
|
.equ PA, 0b0100000 ;force physical addr
|
259 |
|
|
.equ SB, 0b0010000 ;set for set BP
|
260 |
|
|
.equ UA, 0b0001000 ;force user mode access
|
261 |
|
|
.equ ROM, 0b0000100 ;ROM access
|
262 |
|
|
.equ HWORD, 0b0000010 ;Half word access
|
263 |
|
|
.equ BYTE, 0b0000001 ;Byte access
|
264 |
|
|
.equ WORD, 0b0000000 ;Word access
|
265 |
|
|
|
266 |
|
|
;-----------------------------------------------------------------------
|
267 |
|
|
; stack alignment value
|
268 |
|
|
;-----------------------------------------------------------------------
|
269 |
|
|
.equ STKALIGN, 8 ; double word align
|
270 |
|
|
|