DS390 support is still beta
[fw/sdcc] / device / include / mcs51reg.h
1 /*-------------------------------------------------------------------------
2    Register Declarations for the mcs51 compatible microcontrollers
3
4    Written By -  Bela Torok / bela.torok@kssg.ch (November 2000)
5
6    This program is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published by the
8    Free Software Foundation; either version 2, or (at your option) any
9    later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20    In other words, you are welcome to use, share and improve this program.
21    You are forbidden to forbid anyone else to use, share and improve
22    what you give them.   Help stamp out software-hoarding!
23
24
25    History:
26    --------
27    Version 1.0 Nov 2, 2000 - B. Torok  / bela.torok@kssg.ch
28    Initial release, supported microcontrollers:
29    8051, 8052, Atmel AT89C1051, AT89C2051, AT89C4051,
30    Infineon / Siemens SAB80515, SAB80535, SAB80515A
31
32    Version 1.0.1 (Nov 3, 2000)
33    SAB80515A definitions revised by Michael Schmitt / michael.schmitt@t-online.de
34
35    Version 1.0.2 (Nov 6, 2000)
36    T2CON bug corrected 8052 and SABX microcontrollers have different T2CONs
37    Support for the Atmel AT89C52, AT80LV52, AT89C55, AT80LV55
38    Support for the Dallas DS80C320 and DS80C323
39    B. Torok / bela.torok@kssg.ch
40
41    Version 1.0.3 (Nov 7, 2000)
42    SAB80517 definitions added by Michael Schmitt / michael.schmitt@t-online.de
43    Dallas AT89S53 definitions added by B. Torok / bela.torok@kssg.ch
44    Dallas DS87C520 and DS83C520 definitions added by B. Torok / bela.torok@kssg.ch
45
46    Version 1.0.4 (Nov 9, 2000)
47    To simplify the identication of registers, a large number of definitios
48    were renamed. Long register names now (hopefully) clearly define the
49    function of the registers.
50    Dallas DS89C420 definitions added by B. Torok / bela.torok@kssg.ch
51
52    Version 1.0.5 (Dec 15, 2000)
53    Definitions added: #ifdef MCS51REG_EXTERNAL_ROM
54                       #ifdef MCS51REG_EXTERNAL_RAM
55                       #ifdef MCS51REG_DISABLE_WARNINGS
56
57
58    Version 1.0.6 (March 10, 2001)
59    Support for the Dallas DS5000 & DS2250
60    Support for the Dallas DS5001 & DS2251
61    Support for the Dallas DS80C390
62    microcontrollers - B. Torok / bela.torok@kssg.ch
63
64    Adding support for additional microcontrollers:
65    -----------------------------------------------
66
67    1. Don't modify this file!!!
68
69    2. Insert your code in a separate file e.g.: mcs51reg_update.h and include
70       this after the #define HEADER_MCS51REG statement in this file
71
72    3. The mcs51reg_update.h file should contain following definitions:
73
74           a. An entry with the inventory of the register set of the
75              microcontroller in the  "Describe microcontrollers" section.
76
77           b. If necessary add entry(s) in for registers not defined in this file
78
79           c. Define interrupt vectors
80
81    4. Send me the file mcs51reg_update.h ( bela.torok@kssg.ch ).
82       I'm going to verify/merge new definitions to this file.
83
84
85    Microcontroller support:
86
87    Use one of the following options:
88
89    1. use #include <mcs51reg.h> in your program & define MICROCONTROLLER_XXXX in your makefile.
90
91    2. use following definitions prior the
92       #include <mcs51reg.h> line in your program:
93       e.g.:
94       #define MICROCONTROLLER_8052       -> 8052 type microcontroller
95       or
96       #define MICROCONTROLLER_AT89CX051  -> Atmel AT89C1051, AT89C2051 and AT89C4051 microcontrollers
97
98
99    Use only one of the following definitions!!!
100
101    Supported Microcontrollers:
102
103    No definition                8051
104    MICROCONTROLLER_8051         8051
105    MICROCONTROLLER_8052         8052
106    MICROCONTROLLER_AT89CX051    Atmel AT89C1051, AT89C2051 and AT89C4051
107    MICROCONTROLLER_AT89S53      Atmel AT89S53 microcontroller
108    MICROCONTROLLER_AT89X52      Atmel AT89C52 and AT80LV52 microcontrollers
109    MICROCONTROLLER_AT89X55      Atmel AT89C55 and AT80LV55 microcontrollers
110    MICROCONTROLLER_DS5000       Dallas DS5000 & DS2250 microcontroller
111    MICROCONTROLLER_DS5001       Dallas DS5001 & DS2251 microcontroller
112    MICROCONTROLLER_DS80C32X     Dallas DS80C320 and DS80C323 microcontrollers
113    MICROCONTROLLER_DS80C390     Dallas DS80C390 microcontroller
114    MICROCONTROLLER_DS89C420     Dallas DS89C420 microcontroller
115    MICROCONTROLLER_DS8XC520     Dallas DS87C520 and DS83C520 microcontrollers
116    MICROCONTROLLER_SAB80515     Infineon / Siemens SAB80515 & SAB80535
117    MICROCONTROLLER_SAB80515A    Infineon / Siemens SAB80515A
118    MICROCONTROLLER_SAB80517     Infineon / Siemens SAB80517
119
120    Additional definitions (use them prior the #include mcs51reg.h statement):
121
122    Ports P0 & P2 are not available for the programmer if external ROM used.
123    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0 & P2.
124
125    Ports P0, P2, P3_6, WR, P3_7 & RD are not available for the programmer if
126    external RAM is used.
127    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
128    P3_6, WR, P3_7 & RD.
129
130    #define MCS51REG_DISABLE_WARNINGS -> disables warnings
131
132 -----------------------------------------------------------------------*/
133
134
135 #ifndef HEADER_MCS51REG
136 #define HEADER_MCS51REG
137
138 ///////////////////////////////////////////////////////
139 ///  Insert header here (for developers only)       ///
140 ///  remove "//" from the begining of the next line ///
141 //#include "mcs51reg_update.h"                      ///
142 ///////////////////////////////////////////////////////
143
144 //////////////////////////////////
145 ///  Describe microcontrollers ///
146 ///  (inventory of registers)  ///
147 //////////////////////////////////
148
149 // definitions for the 8051
150 #ifdef MICROCONTROLLER_8051
151 #ifdef MICROCONTROLLER_DEFINED
152 #define MCS51REG_ERROR
153 #endif
154 #ifndef MICROCONTROLLER_DEFINED
155 #define MICROCONTROLLER_DEFINED
156 #endif
157 #ifndef MCS51REG_DISABLE_WARNINGS
158 #warning Selected HW: 8051
159 #endif
160 #define P0
161 #define SP
162 #define DPL
163 #define DPH
164 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
165 #define TCON
166 #define TMOD
167 #define TL0
168 #define TL1
169 #define TH0
170 #define TH1
171 #define P1
172 #define SCON
173 #define SBUF
174 #define P2
175 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
176 #define P3
177 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
178 #define PSW
179 #define ACC
180 #define B
181 #endif
182 // end of definitions for the 8051
183
184
185 // definitions for the 8052 microcontroller
186 #ifdef MICROCONTROLLER_8052
187 #ifdef MICROCONTROLLER_DEFINED
188 #define MCS51REG_ERROR
189 #endif
190 #ifndef MICROCONTROLLER_DEFINED
191 #define MICROCONTROLLER_DEFINED
192 #endif
193 #ifndef MCS51REG_DISABLE_WARNINGS
194 #warning Selected HW: 8052
195 #endif
196 // 8051 register set
197 #define P0
198 #define SP
199 #define DPL
200 #define DPH
201 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
202 #define TCON
203 #define TMOD
204 #define TL0
205 #define TL1
206 #define TH0
207 #define TH1
208 #define P1
209 #define SCON
210 #define SBUF
211 #define P2
212 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
213 #define P3
214 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
215 #define PSW
216 #define ACC
217 #define B
218 // 8052 specific registers
219 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
220 #define RCAP2L
221 #define RCAP2H
222 #define TL2
223 #define TH2
224 #endif
225 // end of definitions for the 8052 microcontroller
226
227
228 // definitionsons for the Atmel
229 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
230 #ifdef MICROCONTROLLER_AT89CX051
231 #ifdef MICROCONTROLLER_DEFINED
232 #define MCS51REG_ERROR
233 #endif
234 #ifndef MICROCONTROLLER_DEFINED
235 #define MICROCONTROLLER_DEFINED
236 #endif
237 #ifndef MCS51REG_DISABLE_WARNINGS
238 #warning Selected HW: Atmel AT89Cx051
239 #endif
240 // 8051 register set without P0 & P2
241 #define SP
242 #define DPL
243 #define DPH
244 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
245 #define TCON
246 #define TMOD
247 #define TL0
248 #define TL1
249 #define TH0
250 #define TH1
251 #define P1
252 #define SCON
253 #define SBUF
254 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
255 #define P3
256 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
257 #define PSW
258 #define ACC
259 #define B
260 #endif
261 // end of definitionsons for the Atmel
262 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
263
264
265 // definitions for the Atmel AT89S53
266 #ifdef MICROCONTROLLER_AT89S53
267 #ifdef MICROCONTROLLER_DEFINED
268 #define MCS51REG_ERROR
269 #endif
270 #ifndef MICROCONTROLLER_DEFINED
271 #define MICROCONTROLLER_DEFINED
272 #endif
273 #ifndef MCS51REG_DISABLE_WARNINGS
274 #warning Selected HW: AT89S53
275 #endif
276 // 8051 register set
277 #define P0
278 #define SP
279 #define DPL
280 #define DPH
281 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
282 #define TCON
283 #define TMOD
284 #define TL0
285 #define TL1
286 #define TH0
287 #define TH1
288 #define P1
289 #define SCON
290 #define SBUF
291 #define P2
292 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
293 #define P3
294 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
295 #define PSW
296 #define ACC
297 #define B
298 // 8052 specific registers
299 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
300 #define RCAP2L
301 #define RCAP2H
302 #define TL2
303 #define TH2
304 // AT89S53 specific register
305 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
306 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
307 #define SPCR
308 #define SPDR
309 #define SPSR
310 #define WCOM
311 #define DPL1
312 #define DPH1
313 #endif
314 // end of definitions for the Atmel AT89S53 microcontroller
315
316
317 // definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
318 #ifdef MICROCONTROLLER_AT89X52
319 #ifdef MICROCONTROLLER_DEFINED
320 #define MCS51REG_ERROR
321 #endif
322 #ifndef MICROCONTROLLER_DEFINED
323 #define MICROCONTROLLER_DEFINED
324 #endif
325 #ifndef MCS51REG_DISABLE_WARNINGS
326 #warning Selected HW: AT89C52 or AT89LV52
327 #endif
328 // 8051 register set
329 #define P0
330 #define SP
331 #define DPL
332 #define DPH
333 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
334 #define TCON
335 #define TMOD
336 #define TL0
337 #define TL1
338 #define TH0
339 #define TH1
340 #define P1
341 #define SCON
342 #define SBUF
343 #define P2
344 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
345 #define P3
346 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
347 #define PSW
348 #define ACC
349 #define B
350 // 8052 specific registers
351 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
352 #define RCAP2L
353 #define RCAP2H
354 #define TL2
355 #define TH2
356 // AT89X55 specific register
357 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
358 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
359 #endif
360 // end of definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
361
362
363 // definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
364 #ifdef MICROCONTROLLER_AT89X55
365 #ifdef MICROCONTROLLER_DEFINED
366 #define MCS51REG_ERROR
367 #endif
368 #ifndef MICROCONTROLLER_DEFINED
369 #define MICROCONTROLLER_DEFINED
370 #endif
371 #ifndef MCS51REG_DISABLE_WARNINGS
372 #warning Selected HW: AT89C55 or AT89LV55
373 #endif
374 // 8051 register set
375 #define P0
376 #define SP
377 #define DPL
378 #define DPH
379 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
380 #define TCON
381 #define TMOD
382 #define TL0
383 #define TL1
384 #define TH0
385 #define TH1
386 #define P1
387 #define SCON
388 #define SBUF
389 #define P2
390 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
391 #define P3
392 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
393 #define PSW
394 #define ACC
395 #define B
396 // 8052 specific registers
397 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
398 #define RCAP2L
399 #define RCAP2H
400 #define TL2
401 #define TH2
402 // AT89X55 specific register
403 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
404 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
405 #endif
406 // end of definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
407
408
409 // definitions for the Dallas DS5000
410 #ifdef MICROCONTROLLER_DS5000
411 #ifdef MICROCONTROLLER_DEFINED
412 #define MCS51REG_ERROR
413 #endif
414 #ifndef MICROCONTROLLER_DEFINED
415 #define MICROCONTROLLER_DEFINED
416 #endif
417 #ifndef MCS51REG_DISABLE_WARNINGS
418 #warning Selected HW: DS5000
419 #endif
420 #define P0
421 #define SP
422 #define DPL
423 #define DPH
424 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
425 #define TCON
426 #define TMOD
427 #define TL0
428 #define TL1
429 #define TH0
430 #define TH1
431 #define P1
432 #define SCON
433 #define SBUF
434 #define P2
435 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
436 #define P3
437 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
438 #define MCON__SL__PAA__ECE2__RA32_8__PA0__PA1__PA2__PA3
439 #define TA
440 #define PSW
441 #define ACC
442 #define B
443 #endif
444 // end of definitions for the Dallas DS5000
445
446
447 // definitions for the Dallas DS5001
448 #ifdef MICROCONTROLLER_DS5001
449 #ifdef MICROCONTROLLER_DEFINED
450 #define MCS51REG_ERROR
451 #endif
452 #ifndef MICROCONTROLLER_DEFINED
453 #define MICROCONTROLLER_DEFINED
454 #endif
455 #ifndef MCS51REG_DISABLE_WARNINGS
456 #warning Selected HW: DS5001
457 #endif
458 #define P0
459 #define SP
460 #define DPL
461 #define DPH
462 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
463 #define TCON
464 #define TMOD
465 #define TL0
466 #define TL1
467 #define TH0
468 #define TH1
469 #define P1
470 #define SCON
471 #define SBUF
472 #define P2
473 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
474 #define P3
475 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
476 #define CRC
477 #define CRCLOW
478 #define CRCHIGH
479 #define MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
480 #define TA
481 #define RNR
482 #define PSW
483 #define RPCTL
484 #define STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
485 #define ACC
486 #define B
487 #endif
488 // end of definitions for the Dallas DS5001
489
490
491 // definitions for the Dallas DS80C320 and DS80C323 microcontrollers
492 #ifdef MICROCONTROLLER_DS80C32X
493 #ifdef MICROCONTROLLER_DEFINED
494 #define MCS51REG_ERROR
495 #endif
496 #ifndef MICROCONTROLLER_DEFINED
497 #define MICROCONTROLLER_DEFINED
498 #endif
499 #ifndef MCS51REG_DISABLE_WARNINGS
500 #warning Selected HW: Dallas DS80C320 or DS80C323
501 #endif
502 // 8051 register set
503 #define P0
504 #define SP
505 #define DPL
506 #define DPH
507 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
508 #define TCON
509 #define TMOD
510 #define TL0
511 #define TL1
512 #define TH0
513 #define TH1
514 #define P1
515 #define SCON
516 #define SCON0
517 #define SBUF
518 #define P2
519 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
520 #define P3
521 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
522 #define PSW
523 #define ACC
524 #define B
525 // 8052 specific registers
526 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
527 #define RCAP2L
528 #define RCAP2H
529 #define TL2
530 #define TH2
531 // DS80C320 specific register
532 #define DPL1
533 #define DPH1
534 #define DPS__x__x__x__x__x__x__x__SEL
535 #define CKCON
536 #define EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
537 #define SADDR0
538 #define SADDR1
539 #define SADEN0
540 #define SADEN1
541 #define SCON1
542 #define SBUF1
543 #define STATUS__PIP__HIP__LIP__x__x__x__x__x
544 #define TA
545 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
546 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
547 #define WDCON
548 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
549 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
550 #endif
551 // end of definitions for the Dallas DS80C320 and DS80C323 microcontrollers
552
553
554 // definitions for the Dallas DS80C390
555 #ifdef MICROCONTROLLER_DS80C390
556 #ifdef MICROCONTROLLER_DEFINED
557 #define MCS51REG_ERROR
558 #endif
559 #ifndef MICROCONTROLLER_DEFINED
560 #define MICROCONTROLLER_DEFINED
561 #endif
562 #ifndef MCS51REG_DISABLE_WARNINGS
563 #warning Selected HW: Dallas DS80C390
564 #endif
565 // 8051 register set
566 #define P0
567 #define SP
568 #define DPL
569 #define DPH
570 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
571 #define TCON
572 #define TMOD
573 #define TL0
574 #define TL1
575 #define TH0
576 #define TH1
577 #define P1
578 #define SCON
579 #define SCON0
580 #define SBUF
581 #define P2
582 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
583 #define P3
584 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
585 #define PSW
586 #define ACC
587 #define B
588 // 8052 specific registers
589 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
590 #define RCAP2L
591 #define RCAP2H
592 #define TL2
593 #define TH2
594 // DS80C390 specific register
595 #define P4_AT_0X80
596 #define DPL1
597 #define DPH1
598 #define DPS__ID1__ID0__TSL__x__x__x__x__SEL
599 #define CKCON
600 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
601 #define P4CNT
602 #define DPX
603 #define DPX1
604 #define C0RMS0
605 #define C0RMS1
606 #define ESP
607 #define AP
608 #define ACON__x__x__x__x__x__SA__AM1__AM0
609 #define C0TMA0
610 #define C0TMA1
611 #define P5_AT_0XA1
612 #define P5CNT
613 #define C0C
614 #define C0S
615 #define C0IR
616 #define C0TE
617 #define C0RE
618 #define SADDR0
619 #define SADDR1
620 #define C0M1C
621 #define C0M2C
622 #define C0M3C
623 #define C0M4C
624 #define C0M5C
625 #define C0M6C
626 #define C0M7C
627 #define C0M8C
628 #define C0M9C
629 #define C0M10C
630 #define SADEN0
631 #define SADEN1
632 #define C0M11C
633 #define C0M12C
634 #define C0M13C
635 #define C0M14C
636 #define C0M15C
637 #define SCON1
638 #define SBUF1
639 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
640 #define STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
641 #define MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
642 #define TA
643 #define T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
644 #define COR
645 #define MCNT0
646 #define MCNT1
647 #define MA
648 #define MB
649 #define MC
650 #define C1RSM0
651 #define C1RSM1
652 #define WDCON
653 #define C1TMA0
654 #define C1TMA1
655 #define C1C
656 #define C1S
657 #define C1IR
658 #define C1TE
659 #define C1RE
660 #define EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
661 #define MXMAX
662 #define C1M1C
663 #define C1M2C
664 #define C1M3C
665 #define C1M4C
666 #define C1M5C
667 #define C1M6C
668 #define C1M7C
669 #define C1M8C
670 #define C1M9C
671 #define EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
672 #define C1M10C
673 #define C1M11C
674 #define C1M12C
675 #define C1M13C
676 #define C1M14C
677 #define C1M15C
678 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
679 #endif
680 // end of definitions for the Dallas DS80C390
681
682
683 // definitions for the Dallas DS89C420 microcontroller
684 #ifdef MICROCONTROLLER_DS89C420
685 #ifdef MICROCONTROLLER_DEFINED
686 #define MCS51REG_ERROR
687 #endif
688 #ifndef MICROCONTROLLER_DEFINED
689 #define MICROCONTROLLER_DEFINED
690 #endif
691 #ifndef MCS51REG_DISABLE_WARNINGS
692 #warning Selected HW: Dallas DS89C420
693 #endif
694 // 8051 register set
695 #define P0
696 #define SP
697 #define DPL
698 #define DPH
699 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
700 #define TCON
701 #define TMOD
702 #define TL0
703 #define TL1
704 #define TH0
705 #define TH1
706 #define P1
707 #define SCON
708 #define SCON0
709 #define SBUF
710 #define P2
711 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
712 #define P3
713 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
714 #define PSW
715 #define ACC
716 #define B
717 // 8052 specific registers
718 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
719 #define RCAP2L
720 #define RCAP2H
721 #define TL2
722 #define TH2
723 // DS8XC420 specific registers
724 #define ACON__PAGEE__PAGES__PAGE0__x__x__x__x__x
725 #define DPL1
726 #define DPH1
727 #define DPS__ID1__ID0__TSL__AID__x__x__x__SEL
728 #define CKCON
729 #define CKMOD
730 #define IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
731 #define IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
732 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
733 #define PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1_DME0
734 #define SADDR0
735 #define SADDR1
736 #define SADEN0
737 #define SADEN1
738 #define SCON1
739 #define SBUF1
740 #define STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
741
742 #define TA
743 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
744 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
745 #define WDCON
746 #define ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
747 #define WDCON
748 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
749 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
750 #endif
751 // end of definitions for the Dallas DS89C420 microcontroller
752
753
754 // definitions for the Dallas DS87C520 and DS83C520 microcontrollers
755 #ifdef MICROCONTROLLER_DS8XC520
756 #ifdef MICROCONTROLLER_DEFINED
757 #define MCS51REG_ERROR
758 #endif
759 #ifndef MICROCONTROLLER_DEFINED
760 #define MICROCONTROLLER_DEFINED
761 #endif
762 #ifndef MCS51REG_DISABLE_WARNINGS
763 #warning Selected HW: Dallas DS87C520 or DS85C520
764 #endif
765 // 8051 register set
766 #define P0
767 #define SP
768 #define DPL
769 #define DPH
770 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
771 #define TCON
772 #define TMOD
773 #define TL0
774 #define TL1
775 #define TH0
776 #define TH1
777 #define P1
778 #define SCON
779 #define SCON0
780 #define SBUF
781 #define P2
782 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
783 #define P3
784 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
785 #define PSW
786 #define ACC
787 #define B
788 // 8052 specific registers
789 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
790 #define RCAP2L
791 #define RCAP2H
792 #define TL2
793 #define TH2
794 // DS8XC520 specific registers
795 #define DPL1
796 #define DPH1
797 #define DPS__x__x__x__x__x__x__x__SEL
798 #define CKCON
799 #define EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
800 #define PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1_DME0
801 #define SADDR0
802 #define SADDR1
803 #define SADEN0
804 #define SADEN1
805 #define SCON1
806 #define SBUF1
807 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
808 #define TA
809 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
810 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
811 #define WDCON
812 #define ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
813 #define BP2
814 #define WDCON
815 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
816 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
817 #endif
818 // end of definitions for the Dallas DS87C520 and DS83C520 microcontrollers
819
820
821 // definitions for the Infineon / Siemens SAB80515 & SAB80535
822 #ifdef MICROCONTROLLER_SAB80515
823 #ifdef MICROCONTROLLER_DEFINED
824 #define MCS51REG_ERROR
825 #endif
826 #ifndef MICROCONTROLLER_DEFINED
827 #define MICROCONTROLLER_DEFINED
828 #endif
829 #ifndef MCS51REG_DISABLE_WARNINGS
830 #warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
831 #endif
832 // 8051 register set without IP
833 #define P0
834 #define SP
835 #define DPL
836 #define DPH
837 #define PCON__SMOD__x__x__x__x__x__x__x
838 #define TCON
839 #define TMOD
840 #define TL0
841 #define TL1
842 #define TH0
843 #define TH1
844 #define P1
845 #define SCON
846 #define SBUF
847 #define P2
848 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
849 #define P3
850 #define PSW
851 #define ACC
852 #define B
853 // SAB80515 specific registers
854 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
855 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
856 #define IEN1
857 #define IRCON
858 #define CCEN
859 #define CCL1
860 #define CCH1
861 #define CCL2
862 #define CCH2
863 #define CCL3
864 #define CCH3
865 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
866 #define CRCL
867 #define CRCH
868 #define TL2
869 #define TH2
870 #define ADCON
871 #define ADDAT
872 #define DAPR__SAB80515
873 #define P4_AT_0XE8
874 #define P5_AT_0XF8
875 #endif
876 // end of definitions for the Infineon / Siemens SAB80515
877
878
879 // definitions for the Infineon / Siemens SAB80515A
880 #ifdef MICROCONTROLLER_SAB80515A
881 #ifdef MICROCONTROLLER_DEFINED
882 #define MCS51REG_ERROR
883 #endif
884 #ifndef MICROCONTROLLER_DEFINED
885 #define MICROCONTROLLER_DEFINED
886 #endif
887 #ifndef MCS51REG_DISABLE_WARNINGS
888 #warning Selected HW: Infineon / Siemens SAB80515A
889 #endif
890 // 8051 register set without IP
891 #define P0
892 #define SP
893 #define DPL
894 #define DPH
895 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
896 #define TCON
897 #define TMOD
898 #define TL0
899 #define TL1
900 #define TH0
901 #define TH1
902 #define P1
903 #define SCON
904 #define SBUF
905 #define P2
906 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
907 #define P3
908 #define PSW
909 #define ACC
910 #define B
911 // SAB80515A specific registers
912 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
913 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
914 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
915 #define IEN1
916 #define IRCON
917 #define CCEN
918 #define CCL1
919 #define CCH1
920 #define CCL2
921 #define CCH2
922 #define CCL3
923 #define CCH3
924 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
925 #define CRCL
926 #define CRCH
927 #define TL2
928 #define TH2
929 #define ADCON0
930 #define ADDATH
931 #define ADDATL
932 #define ADCON1
933 #define SRELL
934 #define SYSCON
935 #define SRELH
936 #define P4_AT_0XE8
937 #define P5_AT_0XF8
938 #define P6_AT_0XDB
939 #define XPAGE
940 #endif
941 // end of definitions for the Infineon / Siemens SAB80515A
942
943
944 // definitions for the Infineon / Siemens SAB80517
945 #ifdef MICROCONTROLLER_SAB80517
946 #ifdef MICROCONTROLLER_DEFINED
947 #define MCS51REG_ERROR
948 #endif
949 #ifndef MICROCONTROLLER_DEFINED
950 #define MICROCONTROLLER_DEFINED
951 #endif
952 #ifndef MCS51REG_DISABLE_WARNINGS
953 #warning Selected HW: Infineon / Siemens SAB80517
954 #endif
955 // 8051 register set without IP, SCON & SBUF
956 #define P0
957 #define SP
958 #define DPL
959 #define DPH
960 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
961 #define TCON
962 #define TMOD
963 #define TL0
964 #define TL1
965 #define TH0
966 #define TH1
967 #define P1
968 // #define SCON
969 // #define SBUF
970 #define P2
971 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
972 #define P3
973 #define PSW
974 #define ACC
975 #define B
976 // SAB80517 specific registers
977 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
978 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
979 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
980 #define IEN1
981 #define IEN2__SAB80517
982 #define IRCON
983 #define CCEN
984 #define CCL1
985 #define CCH1
986 #define CCL2
987 #define CCH2
988 #define CCL3
989 #define CCH3
990 #define CCL4
991 #define CCH4
992 #define CC4EN
993 #define CMEN
994 #define CMH0
995 #define CML0
996 #define CMH1
997 #define CML1
998 #define CMH2
999 #define CML2
1000 #define CMH3
1001 #define CML3
1002 #define CMH4
1003 #define CML4
1004 #define CMH5
1005 #define CML5
1006 #define CMH6
1007 #define CML6
1008 #define CMH7
1009 #define CML7
1010 #define CMSEL
1011 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1012 #define CRCL
1013 #define CRCH
1014 #define CTCON
1015 #define CTRELH
1016 #define CTRELL
1017 #define TL2
1018 #define TH2
1019 #define ADCON0
1020 #define ADCON1
1021 #define ADDAT
1022 #define DAPR__SAB80517
1023 #define P4_AT_0XE8
1024 #define P5_AT_0XF8
1025 #define P6_AT_0XFA
1026 #define P7_AT_0XDB
1027 #define P8_AT_0XDD
1028 #define DPSEL
1029 #define ARCON
1030 #define MD0
1031 #define MD1
1032 #define MD2
1033 #define MD3
1034 #define MD4
1035 #define MD5
1036 #define S0BUF
1037 #define S0CON
1038 #define S0RELH
1039 #define S0RELL
1040 #define S1BUF
1041 #define S1CON
1042 #define S1RELH
1043 #define S1RELL
1044 #define WDTH
1045 #define WDTL
1046 #define WDTREL
1047 #endif
1048 // end of definitions for the Infineon / Siemens SAB80517
1049
1050
1051 /////////////////////////////////////////////////////////
1052 ///  don't specify microcontrollers below this line!  ///
1053 /////////////////////////////////////////////////////////
1054
1055
1056 // default microcontroller -> 8051
1057 // use default if no microcontroller specified
1058 #ifndef MICROCONTROLLER_DEFINED
1059 #define MICROCONTROLLER_DEFINED
1060 #ifndef MCS51REG_DISABLE_WARNINGS
1061 #warning //////////////////////////////////
1062 #warning // No microcontroller defined!  //
1063 #warning //////////////////////////////////
1064 #warning Code will be generated for the
1065 #warning 8051 (default) microcontroller.
1066 #warning If you have another microcontroller
1067 #warning define it in the makefile, or in the
1068 #warning "C" source prior
1069 #warning the #include <mcs51reg.h> statement.
1070 #warning If you use a non supported
1071 #warning microcontroller, mcs51reg.h can be
1072 #warning easily extended to support your HW.
1073 #endif
1074 // 8051 register set
1075 #define P0
1076 #define SP
1077 #define DPL
1078 #define DPH
1079 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
1080 #define TCON
1081 #define TMOD
1082 #define TL0
1083 #define TL1
1084 #define TH0
1085 #define TH1
1086 #define P1
1087 #define SCON
1088 #define SBUF
1089 #define P2
1090 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1091 #define P3
1092 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
1093 #define PSW
1094 #define ACC
1095 #define B
1096 #endif
1097 // end of definitions for the default microcontroller
1098
1099
1100 #ifdef MCS51REG_ERROR
1101 #error Two or more microcontrollers defined!
1102 #endif
1103
1104 #ifdef MCS51REG_EXTERNAL_ROM
1105 #ifndef MCS51REG_UNDEFINE_P0
1106 #define MCS51REG_UNDEFINE_P0
1107 #endif
1108 #ifndef MCS51REG_UNDEFINE_P2
1109 #define MCS51REG_UNDEFINE_P2
1110 #endif
1111 #endif
1112
1113 #ifdef MCS51REG_EXTERNAL_RAM
1114 #ifndef MCS51REG_UNDEFINE_P0
1115 #define MCS51REG_UNDEFINE_P0
1116 #endif
1117 #ifndef MCS51REG_UNDEFINE_P2
1118 #define MCS51REG_UNDEFINE_P2
1119 #endif
1120 #endif
1121
1122 #ifdef MCS51REG_UNDEFINE_P0
1123 #undef P0
1124 #endif
1125
1126 #ifdef MCS51REG_UNDEFINE_P2
1127 #undef P2
1128 #endif
1129
1130 ////////////////////////////////
1131 ///  Register definitions    ///
1132 ///  (In alphabetical order) ///
1133 ////////////////////////////////
1134
1135 #ifdef ACC
1136 #undef ACC
1137 sfr at 0xE0 ACC  ;
1138 #endif
1139
1140 #ifdef ACON__PAGEE__PAGES__PAGE0__x__x__x__x__x
1141 #undef ACON__PAGEE__PAGES__PAGE0__x__x__x__x__x
1142 sfr at 0x9D ACON   ; // DS89C420 specific
1143 // Not directly accessible bits
1144 #define PAGE0   0x20
1145 #define PAGES   0x40
1146 #define PAGEE   0x80
1147 #endif
1148
1149 #ifdef ACON__x__x__x__x__x__SA__AM1__AM0
1150 #undef ACON__x__x__x__x__x__SA__AM1__AM0
1151 sfr at 0x9D ACON   ; // DS89C390 specific
1152 // Not directly accessible bits
1153 #define AM0   0x01
1154 #define AM1   0x02
1155 #define SA    0x04
1156 #endif
1157
1158 #ifdef ADCON
1159 #undef ADCON
1160 sfr at 0xD8 ADCON   ; // A/D-converter control register SAB80515 specific
1161 // Bit registers
1162 sbit at 0xD8 MX0        ;
1163 sbit at 0xD9 MX1        ;
1164 sbit at 0xDA MX2        ;
1165 sbit at 0xDB ADM        ;
1166 sbit at 0xDC BSY        ;
1167 sbit at 0xDE CLK        ;
1168 sbit at 0xDF BD         ;
1169 #endif
1170
1171 // ADCON0 ... Infineon / Siemens also called this register ADCON in the User Manual
1172 #ifdef ADCON0
1173 #undef ADCON0
1174 sfr at 0xD8 ADCON0      ; // A/D-converter control register 0 SAB80515A &
1175 // Bit registers          // SAB80517 specific
1176 sbit at 0xD8 MX0        ;
1177 sbit at 0xD9 MX1        ;
1178 sbit at 0xDA MX2        ;
1179 sbit at 0xDB ADM        ;
1180 sbit at 0xDC BSY        ;
1181 sbit at 0xDD ADEX       ;
1182 sbit at 0xDE CLK        ;
1183 sbit at 0xDF BD         ;
1184 // Not directly accessible ADCON0
1185 #define ADCON0_MX0              0x01
1186 #define ADCON0_MX1              0x02
1187 #define ADCON0_MX2              0x04
1188 #define ADCON0_ADM              0x08
1189 #define ADCON0_BSY              0x10
1190 #define ADCON0_ADEX             0x20
1191 #define ADCON0_CLK              0x40
1192 #define ADCON0_BD               0x80
1193 #endif
1194
1195 #ifdef ADCON1
1196 #undef ADCON1
1197 sfr at 0xDC ADCON1      ; // A/D-converter control register 1 SAB80515A & SAB80517 specific
1198 // Not directly accessible ADCON1
1199 #define ADCON1_MX0              0x01
1200 #define ADCON1_MX1              0x02
1201 #define ADCON1_MX2              0x04
1202 #define ADCON1_ADCL             0x80
1203 #endif
1204
1205 #ifdef ADDAT
1206 #undef ADDAT
1207 sfr at 0xD9 ADDAT   ; // A/D-converter data register SAB80515 specific
1208 #endif
1209
1210 #ifdef ADDATH
1211 #undef ADDATH
1212 sfr at 0xD9 ADDATH      ; // A/D data high byte SAB80515A specific
1213 #endif
1214
1215 #ifdef ADDATL
1216 #undef ADDATL
1217 sfr at 0xDA ADDATL      ; // A/D data low byte SAB80515A specific
1218 #endif
1219
1220 #ifdef ARCON
1221 #undef ARCON
1222 sfr at 0xEF ARCON       ; // arithmetic control register SAB80517
1223 #endif
1224
1225 #ifdef AP
1226 #undef AP
1227 sfr at 0x9C AP          ; // DS80C390
1228 #endif
1229
1230 #ifdef B
1231 #undef B
1232 sfr at 0xF0 B    ;
1233 // Bit registers
1234 sbit at 0xF0 BREG_F0        ;
1235 sbit at 0xF1 BREG_F1        ;
1236 sbit at 0xF2 BREG_F2        ;
1237 sbit at 0xF3 BREG_F3        ;
1238 sbit at 0xF4 BREG_F4        ;
1239 sbit at 0xF5 BREG_F5        ;
1240 sbit at 0xF6 BREG_F6        ;
1241 sbit at 0xF7 BREG_F7        ;
1242 #endif
1243
1244 #ifdef BP2
1245 #undef BP2
1246 sfr at 0xC3 BP2    ;
1247 // Not directly accessible bits
1248 #define MS0   0x01
1249 #define MS1   0x02
1250 #define MS2   0x04
1251 #define LB1   0x08
1252 #define LB2   0x10
1253 #define LB3   0x20
1254 #endif
1255
1256 #ifdef C0C
1257 #undef C0C
1258 sfr at 0xA3 C0C         ; // DS80C390 specific
1259 // Not directly accessible bits
1260 #define SWINT   0x01
1261 #define ERCS    0x02
1262 #define AUTOB   0x04
1263 #define CRST    0x08
1264 #define SIESTA  0x10
1265 #define PDE     0x20
1266 #define STIE    0x40
1267 #define ERIE    0x80
1268 #endif
1269
1270 #ifdef C0C
1271 #undef C0C
1272 sfr at 0xA3 C0C         ; // DS80C390 specific
1273 // Not directly accessible bits
1274 #define SWINT   0x01
1275 #define ERCS    0x02
1276 #define AUTOB   0x04
1277 #define CRST    0x08
1278 #define SIESTA  0x10
1279 #define PDE     0x20
1280 #define STIE    0x40
1281 #define ERIE    0x80
1282 #endif
1283
1284 #ifdef C0IR
1285 #undef C0IR
1286 sfr at 0xA5 C0IR        ; // DS80C390 specific
1287 // Not directly accessible bits
1288 #define INTIN0     0x01
1289 #define INTIN1     0x02
1290 #define INTIN2     0x04
1291 #define INTIN3     0x08
1292 #define INTIN4     0x10
1293 #define INTIN5     0x20
1294 #define INTIN6     0x40
1295 #define INTIN7     0x80
1296 #endif
1297
1298 #ifdef C0M1C
1299 #undef C0M1C
1300 sfr at 0xAB C0M1C       ; // DS80C390 specific
1301 // Not directly accessible bits
1302 #define DTUP     0x01
1303 #define ROW_TIH  0x02
1304 #define MTRQ     0x04
1305 #define EXTRQ    0x08
1306 #define INTRQ    0x10
1307 #define ERI      0x20
1308 #define ETI      0x40
1309 #define MSRDY    0x80
1310 #endif
1311
1312 #ifdef C0M2C
1313 #undef C0M2C
1314 sfr at 0xAC C0M2C       ; // DS80C390 specific
1315 #endif
1316
1317 #ifdef C0M3C
1318 #undef C0M3C
1319 sfr at 0xAD C0M3C       ; // DS80C390 specific
1320 #endif
1321
1322 #ifdef C0M4C
1323 #undef C0M4C
1324 sfr at 0xAE C0M4C       ; // DS80C390 specific
1325 #endif
1326
1327 #ifdef C0M5C
1328 #undef C0M5C
1329 sfr at 0xAF C0M5C       ; // DS80C390 specific
1330 #endif
1331
1332 #ifdef C0M6C
1333 #undef C0M6C
1334 sfr at 0xB3 C0M6C       ; // DS80C390 specific
1335 #endif
1336
1337 #ifdef C0M7C
1338 #undef C0M7C
1339 sfr at 0xB4 C0M7C       ; // DS80C390 specific
1340 #endif
1341
1342 #ifdef C0M8C
1343 #undef C0M8C
1344 sfr at 0xB5 C0M8C       ; // DS80C390 specific
1345 #endif
1346
1347 #ifdef C0M9C
1348 #undef C0M9C
1349 sfr at 0xB6 C0M9C       ; // DS80C390 specific
1350 #endif
1351
1352 #ifdef C0M10C
1353 #undef C0M10C
1354 sfr at 0xB7 C0M10C       ; // DS80C390 specific
1355 #endif
1356
1357 #ifdef C0M11C
1358 #undef C0M11C
1359 sfr at 0xBB C0M11C       ; // DS80C390 specific
1360 #endif
1361
1362 #ifdef C0M12C
1363 #undef C0M12C
1364 sfr at 0xBC C0M12C       ; // DS80C390 specific
1365 #endif
1366
1367 #ifdef C0M13C
1368 #undef C0M13C
1369 sfr at 0xBD C0M13C       ; // DS80C390 specific
1370 #endif
1371
1372 #ifdef C0M14C
1373 #undef C0M14C
1374 sfr at 0xBE C0M14C       ; // DS80C390 specific
1375 #endif
1376
1377 #ifdef C0M15C
1378 #undef C0M15C
1379 sfr at 0xBF C0M15C       ; // DS80C390 specific
1380 #endif
1381
1382 #ifdef C0RE
1383 #undef C0RE
1384 sfr at 0xA7 C0RE        ; // DS80C390 specific
1385 #endif
1386
1387 #ifdef C0RMS0
1388 #undef C0RMS0
1389 sfr at 0x96 C0RMS0      ; // DS80C390 specific
1390 #endif
1391
1392 #ifdef C0RMS1
1393 #undef C0RMS1
1394 sfr at 0x97 C0RMS1      ; // DS80C390 specific
1395 #endif
1396
1397 #ifdef C0S
1398 #undef C0S
1399 sfr at 0xA4 C0S         ; // DS80C390 specific
1400 // Not directly accessible bits
1401 #define ER0     0x01
1402 #define ER1     0x02
1403 #define ER2     0x04
1404 #define TXS     0x08
1405 #define RXS     0x10
1406 #define WKS     0x20
1407 #define EC96_128    0x40
1408 #define BSS     0x80
1409 #endif
1410
1411 #ifdef C0TE
1412 #undef C0TE
1413 sfr at 0xA6 C0TE        ; // DS80C390 specific
1414 #endif
1415
1416 #ifdef C0TMA0
1417 #undef C0TMA0
1418 sfr at 0x9E C0TMA0      ; // DS80C390 specific
1419 #endif
1420
1421 #ifdef C0TMA1
1422 #undef C0TMA1
1423 sfr at 0x9F C0TMA1      ; // DS80C390 specific
1424 #endif
1425
1426 #ifdef C1C
1427 #undef C1C
1428 sfr at 0xE3 C1C         ; // DS80C390 specific
1429 // Not directly accessible bits
1430 #define SWINT   0x01
1431 #define ERCS    0x02
1432 #define AUTOB   0x04
1433 #define CRST    0x08
1434 #define SIESTA  0x10
1435 #define PDE     0x20
1436 #define STIE    0x40
1437 #define ERIE    0x80
1438 #endif
1439
1440 #ifdef C1IR
1441 #undef C1IR
1442 sfr at 0xE5 C1IR         ; // DS80C390 specific
1443 // Not directly accessible bits
1444 #define INTIN0  0x01
1445 #define INTIN1  0x02
1446 #define INTIN2  0x04
1447 #define INTIN3  0x08
1448 #define INTIN4  0x10
1449 #define INTIN5  0x20
1450 #define INTIN6  0x40
1451 #define INTIN7  0x80
1452 #endif
1453
1454 #ifdef C1IRE
1455 #undef C1IRE
1456 sfr at 0xE7 C1RE         ; // DS80C390 specific
1457 #endif
1458
1459 #ifdef C1M1C
1460 #undef C1M1C
1461 sfr at 0xEB C1M1C        ; // DS80C390 specific
1462 #endif
1463
1464 #ifdef C1M1C
1465 #undef C1M1C
1466 sfr at 0xEB C1M1C        ; // DS80C390 specific
1467 #endif
1468
1469 #ifdef C1M2C
1470 #undef C1M2C
1471 sfr at 0xEC C1M2C        ; // DS80C390 specific
1472 #endif
1473
1474 #ifdef C1M3C
1475 #undef C1M3C
1476 sfr at 0xED C1M3C        ; // DS80C390 specific
1477 #endif
1478
1479 #ifdef C1M4C
1480 #undef C1M4C
1481 sfr at 0xEE C1M4C        ; // DS80C390 specific
1482 #endif
1483
1484 #ifdef C1M5C
1485 #undef C1M5C
1486 sfr at 0xEF C1M5C        ; // DS80C390 specific
1487 #endif
1488
1489 #ifdef C1M6C
1490 #undef C1M6C
1491 sfr at 0xF3 C1M6C        ; // DS80C390 specific
1492 #endif
1493
1494 #ifdef C1M7C
1495 #undef C1M7C
1496 sfr at 0xF4 C1M7C        ; // DS80C390 specific
1497 #endif
1498
1499 #ifdef C1M8C
1500 #undef C1M8C
1501 sfr at 0xF5 C1M8C        ; // DS80C390 specific
1502 #endif
1503
1504 #ifdef C1M9C
1505 #undef C1M9C
1506 sfr at 0xF6 C1M9C        ; // DS80C390 specific
1507 #endif
1508
1509 #ifdef C1M10C
1510 #undef C1M10C
1511 sfr at 0xF7 C1M10C       ; // DS80C390 specific
1512 #endif
1513
1514 #ifdef C1M11C
1515 #undef C1M11C
1516 sfr at 0xFB C1M11C       ; // DS80C390 specific
1517 #endif
1518
1519 #ifdef C1M12C
1520 #undef C1M12C
1521 sfr at 0xFC C1M12C       ; // DS80C390 specific
1522 #endif
1523
1524 #ifdef C1M13C
1525 #undef C1M13C
1526 sfr at 0xFD C1M13C        ; // DS80C390 specific
1527 #endif
1528
1529 #ifdef C1M14C
1530 #undef C1M14C
1531 sfr at 0xFE C1M14C        ; // DS80C390 specific
1532 #endif
1533
1534 #ifdef C1M15C
1535 #undef C1M15C
1536 sfr at 0xFF C1M15C        ; // DS80C390 specific
1537 #endif
1538
1539 #ifdef C1S
1540 #undef C1S
1541 sfr at 0xE4 C1S          ; // DS80C390 specific
1542 // Not directly accessible bits
1543 #define ER0     0x01
1544 #define ER1     0x02
1545 #define ER2     0x04
1546 #define TXS     0x08
1547 #define RXS     0x10
1548 #define WKS     0x20
1549 #define CECE    0x40
1550 #define BSS     0x80
1551 #endif
1552
1553 #ifdef C1ITE
1554 #undef C1ITE
1555 sfr at 0xE6 C1TE         ; // DS80C390 specific
1556 #endif
1557
1558 #ifdef C1RSM0
1559 #undef C1RSM0
1560 sfr at 0xD6 C1RSM0      ; // DS80C390 specific
1561 #endif
1562
1563 #ifdef C1RSM1
1564 #undef C1RSM1
1565 sfr at 0xD7 C1RSM1      ; // DS80C390 specific
1566 #endif
1567
1568 #ifdef C1TMA0
1569 #undef C1TMA0
1570 sfr at 0xDE C1TMA0      ; // DS80C390 specific
1571 #endif
1572
1573 #ifdef C1TMA1
1574 #undef C1TMA1
1575 sfr at 0xDF C1TMA1      ; // DS80C390 specific
1576 #endif
1577
1578 #ifdef CC4EN
1579 #undef CC4EN
1580 sfr at 0xC9 CC4EN       ; // compare/capture 4 enable register SAB80517 specific
1581 #endif
1582
1583 #ifdef CCEN
1584 #undef CCEN
1585 sfr at 0xC1 CCEN        ; // compare/capture enable register SAB80515 specific
1586 #endif
1587
1588 #ifdef CCH1
1589 #undef CCH1
1590 sfr at 0xC3 CCH1        ; // compare/capture register 1, high byte SAB80515 specific
1591 #endif
1592
1593 #ifdef CCH2
1594 #undef CCH2
1595 sfr at 0xC5 CCH2        ; // compare/capture register 2, high byte SAB80515 specific
1596 #endif
1597
1598 #ifdef CCH3
1599 #undef CCH3
1600 sfr at 0xC7 CCH3        ; // compare/capture register 3, high byte SAB80515 specific
1601 #endif
1602
1603 #ifdef CCH4
1604 #undef CCH4
1605 sfr at 0xCF CCH4        ; // compare/capture register 4, high byte SAB80515 specific
1606 #endif
1607
1608 #ifdef CCL1
1609 #undef CCL1
1610 sfr at 0xC2 CCL1        ; // compare/capture register 1, low byte SAB80515 specific
1611 #endif
1612
1613 #ifdef CCL2
1614 #undef CCL2
1615 sfr at 0xC4 CCL2        ; // compare/capture register 2, low byte SAB80515 specific
1616 #endif
1617
1618 #ifdef CCL3
1619 #undef CCL3
1620 sfr at 0xC6 CCL3        ; // compare/capture register 3, low byte SAB80515 specific
1621 #endif
1622
1623 #ifdef CCL4
1624 #undef CCL4
1625 sfr at 0xCE CCL4        ; // compare/capture register 4, low byte SAB80515 specific
1626 #endif
1627
1628 #ifdef CKCON
1629 #undef CKCON
1630 sfr at 0x8E CKCON       ; // DS80C320 & DS80C390 specific
1631 // Not directly accessible Bits.
1632 #define MD0    0x01
1633 #define MD1    0x02
1634 #define MD2    0x04
1635 #define T0M    0x08
1636 #define T1M    0x10
1637 #define T2M    0x20
1638 #define WD0    0x40
1639 #define WD1    0x80
1640 #endif
1641
1642 #ifdef CKMOD
1643 #undef CKMOD
1644 sfr at 0x96 CKMOD       ; // DS89C420 specific
1645 // Not directly accessible Bits.
1646 #define T0MH   0x08
1647 #define T1MH   0x10
1648 #define T2MH   0x20
1649 #endif
1650
1651 #ifdef CMEN
1652 #undef CMEN
1653 sfr at 0xF6 CMEN    ; // compare enable register SAB80517 specific
1654 #endif
1655
1656 #ifdef CMH0
1657 #undef CMH0
1658 sfr at 0xD3 CMH0    ; // compare register 0 high byte SAB80517 specific
1659 #endif
1660
1661 #ifdef CMH1
1662 #undef CMH1
1663 sfr at 0xD5 CMH1    ; // compare register 1 high byte SAB80517 specific
1664 #endif
1665
1666 #ifdef CMH2
1667 #undef CMH2
1668 sfr at 0xD7 CMH2    ; // compare register 2 high byte SAB80517 specific
1669 #endif
1670
1671 #ifdef CMH3
1672 #undef CMH3
1673 sfr at 0xE3 CMH3    ; // compare register 3 high byte SAB80517 specific
1674 #endif
1675
1676 #ifdef CMH4
1677 #undef CMH4
1678 sfr at 0xE5 CMH4    ; // compare register 4 high byte SAB80517 specific
1679 #endif
1680
1681 #ifdef CMH5
1682 #undef CMH5
1683 sfr at 0xE7 CMH5    ; // compare register 5 high byte SAB80517 specific
1684 #endif
1685
1686 #ifdef CMH6
1687 #undef CMH6
1688 sfr at 0xF3 CMH6    ; // compare register 6 high byte SAB80517 specific
1689 #endif
1690
1691 #ifdef CMH7
1692 #undef CMH7
1693 sfr at 0xF5 CMH7    ; // compare register 7 high byte SAB80517 specific
1694 #endif
1695
1696 #ifdef CML0
1697 #undef CML0
1698 sfr at 0xD2 CML0    ; // compare register 0 low byte SAB80517 specific
1699 #endif
1700
1701 #ifdef CML1
1702 #undef CML1
1703 sfr at 0xD4 CML1    ; // compare register 1 low byte SAB80517 specific
1704 #endif
1705
1706 #ifdef CML2
1707 #undef CML2
1708 sfr at 0xD6 CML2    ; // compare register 2 low byte SAB80517 specific
1709 #endif
1710
1711 #ifdef CML3
1712 #undef CML3
1713 sfr at 0xE2 CML3    ; // compare register 3 low byte SAB80517 specific
1714 #endif
1715
1716 #ifdef CML4
1717 #undef CML4
1718 sfr at 0xE4 CML4    ; // compare register 4 low byte SAB80517 specific
1719 #endif
1720
1721 #ifdef CML5
1722 #undef CML5
1723 sfr at 0xE6 CML5    ; // compare register 5 low byte SAB80517 specific
1724 #endif
1725
1726 #ifdef CML6
1727 #undef CML6
1728 sfr at 0xF2 CML6    ; // compare register 6 low byte SAB80517 specific
1729 #endif
1730
1731 #ifdef CML7
1732 #undef CML7
1733 sfr at 0xF4 CML7    ; // compare register 7 low byte SAB80517 specific
1734 #endif
1735
1736 #ifdef CMSEL
1737 #undef CMSEL
1738 sfr at 0xF7 CMSEL   ; // compare input select SAB80517
1739 #endif
1740
1741 #ifdef COR
1742 #undef COR
1743 sfr at 0xCE COR     ; // Dallas DS80C390 specific
1744 #define CLKOE       0x01
1745 #define COD0        0x02
1746 #define COD1        0x04
1747 #define C0BPR6      0x08
1748 #define C0BPR7      0x10
1749 #define C1BPR6      0x20
1750 #define C1BPR7      0x40
1751 #define IRDACK      0x80
1752 #endif
1753
1754 #ifdef CRC
1755 #undef CRC
1756 sfr at 0xC1 CRC     ; // Dallas DS5001 specific
1757 #define CRC_        0x01
1758 #define MDM         0x02
1759 #define RNGE0       0x10
1760 #define RNGE1       0x20
1761 #define RNGE2       0x40
1762 #define RNGE3       0x80
1763 #endif
1764
1765 #ifdef CRCH
1766 #undef CRCH
1767 sfr at 0xCB CRCH    ; // compare/reload/capture register, high byte SAB80515 specific
1768 #endif
1769
1770 #ifdef CRCHIGH
1771 #undef CRCHIGH
1772 sfr at 0xC3 CRCHIGH ; // DS5001 specific
1773 #endif
1774
1775 #ifdef CRCL
1776 #undef CRCL
1777 sfr at 0xCA CRCL    ; // compare/reload/capture register, low byte SAB80515 specific
1778 #endif
1779
1780 #ifdef CRCLOW
1781 #undef CRCLOW
1782 sfr at 0xC2 CRCLOW  ; // DS5001 specific
1783 #endif
1784
1785 #ifdef CTCON
1786 #undef CTCON
1787 sfr at 0xE1 CTCON    ; // com.timer control register SAB80517
1788 #endif
1789
1790 #ifdef CTRELH
1791 #undef CTRELH
1792 sfr at 0xDF CTRELH  ; // com.timer rel register high byte SAB80517
1793 #endif
1794
1795 #ifdef CTRELL
1796 #undef CTRELL
1797 sfr at 0xDE CTRELL  ; // com.timer rel register low byte SAB80517
1798 #endif
1799
1800 #ifdef DAPR__SAB80515
1801 #undef DAPR__SAB80515
1802 sfr at 0xD8 DAPR    ; // D/A-converter program register SAB80515 specific
1803 #endif
1804
1805 #ifdef DAPR__SAB80517
1806 #undef DAPR__SAB80517
1807 sfr at 0xDA DAPR    ; // D/A-converter program register SAB80517 specific
1808 #endif
1809
1810 #ifdef DPH
1811 #undef DPH
1812 sfr at 0x83 DPH  ;
1813 sfr at 0x83 DP0H ;  // Alternate name for AT89S53
1814 #endif
1815
1816 #ifdef DPH1
1817 #undef DPH1
1818 sfr at 0x85 DPH1  ; // DS80C320 specific
1819 sfr at 0x85 DP1H  ; // Alternate name for AT89S53
1820 #endif
1821
1822 #ifdef DPL
1823 #undef DPL
1824 sfr at 0x82 DPL  ;  // Alternate name for AT89S53
1825 sfr at 0x82 DP0L ;
1826 #endif
1827
1828 #ifdef DPL1
1829 #undef DPL1
1830 sfr at 0x84 DPL1  ; // DS80C320 specific
1831 sfr at 0x84 DP1L  ; // Alternate name for AT89S53
1832 #endif
1833
1834 #ifdef DPS__x__x__x__x__x__x__x__SEL
1835 #undef DPS__x__x__x__x__x__x__x__SEL
1836 sfr at 0x86 DPS  ;
1837 // Not directly accessible DPS Bit. DS80C320 & DPS8XC520 specific
1838 #define SEL    0x01
1839 #endif
1840
1841 #ifdef DPS__ID1__ID0__TSL__x__x__x__x__SEL
1842 #undef DPS__ID1__ID0__TSL__x__x__x__x__SEL
1843 sfr at 0x86 DPS  ;
1844 // Not directly accessible DPS Bit. DS89C390 specific
1845 #define SEL    0x01
1846 #define TSL    0x20
1847 #define ID0    0x40
1848 #define ID1    0x80
1849 #endif
1850
1851 #ifdef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
1852 #undef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
1853 sfr at 0x86 DPS  ;
1854 // Not directly accessible DPS Bit. DS89C420 specific
1855 #define SEL    0x01
1856 #define AID    0x10
1857 #define TSL    0x20
1858 #define ID0    0x40
1859 #define ID1    0x80
1860 #endif
1861
1862 #ifdef DPSEL
1863 #undef DPSEL
1864 sfr at 0x92 DPSEL   ; // data pointer select register SAB80517
1865 #endif
1866
1867 #ifdef DPX
1868 #undef DPX
1869 sfr at 0x93 DPX1  ; // DS80C390 specific
1870 #endif
1871
1872 #ifdef DPX1
1873 #undef DPX1
1874 sfr at 0x95 DPX1  ; // DS80C390 specific
1875 #endif
1876
1877 #ifdef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
1878 #undef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
1879 sfr at 0xE8 EIE  ;
1880 // Bit registers DS80C320 specific
1881 sbit at 0xE8 EX2    ;
1882 sbit at 0xE9 EX3    ;
1883 sbit at 0xEA EX4    ;
1884 sbit at 0xEB EX5    ;
1885 sbit at 0xEC EWDI   ;
1886 #endif
1887
1888 #ifdef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
1889 #undef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
1890 sfr at 0xE8 EIE  ;
1891 // Bit registers DS80C390 specific
1892 sbit at 0xE8 EX2    ;
1893 sbit at 0xE9 EX3    ;
1894 sbit at 0xEA EX4    ;
1895 sbit at 0xEB EX5    ;
1896 sbit at 0xEC EWDI   ;
1897 sbit at 0xED C1IE   ;
1898 sbit at 0xEE C0IE   ;
1899 sbit at 0xEF CANBIE ;
1900 #endif
1901
1902 #ifdef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1903 #undef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1904 sfr at 0xF8 EIP  ;
1905 // Bit registers DS80C320 specific
1906 sbit at 0xF8 PX2    ;
1907 sbit at 0xF9 PX3    ;
1908 sbit at 0xFA PX4    ;
1909 sbit at 0xFB PX5    ;
1910 sbit at 0xFC PWDI   ;
1911 #endif
1912
1913 #ifdef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1914 #undef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1915 sfr at 0xF8 EIP  ;
1916 // Bit registers DS80C320 specific
1917 sbit at 0xF8 PX2    ;
1918 sbit at 0xF9 PX3    ;
1919 sbit at 0xFA PX4    ;
1920 sbit at 0xFB PX5    ;
1921 sbit at 0xFC PWDI   ;
1922 sbit at 0xFD C1IP   ;
1923 sbit at 0xFE C0IP   ;
1924 sbit at 0xFF CANBIP ;
1925 #endif
1926
1927 #ifdef ESP
1928 #undef ESP
1929 sfr at 0x9B ESP  ;
1930 // Not directly accessible Bits DS80C390 specific
1931 #define ESP_0   0x01
1932 #define ESP_1   0x02
1933 #endif
1934
1935 #ifdef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
1936 #undef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
1937 sfr at 0x91 EXIF  ;
1938 // Not directly accessible EXIF Bits DS80C320 specific
1939 #define BGS    0x01
1940 #define RGSL   0x02
1941 #define RGMD   0x04
1942 #define IE2    0x10
1943 #define IE3    0x20
1944 #define IE4    0x40
1945 #define IE5    0x80
1946 #endif
1947
1948 #ifdef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
1949 #undef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
1950 sfr at 0x91 EXIF  ;
1951 // Not directly accessible EXIF Bits DS87C520 specific
1952 #define BGS    0x01
1953 #define RGSL   0x02
1954 #define RGMD   0x04
1955 #define XT_RG  0x08
1956 #define IE2    0x10
1957 #define IE3    0x20
1958 #define IE4    0x40
1959 #define IE5    0x80
1960 #endif
1961
1962 #ifdef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
1963 #undef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
1964 sfr at 0x91 EXIF  ;
1965 // Not directly accessible EXIF Bits DS80C390 & DS89C420 specific
1966 #define BGS    0x01
1967 #define RGSL   0x02
1968 #define RGMD   0x04
1969 #define CKRY   0x08
1970 #define IE2    0x10
1971 #define IE3    0x20
1972 #define IE4    0x40
1973 #define IE5    0x80
1974 #endif
1975
1976 #ifdef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1977 #undef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1978 sfr at 0xA8 IE   ;
1979 // Bit registers
1980 sbit at 0xA8 EX0  ;
1981 sbit at 0xA9 ET0  ;
1982 sbit at 0xAA EX1  ;
1983 sbit at 0xAB ET1  ;
1984 sbit at 0xAC ES   ;
1985 sbit at 0xAF EA   ;
1986 #endif
1987
1988 #ifdef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
1989 #undef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
1990 sfr at 0xA8 IE   ;
1991 // Bit registers
1992 sbit at 0xA8 EX0  ;
1993 sbit at 0xA9 ET0  ;
1994 sbit at 0xAA EX1  ;
1995 sbit at 0xAB ET1  ;
1996 sbit at 0xAC ES   ;
1997 sbit at 0xAD ET2  ; // Enable timer2 interrupt
1998 sbit at 0xAF EA   ;
1999 #endif // IE
2000
2001 #ifdef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2002 #undef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2003 sfr at 0xA8 IE   ;
2004 // Bit registers
2005 sbit at 0xA8 EX0  ;
2006 sbit at 0xA9 ET0  ;
2007 sbit at 0xAA EX1  ;
2008 sbit at 0xAB ET1  ;
2009 sbit at 0xAC ES   ;
2010 sbit at 0xAC ES0  ; // Alternate name
2011 sbit at 0xAD ET2  ; // Enable timer2 interrupt
2012 sbit at 0xAE ES1  ;
2013 sbit at 0xAF EA   ;
2014 #endif // IE
2015
2016 #ifdef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2017 #undef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2018 sfr at 0xA8 IE    ;
2019 sfr at 0xA8 IEN0  ; // Alternate name
2020 // Bit registers for the SAB80515 and compatible IE
2021 sbit at 0xA8 EX0  ;
2022 sbit at 0xA9 ET0  ;
2023 sbit at 0xAA EX1  ;
2024 sbit at 0xAB ET1  ;
2025 sbit at 0xAC ES   ;
2026 sbit at 0xAC ES0  ;
2027 sbit at 0xAD ET2  ; // Enable timer 2 overflow SAB80515 specific
2028 sbit at 0xAE WDT  ; // watchdog timer reset - SAB80515 specific
2029 sbit at 0xAF EA   ;
2030 sbit at 0xAF EAL  ; // EA as called by Infineon / Siemens
2031 #endif
2032
2033 #ifdef IEN1
2034 #undef IEN1
2035 sfr at 0xB8 IEN1        ; // interrupt enable register - SAB80515 specific
2036 // Bit registers
2037 sbit at 0xB8 EADC       ; // A/D converter interrupt enable
2038 sbit at 0xB9 EX2        ;
2039 sbit at 0xBA EX3        ;
2040 sbit at 0xBB EX4        ;
2041 sbit at 0xBC EX5        ;
2042 sbit at 0xBD EX6        ;
2043 sbit at 0xBE SWDT       ; // watchdog timer start/reset
2044 sbit at 0xBF EXEN2      ; // timer2 external reload interrupt enable
2045 #endif
2046
2047 #ifdef IEN2__SAB80517
2048 #undef IEN2__SAB80517
2049 sfr at 0x9A IEN2        ; // interrupt enable register 2 SAB80517
2050 #endif
2051
2052 #ifdef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2053 #undef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2054 sfr at 0xB8 IP   ;
2055 // Bit registers
2056 sbit at 0xB8 PX0  ;
2057 sbit at 0xB9 PT0  ;
2058 sbit at 0xBA PX1  ;
2059 sbit at 0xBB PT1  ;
2060 sbit at 0xBC PS   ;
2061 #endif
2062
2063 #ifdef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2064 #undef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2065 sfr at 0xB8 IP    ;
2066 // Bit registers
2067 sbit at 0xB8 PX0  ;
2068 sbit at 0xB9 PT0  ;
2069 sbit at 0xBA PX1  ;
2070 sbit at 0xBB PT1  ;
2071 sbit at 0xBC PS   ;
2072 sbit at 0xBC PS0  ;  // alternate name
2073 sbit at 0xBD PT2  ;
2074 #endif
2075
2076 #ifdef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2077 #undef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2078 sfr at 0xB8 IP   ;
2079 // Bit registers
2080 sbit at 0xB8 PX0  ;
2081 sbit at 0xB9 PT0  ;
2082 sbit at 0xBA PX1  ;
2083 sbit at 0xBB PT1  ;
2084 sbit at 0xBC PS   ;
2085 sbit at 0xBD PT2  ;
2086 sbit at 0xBE PS1  ;
2087 #endif
2088
2089 #ifdef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2090 #undef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2091 sfr at 0xB8 IP   ;
2092 // Bit registers
2093 sbit at 0xB8 PX0  ;
2094 sbit at 0xB9 PT0  ;
2095 sbit at 0xBA PX1  ;
2096 sbit at 0xBB PT1  ;
2097 sbit at 0xBC PS   ;
2098 sbit at 0xBF RWT  ;
2099 #endif
2100
2101 #ifdef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2102 #undef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2103 sfr at 0xA9 IP0   ; // interrupt priority register SAB80515 specific
2104 // Not directly accessible IP0 bits
2105 #define IP0_0    0x01
2106 #define IP0_1    0x02
2107 #define IP0_2    0x04
2108 #define IP0_3    0x08
2109 #define IP0_4    0x10
2110 #define IP0_5    0x20
2111 #define WDTS     0x40
2112 #endif
2113
2114 #ifdef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2115 #undef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2116 sfr at 0xB8 IP0   ; // interrupt priority register DS89C420 specific
2117 // Not directly accessible IP0 bits
2118 #define LPX0    0x01
2119 #define LPT0    0x02
2120 #define LPX1    0x04
2121 #define LPT1    0x08
2122 #define LPS0    0x10
2123 #define LPT2    0x20
2124 #define LPS1    0x40
2125 #endif
2126
2127 #ifdef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2128 #undef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2129 sfr at 0xB9 IP1   ; // interrupt priority register SAB80515 specific
2130 // Not directly accessible IP1 bits
2131 #define IP1_0    0x01
2132 #define IP1_1    0x02
2133 #define IP1_2    0x04
2134 #define IP1_3    0x08
2135 #define IP1_4    0x10
2136 #define IP1_5    0x20
2137 #endif
2138
2139 #ifdef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2140 #undef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2141 sfr at 0xB1 IP1   ; // interrupt priority register DS89C420 specific
2142 // Not directly accessible IP0 bits
2143 #define LPX0    0x01
2144 #define LPT0    0x02
2145 #define LPX1    0x04
2146 #define LPT1    0x08
2147 #define LPS0    0x10
2148 #define LPT2    0x20
2149 #define LPS1    0x40
2150 #endif
2151
2152 #ifdef IRCON
2153 #undef IRCON
2154 sfr at 0xC0 IRCON       ; // interrupt control register - SAB80515 specific
2155 // Bit registers
2156 sbit at 0xC0 IADC       ; // A/D converter irq flag
2157 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2158 sbit at 0xC2 IEX3       ;
2159 sbit at 0xC3 IEX4       ;
2160 sbit at 0xC4 IEX5       ;
2161 sbit at 0xC5 IEX6       ;
2162 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2163 sbit at 0xC7 EXF2       ; // timer2 reload flag
2164 #endif
2165
2166 #ifdef IRCON0
2167 #undef IRCON0
2168 sfr at 0xC0 IRCON0       ; // interrupt control register - SAB80515 specific
2169 // Bit registers
2170 sbit at 0xC0 IADC       ; // A/D converter irq flag
2171 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2172 sbit at 0xC2 IEX3       ;
2173 sbit at 0xC3 IEX4       ;
2174 sbit at 0xC4 IEX5       ;
2175 sbit at 0xC5 IEX6       ;
2176 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2177 sbit at 0xC7 EXF2       ; // timer2 reload flag
2178 #endif
2179
2180 #ifdef IRCON1
2181 #undef IRCON1
2182 sfr at 0xD1 IRCON1      ; // interrupt control register - SAB80515 specific
2183 #endif
2184
2185 #ifdef MA
2186 #undef MA
2187 sfr at 0xD3 MA          ; // DS80C390
2188 #endif
2189
2190 #ifdef MB
2191 #undef MB
2192 sfr at 0xD4 MB          ; // DS80C390
2193 #endif
2194
2195 #ifdef MC
2196 #undef MC
2197 sfr at 0xD5 MC          ; // DS80C390
2198 #endif
2199
2200 #ifdef MCNT0
2201 #undef MCNT0
2202 sfr at 0xD1 MCNT0       ; // DS80C390
2203 #define MAS0     0x01
2204 #define MAS1     0x02
2205 #define MAS2     0x04
2206 #define MAS3     0x08
2207 #define MAS4     0x10
2208 #define SCB      0x20
2209 #define CSE      0x40
2210 #define LSHIFT   0x80
2211 #endif
2212
2213 #ifdef MCNT1
2214 #undef MCNT1
2215 sfr at 0xD2 MCNT1       ; // DS80C390
2216 #define CLM      0x10
2217 #define MOF      0x40
2218 #define MST      0x80
2219 #endif
2220
2221 #ifdef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2222 #undef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2223 sfr at 0xC6 MCON        ; // DS80C390
2224 #define PDCE0    0x01
2225 #define PDCE1    0x02
2226 #define PDCE2    0x04
2227 #define PDCE3    0x08
2228 #define CMA      0x20
2229 #define IDM0     0x40
2230 #define IDM1     0x80
2231 #endif
2232
2233 #ifdef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2234 #undef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2235 sfr at 0xC6 MCON        ; // DS5000
2236 #define SL       0x01
2237 #define PAA      0x02
2238 #define ECE2     0x04
2239 #define RA32_8   0x08
2240 #define PA0      0x10
2241 #define PA1      0x20
2242 #define PA2      0x40
2243 #define PA3      0x80
2244 #endif
2245
2246 #ifdef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
2247 #undef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
2248 sfr at 0xC6 MCON        ; // DS5001
2249 #define SL       0x01
2250 #define PM       0x02
2251 #define PES      0x04
2252 #define RG1      0x08
2253 #define PA0      0x10
2254 #define PA1      0x20
2255 #define PA2      0x40
2256 #define PA3      0x80
2257 #endif
2258
2259 #ifdef MD0
2260 #undef MD0
2261 sfr at 0xE9 MD0         ; // MUL / DIV register 0 SAB80517
2262 #endif
2263
2264 #ifdef MD1
2265 #undef MD1
2266 sfr at 0xEA MD1         ; // MUL / DIV register 1 SAB80517
2267 #endif
2268
2269 #ifdef MD2
2270 #undef MD2
2271 sfr at 0xEB MD2         ; // MUL / DIV register 2 SAB80517
2272 #endif
2273
2274 #ifdef MD3
2275 #undef MD3
2276 sfr at 0xEC MD3         ; // MUL / DIV register 3 SAB80517
2277 #endif
2278
2279 #ifdef MD4
2280 #undef MD4
2281 sfr at 0xED MD4         ; // MUL / DIV register 4 SAB80517
2282 #endif
2283
2284 #ifdef MD5
2285 #undef MD5
2286 sfr at 0xEE MD5         ; // MUL / DIV register 5 SAB80517
2287 #endif
2288
2289 #ifdef MXAX
2290 #undef MXAX
2291 sfr at 0xEA MXAX        ; // Dallas DS80C390
2292 #endif
2293
2294 #ifdef P0
2295 #undef P0
2296 sfr at 0x80 P0   ;
2297 //  Bit Registers
2298 sbit at 0x80 P0_0 ;
2299 sbit at 0x81 P0_1 ;
2300 sbit at 0x82 P0_2 ;
2301 sbit at 0x83 P0_3 ;
2302 sbit at 0x84 P0_4 ;
2303 sbit at 0x85 P0_5 ;
2304 sbit at 0x86 P0_6 ;
2305 sbit at 0x87 P0_7 ;
2306 #endif
2307
2308 #ifdef P1
2309 #undef P1
2310 sfr at 0x90 P1   ;
2311 // Bit registers
2312 sbit at 0x90 P1_0 ;
2313 sbit at 0x91 P1_1 ;
2314 sbit at 0x92 P1_2 ;
2315 sbit at 0x93 P1_3 ;
2316 sbit at 0x94 P1_4 ;
2317 sbit at 0x95 P1_5 ;
2318 sbit at 0x96 P1_6 ;
2319 sbit at 0x97 P1_7 ;
2320 #endif
2321
2322 #ifdef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
2323 #undef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
2324 // P1 alternate functions
2325 sbit at 0x90 T2   ;
2326 sbit at 0x91 T2EX ;
2327 sbit at 0x92 RXD1 ;
2328 sbit at 0x93 TXD1 ;
2329 sbit at 0x94 INT2 ;
2330 sbit at 0x95 INT3 ;
2331 sbit at 0x96 INT4 ;
2332 sbit at 0x97 INT5 ;
2333 #endif
2334
2335 #ifdef P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
2336 sbit at 0x90 INT3_CC0   ; // P1 alternate functions - SAB80515 specific
2337 sbit at 0x91 INT4_CC1   ;
2338 sbit at 0x92 INT5_CC2   ;
2339 sbit at 0x93 INT6_CC3   ;
2340 sbit at 0x94 INT2       ;
2341 sbit at 0x95 T2EX       ;
2342 sbit at 0x96 CLKOUT     ;
2343 sbit at 0x97 T2         ;
2344 #endif
2345
2346 #ifdef P1_EXT__x__x__x__x__x__x__T2EX__T2
2347 #undef P1_EXT__x__x__x__x__x__x__T2EX__T2
2348 // P1 alternate functions
2349 sbit at 0x90 T2         ;
2350 sbit at 0x91 T2EX       ;
2351 #endif
2352
2353 #ifdef P2
2354 #undef P2
2355 sfr at 0xA0 P2   ;
2356 // Bit registers
2357 sbit at 0xA0 P2_0 ;
2358 sbit at 0xA1 P2_1 ;
2359 sbit at 0xA2 P2_2 ;
2360 sbit at 0xA3 P2_3 ;
2361 sbit at 0xA4 P2_4 ;
2362 sbit at 0xA5 P2_5 ;
2363 sbit at 0xA6 P2_6 ;
2364 sbit at 0xA7 P2_7 ;
2365 #endif
2366
2367 #ifdef P3
2368 #undef P3
2369 sfr at 0xB0 P3   ;
2370 // Bit registers
2371 sbit at 0xB0 P3_0 ;
2372 sbit at 0xB1 P3_1 ;
2373 sbit at 0xB2 P3_2 ;
2374 sbit at 0xB3 P3_3 ;
2375 sbit at 0xB4 P3_4 ;
2376 sbit at 0xB5 P3_5 ;
2377 #ifndef MCS51REG_EXTERNAL_RAM
2378 sbit at 0xB6 P3_6 ;
2379 sbit at 0xB7 P3_7 ;
2380 #endif
2381 // alternate names
2382 sbit at 0xB0 RXD  ;
2383 sbit at 0xB0 RXD0  ;
2384 sbit at 0xB1 TXD  ;
2385 sbit at 0xB1 TXD0  ;
2386 sbit at 0xB2 INT0 ;
2387 sbit at 0xB3 INT1 ;
2388 sbit at 0xB4 T0   ;
2389 sbit at 0xB5 T1   ;
2390 #ifndef MCS51REG_EXTERNAL_RAM
2391 sbit at 0xB6 WR   ;
2392 sbit at 0xB7 RD   ;
2393 #endif
2394 #endif
2395
2396 #ifdef P4_AT_0X80
2397 #undef P4_AT_0X80
2398 sfr at 0x80 P4          ; // Port 4 - DS80C390
2399 // Bit registers
2400 sbit at 0x80 P4_0       ;
2401 sbit at 0x81 P4_1       ;
2402 sbit at 0x82 P4_2       ;
2403 sbit at 0x83 P4_3       ;
2404 sbit at 0x84 P4_4       ;
2405 sbit at 0x85 P4_5       ;
2406 sbit at 0x86 P4_6       ;
2407 sbit at 0x87 P4_7       ;
2408 #endif
2409
2410 #ifdef P4_AT_0XE8
2411 #undef P4_AT_0XE8
2412 sfr at 0xE8 P4          ; // Port 4 - SAB80515 & compatible microcontrollers
2413 // Bit registers
2414 sbit at 0xE8 P4_0       ;
2415 sbit at 0xE9 P4_1       ;
2416 sbit at 0xEA P4_2       ;
2417 sbit at 0xEB P4_3       ;
2418 sbit at 0xEC P4_4       ;
2419 sbit at 0xED P4_5       ;
2420 sbit at 0xEE P4_6       ;
2421 sbit at 0xEF P4_7       ;
2422 #endif
2423
2424 #ifdef P4CNT
2425 #undef P4CNT
2426 sfr at 0x92 P4CNT       ; // DS80C390
2427 // Not directly accessible bits
2428 #define P4CNT_0  0x01
2429 #define P4CNT_1  0x02
2430 #define P4CNT_2  0x04
2431 #define P4CNT_3  0x08
2432 #define P4CNT_4  0x10
2433 #define P4CNT_5  0x20
2434 #define SBCAN    0x40
2435 #endif
2436
2437 #ifdef P5_AT_0XA1
2438 #undef P5_AT_0XA1
2439 sfr at 0xA1 P5          ; // Port 5 - DS80C390
2440 #endif
2441
2442 #ifdef P5CNT
2443 #undef P5CNT
2444 sfr at 0xA2 P5CNT       ; // DS80C390
2445 // Not directly accessible bits
2446 #define P5CNT_0  0x01
2447 #define P5CNT_1  0x02
2448 #define P5CNT_2  0x04
2449 #define C0_I_O   0x08
2450 #define C1_I_O   0x10
2451 #define SP1EC    0x20
2452 #define SBCAN0BA 0x40
2453 #define SBCAN1BA 0x80
2454 #endif
2455
2456 #ifdef P5_AT_0XF8
2457 #undef P5_AT_0XF8
2458 sfr at 0xF8 P5          ; // Port 5 - SAB80515 & compatible microcontrollers
2459 // Bit registers
2460 sbit at 0xF8 P5_0       ;
2461 sbit at 0xF9 P5_1       ;
2462 sbit at 0xFA P5_2       ;
2463 sbit at 0xFB P5_3       ;
2464 sbit at 0xFC P5_4       ;
2465 sbit at 0xFD P5_5       ;
2466 sbit at 0xFE P5_6       ;
2467 sbit at 0xFF P5_7       ;
2468 #endif
2469
2470 #ifdef P6_AT_0XDB
2471 #undef P6_AT_0XDB
2472 sfr at 0xDB P6          ; // Port 6 - SAB80515 & compatible microcontrollers
2473 #endif
2474
2475 #ifdef P6_AT_0XFA
2476 #undef P6_AT_0XFA
2477 sfr at 0xFA P6          ; // Port 6 - SAB80517 specific
2478 #endif
2479
2480 #ifdef P7_AT_0XDB
2481 #undef P7_AT_0XDB
2482 sfr at 0xDB P7          ; // Port 7 - SAB80517 specific
2483 #endif
2484
2485 #ifdef P8_AT_0XDD
2486 #undef P8_AT_0XDD
2487 sfr at 0xDD P8          ; // Port 6 - SAB80517 specific
2488 #endif
2489
2490 #ifdef PCON__SMOD__x__x__x__x__x__x__x
2491 #undef PCON__SMOD__x__x__x__x__x__x__x
2492 sfr at 0x87 PCON ;
2493 // Not directly accessible PCON bits
2494 #define SMOD    0x80
2495 #endif
2496
2497 #ifdef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
2498 #undef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
2499 sfr at 0x87 PCON ;
2500 // Not directly accessible PCON bits
2501 #define IDL             0x01
2502 #define PD              0x02
2503 #define GF0             0x04
2504 #define GF1             0x08
2505 #define SMOD            0x80
2506 #endif
2507
2508 #ifdef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
2509 #undef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
2510 sfr at 0x87 PCON ;
2511 // Not directly accessible PCON bits
2512 #define IDL             0x01
2513 #define IDLE            0x01  ; same as IDL
2514 #define PD              0x02  ;
2515 #define PDE             0x02  ; same as PD
2516 #define IDLS            0x20
2517 #define PDS             0x40
2518 #define SMOD            0x80
2519 // alternate names
2520 #define PCON_IDLE       0x01
2521 #define PCON_PDE        0x02
2522 #define PCON_GF0        0x04
2523 #define PCON_GF1        0x08
2524 #define PCON_IDLS       0x20
2525 #define PCON_PDS        0x40
2526 #define PCON_SMOD       0x80
2527 #endif
2528
2529 #ifdef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
2530 #undef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
2531 sfr at 0x87 PCON ;
2532 // Not directly accessible PCON bits
2533 #define IDL             0x01
2534 #define IDLE            0x01  ; same as IDL
2535 #define STOP            0x02  ;
2536 #define EWT             0x04
2537 #define EPFW            0x08
2538 #define WTR             0x10
2539 #define PFW             0x20
2540 #define POR             0x40
2541 #define SMOD            0x80
2542 #endif
2543
2544 #ifdef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
2545 #undef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
2546 sfr at 0x87 PCON ;
2547 // Not directly accessible PCON bits
2548 #define IDL             0x01
2549 #define IDLE            0x01  ; same as IDL
2550 #define STOP            0x02  ;
2551 #define GF0             0x04
2552 #define GF1             0x08
2553 #define SMOD0           0x40
2554 #define SMOD            0x80
2555 #endif
2556
2557 #ifdef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
2558 #undef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
2559 sfr at 0x87 PCON ;
2560 // Not directly accessible PCON bits
2561 #define IDL             0x01
2562 #define IDLE            0x01  ; same as IDL
2563 #define STOP            0x02  ;
2564 #define GF0             0x04
2565 #define GF1             0x08
2566 #define OFDE            0x10
2567 #define OFDF            0x20
2568 #define SMOD0           0x40
2569 #define SMOD            0x80
2570 #define SMOD_0          0x80  ; same as SMOD
2571 #endif
2572
2573 #ifdef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1_DME0
2574 #undef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1_DME0
2575 sfr at 0xC4 PMR  ;   // DS87C520, DS83C520
2576 // Not directly accessible bits
2577 #define DME0    0x01
2578 #define DME1    0x02
2579 #define ALEOFF  0x04
2580 #define XTOFF   0x08
2581 #define SWB     0x20
2582 #define CD0     0x40
2583 #define CD1     0x80
2584 #endif
2585
2586 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
2587 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
2588 sfr at 0xC4 PMR  ;   // DS80C390
2589 // Not directly accessible bits
2590 #define ALEOFF  0x04
2591 #define XTOFF   0x08
2592 #define _4X_2X  0x10
2593 #define SWB     0x20
2594 #define CD0     0x40
2595 #define CD1     0x80
2596 #endif
2597
2598 #ifdef PSW
2599 #undef PSW
2600 sfr at 0xD0 PSW  ;
2601 // Bit registers
2602 sbit at 0xD0 P    ;
2603 sbit at 0xD1 F1   ;
2604 sbit at 0xD2 OV   ;
2605 sbit at 0xD3 RS0  ;
2606 sbit at 0xD4 RS1  ;
2607 sbit at 0xD5 F0   ;
2608 sbit at 0xD6 AC   ;
2609 sbit at 0xD7 CY   ;
2610 #endif
2611
2612 #ifdef RCAP2H
2613 #undef RCAP2H
2614 sfr at 0xCB RCAP2H  ;
2615 #endif
2616
2617 #ifdef RCAP2L
2618 #undef RCAP2L
2619 sfr at 0xCA RCAP2L  ;
2620 #endif
2621
2622 #ifdef RNR
2623 #undef RNR
2624 sfr at 0xCF RNR  ;
2625 #endif
2626
2627 #ifdef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
2628 #undef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
2629 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
2630 // Not directly accessible bits
2631 #define RSM0    0x01
2632 #define RSM1    0x02
2633 #define RSM2    0x04
2634 #endif
2635
2636 #ifdef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
2637 #undef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
2638 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
2639 // Not directly accessible bits
2640 #define RSM0    0x01
2641 #define RSM1    0x02
2642 #define RSM2    0x04
2643 #define PRAME   0x08
2644 #define MOVCX   0x10
2645 #define TE      0x20
2646 #define BPF     0x40
2647 #define HBPF    0x80
2648 #endif
2649
2650 #ifdef RPCTL
2651 #undef RPCTL
2652 sfr at 0xD8 RPCTL     ;  // Dallas DS5001 specific
2653 sbit at 0xD8 RG0      ;
2654 sbit at 0xD9 RPCON    ;
2655 sbit at 0xDA DMA      ;
2656 sbit at 0xDB IBI      ;
2657 sbit at 0xDC AE       ;
2658 sbit at 0xDD EXBS     ;
2659 sbit at 0xDF RNR_FLAG ;
2660 #endif
2661
2662 #ifdef S0BUF
2663 #undef S0BUF
2664 sfr at 0x99 S0BUF ; // serial channel 0 buffer register SAB80517 specific
2665 #endif
2666
2667 #ifdef S0CON
2668 #undef S0CON
2669 sfr at 0x98 S0CON ; // serial channel 0 control register SAB80517 specific
2670 // Bit registers
2671 sbit at 0x98 RI0  ; // S0CON.0: receiver0 interrupt flag
2672 sbit at 0x99 TI0  ; // S0CON.1: transmitter0 interrupt flag
2673 sbit at 0x9A RB80 ; // S0CON.2: receiver0 bit8
2674 sbit at 0x9B TB80 ; // S0CON.3: transmitter0 bit 8
2675 sbit at 0x9C REN0 ; // S0CON.4: receiver0 enable
2676 sbit at 0x9D SM20 ; // S0CON.5: multiprocessor feature
2677 sbit at 0x9E SM1  ; // S0CON.6: | select serial mode
2678 sbit at 0x9F SM0  ; // S0CON.7: |
2679 #endif
2680
2681 #ifdef S0RELL
2682 #undef S0RELL
2683 sfr at 0xAA S0RELL ; // serial channel 0 reload register low byte SAB80517 specific
2684 #endif
2685
2686 #ifdef S0RELH
2687 #undef S0RELH
2688 sfr at 0xBA S0RELH ; // serial channel 0 reload register high byte SAB80517 specific
2689 #endif
2690
2691 #ifdef S1BUF
2692 #undef S1BUF
2693 sfr at 0x9C S1BUF ; // serial channel 1 buffer register SAB80517 specific
2694 #endif
2695
2696 #ifdef S1CON
2697 #undef S1CON
2698 sfr at 0x9B S1CON ; // serial channel 1 control register SAB80517 specific
2699 #endif
2700
2701 #ifdef S1RELL
2702 #undef S1RELL
2703 sfr at 0x9D S1RELL ; // serial channel 1 reload register low byte SAB80517 specific
2704 #endif
2705
2706 #ifdef S1RELH
2707 #undef S1RELH
2708 sfr at 0xBB S1RELH ; // serial channel 1 reload register high byte SAB80517 specific
2709 #endif
2710
2711 #ifdef SADDR0
2712 #undef SADDR0
2713 // DS80C320 specific
2714 sfr at 0xA9 SADDR0  ;
2715 #endif
2716
2717 #ifdef SADDR1
2718 #undef SADDR1
2719 // DS80C320 specific
2720 sfr at 0xAA SADDR1  ;
2721 #endif
2722
2723 #ifdef SADEN0
2724 #undef SADEN0
2725 // DS80C320 & DS80C390 specific
2726 sfr at 0xB9 SADEN0  ;
2727 #endif
2728
2729 #ifdef SADEN1
2730 #undef SADEN1
2731 // DS80C320 & DS80C390 specific
2732 sfr at 0xBA SADEN1  ;
2733 #endif
2734
2735 #ifdef SBUF
2736 #undef SBUF
2737 sfr at 0x99 SBUF ;
2738 sfr at 0x99 SBUF0 ;
2739 #endif
2740
2741 #ifdef SBUF1
2742 #undef SBUF1
2743 // DS80C320 & DS80C390 specific
2744 sfr at 0xC1 SBUF1 ;
2745 #endif
2746
2747 #ifdef SCON
2748 #undef SCON
2749 sfr at 0x98 SCON ;
2750 // Bit registers
2751 sbit at 0x98 RI   ;
2752 sbit at 0x99 TI   ;
2753 sbit at 0x9A RB8  ;
2754 sbit at 0x9B TB8  ;
2755 sbit at 0x9C REN  ;
2756 sbit at 0x9D SM2  ;
2757 sbit at 0x9E SM1  ;
2758 sbit at 0x9F SM0  ;
2759 #endif
2760
2761 #ifdef SCON0
2762 #undef SCON0
2763 sfr at 0x98 SCON0 ;
2764 // Bit registers
2765 sbit at 0x98 RI_0   ;
2766 sbit at 0x99 TI_0   ;
2767 sbit at 0x9A RB8_0  ;
2768 sbit at 0x9B TB8_0  ;
2769 sbit at 0x9C REN_0  ;
2770 sbit at 0x9D SM2_0  ;
2771 sbit at 0x9E SM1_0  ;
2772 sbit at 0x9F SM0_0  ;
2773 sbit at 0x9F FE_0   ;
2774 sbit at 0x9F SM0_FE_0  ;
2775 #endif
2776
2777 #ifdef SCON1
2778 #undef SCON1
2779 // DS80C320 - 80C390 specific
2780 sfr at 0xC0 SCON1  ;
2781 // Bit registers
2782 sbit at 0xC0 RI_1         ;
2783 sbit at 0xC1 TI_1         ;
2784 sbit at 0xC2 RB8_1        ;
2785 sbit at 0xC3 TB8_1        ;
2786 sbit at 0xC4 REN_1        ;
2787 sbit at 0xC5 SM2_1        ;
2788 sbit at 0xC6 SM1_1        ;
2789 sbit at 0xC7 SM0_1        ;
2790 sbit at 0xC7 FE_1         ;
2791 sbit at 0xC7 SM0_FE_1     ;
2792 #endif
2793
2794 #ifdef SP
2795 #undef SP
2796 sfr at 0x81 SP   ;
2797 #endif
2798
2799 #ifdef SPCR
2800 #undef SPCR
2801 sfr at 0xD5 SPCR   ;   // AT89S53 specific
2802 // Not directly accesible bits
2803 #define SPR0 0x01
2804 #define SPR1 0x02
2805 #define CPHA 0x04
2806 #define CPOL 0x08
2807 #define MSTR 0x10
2808 #define DORD 0x20
2809 #define SPE  0x40
2810 #define SPIE 0x80
2811 #endif
2812
2813 #ifdef SPDR
2814 #undef SPDR
2815 sfr at 0x86 SPDR   ;   // AT89S53 specific
2816 // Not directly accesible bits
2817 #define SPD_0 0x01
2818 #define SPD_1 0x02
2819 #define SPD_2 0x04
2820 #define SPD_3 0x08
2821 #define SPD_4 0x10
2822 #define SPD_5 0x20
2823 #define SPD_6 0x40
2824 #define SPD_7 0x80
2825 #endif
2826
2827 #ifdef SPSR
2828 #undef SPSR
2829 sfr at 0xAA SPSR   ;   // AT89S53 specific
2830 // Not directly accesible bits
2831 #define SPIF 0x40
2832 #define WCOL 0x80
2833 #endif
2834
2835 #ifdef SRELH
2836 #undef SRELH
2837 sfr at 0xBA SRELH       ; // Baudrate generator reload high
2838 #endif
2839
2840 #ifdef SRELL
2841 #undef SRELL
2842 sfr at 0xAA SRELL       ; // Baudrate generator reload low
2843 #endif
2844
2845 #ifdef STATUS__PIP__HIP__LIP__x__x__x__x__x
2846 #undef STATUS__PIP__HIP__LIP__x__x__x__x__x
2847 // DS80C320 specific
2848 sfr at 0xC5 STATUS ;
2849 // Not directly accessible Bits. DS80C320 specific
2850 #define LIP  0x20
2851 #define HIP  0x40
2852 #define PIP  0x80
2853 #endif
2854
2855 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
2856 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
2857 sfr at 0xC5 STATUS ; // DS80C390 specific
2858 // Not directly accessible Bits.
2859 #define SPRA0  0x01
2860 #define SPTA0  0x02
2861 #define SPRA1  0x04
2862 #define SPTA1  0x08
2863 #define LIP    0x20
2864 #define HIP    0x40
2865 #define PIP    0x80
2866 #endif
2867
2868 #ifdef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
2869 #undef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
2870 sfr at 0xC5 STATUS ; // DS87C520 & DS83520specific
2871 // Not directly accessible Bits.
2872 #define SPRA0  0x01
2873 #define SPTA0  0x02
2874 #define SPTA1  0x04
2875 #define SPTA2  0x08
2876 #define XTUP   0x10
2877 #define LIP    0x20
2878 #define HIP    0x40
2879 #define PIP    0x80
2880 #endif
2881
2882 #ifdef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
2883 #undef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
2884 sfr at 0xDA STATUS ; // DS5001specific
2885 // Not directly accessible Bits.
2886 #define OBF    0x01
2887 #define IBF    0x02
2888 #define F0     0x04
2889 #define IA0    0x08
2890 #define ST4    0x10
2891 #define ST5    0x20
2892 #define ST6    0x40
2893 #define ST7    0x80
2894 #endif
2895
2896 #ifdef SYSCON
2897 #undef SYSCON
2898 sfr at 0xB1 SYSCON      ; // XRAM Controller Access Control
2899 // SYSCON bits
2900 #define SYSCON_XMAP0    0x01
2901 #define SYSCON_XMAP1    0x02
2902 #define SYSCON_RMAP             0x10
2903 #define SYSCON_EALE             0x20
2904 #endif
2905
2906 #ifdef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
2907 #undef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
2908 sfr at 0xC8 T2CON ;
2909 // Definitions for the 8052 compatible microcontrollers.
2910 // Bit registers
2911 sbit at 0xC8 CP_RL2  ;
2912 sbit at 0xC9 C_T2    ;
2913 sbit at 0xCA TR2     ;
2914 sbit at 0xCB EXEN2   ;
2915 sbit at 0xCC TCLK    ;
2916 sbit at 0xCD RCLK    ;
2917 sbit at 0xCE EXF2    ;
2918 sbit at 0xCF TF2     ;
2919 // alternate names
2920 sbit at 0xC8 T2CON_0 ;
2921 sbit at 0xC9 T2CON_1 ;
2922 sbit at 0xCA T2CON_2 ;
2923 sbit at 0xCB T2CON_3 ;
2924 sbit at 0xCC T2CON_4 ;
2925 sbit at 0xCD T2CON_5 ;
2926 sbit at 0xCE T2CON_6 ;
2927 sbit at 0xCF T2CON_7 ;
2928 #endif
2929
2930 #ifdef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
2931 #undef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
2932 sfr at 0xC8 T2CON ;
2933 // Definitions for the Infineon / Siemens SAB80515, SAB80515A, SAB80517
2934 // Bit registers
2935 sbit at 0xC8 T2I0 ;
2936 sbit at 0xC9 T2I1 ;
2937 sbit at 0xCA T2CM ;
2938 sbit at 0xCB T2R0 ;
2939 sbit at 0xCC T2R1 ;
2940 sbit at 0xCD I2FR ;
2941 sbit at 0xCE I3FR ;
2942 sbit at 0xCF T2PS ;
2943 // alternate names
2944 sbit at 0xC8 T2CON_0 ;
2945 sbit at 0xC9 T2CON_1 ;
2946 sbit at 0xCA T2CON_2 ;
2947 sbit at 0xCB T2CON_3 ;
2948 sbit at 0xCC T2CON_4 ;
2949 sbit at 0xCD T2CON_5 ;
2950 sbit at 0xCE T2CON_6 ;
2951 sbit at 0xCF T2CON_7 ;
2952 #endif
2953
2954 #ifdef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
2955 #undef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
2956 // Definitions for the timer/counter 2 of the Atmel & Dallas microcontrollers
2957 sfr at 0xC9 T2MOD  ;
2958 // Not not directly accessible T2MOD bits
2959 #define DCEN            0x01
2960 #define T2OE            0x02
2961 #define D13T2           0x08
2962 #define D13T1           0x10
2963 #endif
2964
2965 #ifdef T2MOD__x__x__x__x__x__x__T2OE__DCEN
2966 #undef T2MOD__x__x__x__x__x__x__T2OE__DCEN
2967 // Definitions for the timer/counter 2 of the Atmel 89x52 microcontroller
2968 sfr at 0xC9 T2MOD  ;
2969 // Not not directly accessible T2MOD bits
2970 #define DCEN            0x01
2971 #define T2OE            0x02
2972 // Alternate names
2973 #define DCEN_           0x01
2974 #define T2OE_           0x02
2975 #endif
2976
2977 #ifdef TA
2978 #undef TA
2979 // DS500x, DS80C320 & DS80C390 specific
2980 sfr at 0xC7 TA ;
2981 #endif
2982
2983 #ifdef TCON
2984 #undef TCON
2985 sfr at 0x88 TCON ;
2986 //  Bit registers
2987 sbit at 0x88 IT0  ;
2988 sbit at 0x89 IE0  ;
2989 sbit at 0x8A IT1  ;
2990 sbit at 0x8B IE1  ;
2991 sbit at 0x8C TR0  ;
2992 sbit at 0x8D TF0  ;
2993 sbit at 0x8E TR1  ;
2994 sbit at 0x8F TF1  ;
2995 #endif
2996
2997 #ifdef TH0
2998 #undef TH0
2999 sfr at 0x8C TH0  ;
3000 #endif
3001
3002 #ifdef TH1
3003 #undef TH1
3004 sfr at 0x8D TH1  ;
3005 #endif
3006
3007 #ifdef TH2
3008 #undef TH2
3009 sfr at 0xCD TH2     ;
3010 #endif
3011
3012 #ifdef TL0
3013 #undef TL0
3014 sfr at 0x8A TL0  ;
3015 #endif
3016
3017 #ifdef TL1
3018 #undef TL1
3019 sfr at 0x8B TL1  ;
3020 #endif
3021
3022 #ifdef TL2
3023 #undef TL2
3024 sfr at 0xCC TL2     ;
3025 #endif
3026
3027 #ifdef TMOD
3028 #undef TMOD
3029 sfr at 0x89 TMOD ;
3030 // Not directly accessible TMOD bits
3031 #define T0_M0           0x01
3032 #define T0_M1           0x02
3033 #define T0_CT           0x04
3034 #define T0_GATE         0x08
3035 #define T1_M0           0x10
3036 #define T1_M1           0x20
3037 #define T1_CT           0x40
3038 #define T1_GATE         0x80
3039
3040 #define T0_MASK         0x0F
3041 #define T1_MASK         0xF0
3042 #endif
3043
3044 #ifdef WCON
3045 #undef WCON
3046 sfr at 0x96 WCON   ;   // AT89S53 specific
3047 // Not directly accesible bits
3048 #define WDTEN  0x01
3049 #define WDTRST 0x02
3050 #define DPS    0x04
3051 #define PS0    0x20
3052 #define PS1    0x40
3053 #define PS2    0x80
3054 #endif
3055
3056 #ifdef WDCON
3057 #undef WDCON
3058 // DS80C320 - 390 specific
3059 sfr at 0xD8 WDCON ;
3060 //  Bit registers
3061 sbit at 0xD8 RWT    ;
3062 sbit at 0xD9 EWT    ;
3063 sbit at 0xDA WTRF   ;
3064 sbit at 0xDB WDIF   ;
3065 sbit at 0xDC PFI    ;
3066 sbit at 0xDD EPFI   ;
3067 sbit at 0xDE POR    ;
3068 sbit at 0xDF SMOD_1 ;
3069 #endif
3070
3071 #ifdef WDTREL
3072 #undef WDTREL
3073 sfr at 0x86 WDTREL    ; // Watchdof Timer reload register
3074 #endif
3075
3076 #ifdef XPAGE
3077 #undef XPAGE
3078 sfr at 0x91 XPAGE     ; // Page Address Register for Extended On-Chip Ram - Infineon / Siemens SAB80515A specific
3079 #endif
3080
3081
3082 /////////////////////////
3083 /// Interrupt vectors ///
3084 /////////////////////////
3085
3086 // Interrupt numbers: address = (number * 8) + 3
3087 #define IE0_VECTOR      0       // 0x03 external interrupt 0
3088 #define TF0_VECTOR      1       // 0x0b timer 0
3089 #define IE1_VECTOR      2       // 0x13 external interrupt 1
3090 #define TF1_VECTOR      3       // 0x1b timer 1
3091 #define SI0_VECTOR      4       // 0x23 serial port 0
3092
3093 #ifdef MICROCONTROLLER_AT89S53
3094 #define TF2_VECTOR      5       /* 0x2B timer 2 */
3095 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
3096 #endif
3097
3098 #ifdef MICROCONTROLLER_AT89X52
3099 #define TF2_VECTOR      5       /* 0x2B timer 2 */
3100 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
3101 #endif
3102
3103 #ifdef MICROCONTROLLER_AT89X55
3104 #define TF2_VECTOR      5       /* 0x2B timer 2 */
3105 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
3106 #endif
3107
3108 #ifdef MICROCONTROLLER_DS5000
3109 #define PFW_VECTOR      5       /* 0x2B */
3110 #endif
3111
3112 #ifdef MICROCONTROLLER_DS5001
3113 #define PFW_VECTOR      5       /* 0x2B */
3114 #endif
3115
3116 #ifdef MICROCONTROLLER_DS80C32X
3117 #define TF2_VECTOR      5  /* 0x2B */
3118 #define PFI_VECTOR      6  /* 0x33 */
3119 #define SIO1_VECTOR     7  /* 0x3B */
3120 #define IE2_VECTOR      8  /* 0x43 */
3121 #define IE3_VECTOR      9  /* 0x4B */
3122 #define IE4_VECTOR      10 /* 0x53 */
3123 #define IE5_VECTOR      11 /* 0x5B */
3124 #define WDI_VECTOR      12 /* 0x63 */
3125 #endif
3126
3127 #ifdef MICROCONTROLLER_DS8XC520
3128 #define TF2_VECTOR      5  /* 0x2B */
3129 #define PFI_VECTOR      6  /* 0x33 */
3130 #define SIO1_VECTOR     7  /* 0x3B */
3131 #define IE2_VECTOR      8  /* 0x43 */
3132 #define IE3_VECTOR      9  /* 0x4B */
3133 #define IE4_VECTOR      10 /* 0x53 */
3134 #define IE5_VECTOR      11 /* 0x5B */
3135 #define WDI_VECTOR      12 /* 0x63 */
3136 #endif
3137
3138 #ifdef MICROCONTROLLER_SAB80515
3139 #define TF2_VECTOR      5       // 0x2B timer 2
3140 #define EX2_VECTOR      5       // 0x2B external interrupt 2
3141 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
3142 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
3143 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
3144 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
3145 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
3146 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
3147 #endif
3148
3149 #ifdef MICROCONTROLLER_SAB80515A
3150 #define TF2_VECTOR      5       // 0x2B timer 2
3151 #define EX2_VECTOR      5       // 0x2B external interrupt 2
3152 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
3153 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
3154 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
3155 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
3156 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
3157 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
3158 #endif
3159
3160 #ifdef MICROCONTROLLER_SAB80517
3161 #define TF2_VECTOR      5       // 0x2B timer 2
3162 #define EX2_VECTOR      5       // 0x2B external interrupt 2
3163 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
3164 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
3165 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
3166 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
3167 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
3168 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
3169                                 // 0x73 not used
3170                                 // 0x7B not used
3171 #define SI1_VECTOR     16       // 0x83 serial port 1
3172                                 // 0x8B not used
3173                                 // 0x93 not used
3174 #define COMPARE_VECTOR 19       // 0x9B compare
3175 #endif
3176
3177 #endif  // End of the header -> #ifndef MCS51REG_H