Multiple instances of #ifdef COC & C1M1C removed
[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 C0IR
1271 #undef C0IR
1272 sfr at 0xA5 C0IR        ; // DS80C390 specific
1273 // Not directly accessible bits
1274 #define INTIN0     0x01
1275 #define INTIN1     0x02
1276 #define INTIN2     0x04
1277 #define INTIN3     0x08
1278 #define INTIN4     0x10
1279 #define INTIN5     0x20
1280 #define INTIN6     0x40
1281 #define INTIN7     0x80
1282 #endif
1283
1284 #ifdef C0M1C
1285 #undef C0M1C
1286 sfr at 0xAB C0M1C       ; // DS80C390 specific
1287 // Not directly accessible bits
1288 #define DTUP     0x01
1289 #define ROW_TIH  0x02
1290 #define MTRQ     0x04
1291 #define EXTRQ    0x08
1292 #define INTRQ    0x10
1293 #define ERI      0x20
1294 #define ETI      0x40
1295 #define MSRDY    0x80
1296 #endif
1297
1298 #ifdef C0M2C
1299 #undef C0M2C
1300 sfr at 0xAC C0M2C       ; // DS80C390 specific
1301 #endif
1302
1303 #ifdef C0M3C
1304 #undef C0M3C
1305 sfr at 0xAD C0M3C       ; // DS80C390 specific
1306 #endif
1307
1308 #ifdef C0M4C
1309 #undef C0M4C
1310 sfr at 0xAE C0M4C       ; // DS80C390 specific
1311 #endif
1312
1313 #ifdef C0M5C
1314 #undef C0M5C
1315 sfr at 0xAF C0M5C       ; // DS80C390 specific
1316 #endif
1317
1318 #ifdef C0M6C
1319 #undef C0M6C
1320 sfr at 0xB3 C0M6C       ; // DS80C390 specific
1321 #endif
1322
1323 #ifdef C0M7C
1324 #undef C0M7C
1325 sfr at 0xB4 C0M7C       ; // DS80C390 specific
1326 #endif
1327
1328 #ifdef C0M8C
1329 #undef C0M8C
1330 sfr at 0xB5 C0M8C       ; // DS80C390 specific
1331 #endif
1332
1333 #ifdef C0M9C
1334 #undef C0M9C
1335 sfr at 0xB6 C0M9C       ; // DS80C390 specific
1336 #endif
1337
1338 #ifdef C0M10C
1339 #undef C0M10C
1340 sfr at 0xB7 C0M10C       ; // DS80C390 specific
1341 #endif
1342
1343 #ifdef C0M11C
1344 #undef C0M11C
1345 sfr at 0xBB C0M11C       ; // DS80C390 specific
1346 #endif
1347
1348 #ifdef C0M12C
1349 #undef C0M12C
1350 sfr at 0xBC C0M12C       ; // DS80C390 specific
1351 #endif
1352
1353 #ifdef C0M13C
1354 #undef C0M13C
1355 sfr at 0xBD C0M13C       ; // DS80C390 specific
1356 #endif
1357
1358 #ifdef C0M14C
1359 #undef C0M14C
1360 sfr at 0xBE C0M14C       ; // DS80C390 specific
1361 #endif
1362
1363 #ifdef C0M15C
1364 #undef C0M15C
1365 sfr at 0xBF C0M15C       ; // DS80C390 specific
1366 #endif
1367
1368 #ifdef C0RE
1369 #undef C0RE
1370 sfr at 0xA7 C0RE        ; // DS80C390 specific
1371 #endif
1372
1373 #ifdef C0RMS0
1374 #undef C0RMS0
1375 sfr at 0x96 C0RMS0      ; // DS80C390 specific
1376 #endif
1377
1378 #ifdef C0RMS1
1379 #undef C0RMS1
1380 sfr at 0x97 C0RMS1      ; // DS80C390 specific
1381 #endif
1382
1383 #ifdef C0S
1384 #undef C0S
1385 sfr at 0xA4 C0S         ; // DS80C390 specific
1386 // Not directly accessible bits
1387 #define ER0     0x01
1388 #define ER1     0x02
1389 #define ER2     0x04
1390 #define TXS     0x08
1391 #define RXS     0x10
1392 #define WKS     0x20
1393 #define EC96_128    0x40
1394 #define BSS     0x80
1395 #endif
1396
1397 #ifdef C0TE
1398 #undef C0TE
1399 sfr at 0xA6 C0TE        ; // DS80C390 specific
1400 #endif
1401
1402 #ifdef C0TMA0
1403 #undef C0TMA0
1404 sfr at 0x9E C0TMA0      ; // DS80C390 specific
1405 #endif
1406
1407 #ifdef C0TMA1
1408 #undef C0TMA1
1409 sfr at 0x9F C0TMA1      ; // DS80C390 specific
1410 #endif
1411
1412 #ifdef C1C
1413 #undef C1C
1414 sfr at 0xE3 C1C         ; // DS80C390 specific
1415 // Not directly accessible bits
1416 #define SWINT   0x01
1417 #define ERCS    0x02
1418 #define AUTOB   0x04
1419 #define CRST    0x08
1420 #define SIESTA  0x10
1421 #define PDE     0x20
1422 #define STIE    0x40
1423 #define ERIE    0x80
1424 #endif
1425
1426 #ifdef C1IR
1427 #undef C1IR
1428 sfr at 0xE5 C1IR         ; // DS80C390 specific
1429 // Not directly accessible bits
1430 #define INTIN0  0x01
1431 #define INTIN1  0x02
1432 #define INTIN2  0x04
1433 #define INTIN3  0x08
1434 #define INTIN4  0x10
1435 #define INTIN5  0x20
1436 #define INTIN6  0x40
1437 #define INTIN7  0x80
1438 #endif
1439
1440 #ifdef C1IRE
1441 #undef C1IRE
1442 sfr at 0xE7 C1RE         ; // DS80C390 specific
1443 #endif
1444
1445 #ifdef C1M1C
1446 #undef C1M1C
1447 sfr at 0xEB C1M1C        ; // DS80C390 specific
1448 #endif
1449
1450 #ifdef C1M2C
1451 #undef C1M2C
1452 sfr at 0xEC C1M2C        ; // DS80C390 specific
1453 #endif
1454
1455 #ifdef C1M3C
1456 #undef C1M3C
1457 sfr at 0xED C1M3C        ; // DS80C390 specific
1458 #endif
1459
1460 #ifdef C1M4C
1461 #undef C1M4C
1462 sfr at 0xEE C1M4C        ; // DS80C390 specific
1463 #endif
1464
1465 #ifdef C1M5C
1466 #undef C1M5C
1467 sfr at 0xEF C1M5C        ; // DS80C390 specific
1468 #endif
1469
1470 #ifdef C1M6C
1471 #undef C1M6C
1472 sfr at 0xF3 C1M6C        ; // DS80C390 specific
1473 #endif
1474
1475 #ifdef C1M7C
1476 #undef C1M7C
1477 sfr at 0xF4 C1M7C        ; // DS80C390 specific
1478 #endif
1479
1480 #ifdef C1M8C
1481 #undef C1M8C
1482 sfr at 0xF5 C1M8C        ; // DS80C390 specific
1483 #endif
1484
1485 #ifdef C1M9C
1486 #undef C1M9C
1487 sfr at 0xF6 C1M9C        ; // DS80C390 specific
1488 #endif
1489
1490 #ifdef C1M10C
1491 #undef C1M10C
1492 sfr at 0xF7 C1M10C       ; // DS80C390 specific
1493 #endif
1494
1495 #ifdef C1M11C
1496 #undef C1M11C
1497 sfr at 0xFB C1M11C       ; // DS80C390 specific
1498 #endif
1499
1500 #ifdef C1M12C
1501 #undef C1M12C
1502 sfr at 0xFC C1M12C       ; // DS80C390 specific
1503 #endif
1504
1505 #ifdef C1M13C
1506 #undef C1M13C
1507 sfr at 0xFD C1M13C        ; // DS80C390 specific
1508 #endif
1509
1510 #ifdef C1M14C
1511 #undef C1M14C
1512 sfr at 0xFE C1M14C        ; // DS80C390 specific
1513 #endif
1514
1515 #ifdef C1M15C
1516 #undef C1M15C
1517 sfr at 0xFF C1M15C        ; // DS80C390 specific
1518 #endif
1519
1520 #ifdef C1S
1521 #undef C1S
1522 sfr at 0xE4 C1S          ; // DS80C390 specific
1523 // Not directly accessible bits
1524 #define ER0     0x01
1525 #define ER1     0x02
1526 #define ER2     0x04
1527 #define TXS     0x08
1528 #define RXS     0x10
1529 #define WKS     0x20
1530 #define CECE    0x40
1531 #define BSS     0x80
1532 #endif
1533
1534 #ifdef C1ITE
1535 #undef C1ITE
1536 sfr at 0xE6 C1TE         ; // DS80C390 specific
1537 #endif
1538
1539 #ifdef C1RSM0
1540 #undef C1RSM0
1541 sfr at 0xD6 C1RSM0      ; // DS80C390 specific
1542 #endif
1543
1544 #ifdef C1RSM1
1545 #undef C1RSM1
1546 sfr at 0xD7 C1RSM1      ; // DS80C390 specific
1547 #endif
1548
1549 #ifdef C1TMA0
1550 #undef C1TMA0
1551 sfr at 0xDE C1TMA0      ; // DS80C390 specific
1552 #endif
1553
1554 #ifdef C1TMA1
1555 #undef C1TMA1
1556 sfr at 0xDF C1TMA1      ; // DS80C390 specific
1557 #endif
1558
1559 #ifdef CC4EN
1560 #undef CC4EN
1561 sfr at 0xC9 CC4EN       ; // compare/capture 4 enable register SAB80517 specific
1562 #endif
1563
1564 #ifdef CCEN
1565 #undef CCEN
1566 sfr at 0xC1 CCEN        ; // compare/capture enable register SAB80515 specific
1567 #endif
1568
1569 #ifdef CCH1
1570 #undef CCH1
1571 sfr at 0xC3 CCH1        ; // compare/capture register 1, high byte SAB80515 specific
1572 #endif
1573
1574 #ifdef CCH2
1575 #undef CCH2
1576 sfr at 0xC5 CCH2        ; // compare/capture register 2, high byte SAB80515 specific
1577 #endif
1578
1579 #ifdef CCH3
1580 #undef CCH3
1581 sfr at 0xC7 CCH3        ; // compare/capture register 3, high byte SAB80515 specific
1582 #endif
1583
1584 #ifdef CCH4
1585 #undef CCH4
1586 sfr at 0xCF CCH4        ; // compare/capture register 4, high byte SAB80515 specific
1587 #endif
1588
1589 #ifdef CCL1
1590 #undef CCL1
1591 sfr at 0xC2 CCL1        ; // compare/capture register 1, low byte SAB80515 specific
1592 #endif
1593
1594 #ifdef CCL2
1595 #undef CCL2
1596 sfr at 0xC4 CCL2        ; // compare/capture register 2, low byte SAB80515 specific
1597 #endif
1598
1599 #ifdef CCL3
1600 #undef CCL3
1601 sfr at 0xC6 CCL3        ; // compare/capture register 3, low byte SAB80515 specific
1602 #endif
1603
1604 #ifdef CCL4
1605 #undef CCL4
1606 sfr at 0xCE CCL4        ; // compare/capture register 4, low byte SAB80515 specific
1607 #endif
1608
1609 #ifdef CKCON
1610 #undef CKCON
1611 sfr at 0x8E CKCON       ; // DS80C320 & DS80C390 specific
1612 // Not directly accessible Bits.
1613 #define MD0    0x01
1614 #define MD1    0x02
1615 #define MD2    0x04
1616 #define T0M    0x08
1617 #define T1M    0x10
1618 #define T2M    0x20
1619 #define WD0    0x40
1620 #define WD1    0x80
1621 #endif
1622
1623 #ifdef CKMOD
1624 #undef CKMOD
1625 sfr at 0x96 CKMOD       ; // DS89C420 specific
1626 // Not directly accessible Bits.
1627 #define T0MH   0x08
1628 #define T1MH   0x10
1629 #define T2MH   0x20
1630 #endif
1631
1632 #ifdef CMEN
1633 #undef CMEN
1634 sfr at 0xF6 CMEN    ; // compare enable register SAB80517 specific
1635 #endif
1636
1637 #ifdef CMH0
1638 #undef CMH0
1639 sfr at 0xD3 CMH0    ; // compare register 0 high byte SAB80517 specific
1640 #endif
1641
1642 #ifdef CMH1
1643 #undef CMH1
1644 sfr at 0xD5 CMH1    ; // compare register 1 high byte SAB80517 specific
1645 #endif
1646
1647 #ifdef CMH2
1648 #undef CMH2
1649 sfr at 0xD7 CMH2    ; // compare register 2 high byte SAB80517 specific
1650 #endif
1651
1652 #ifdef CMH3
1653 #undef CMH3
1654 sfr at 0xE3 CMH3    ; // compare register 3 high byte SAB80517 specific
1655 #endif
1656
1657 #ifdef CMH4
1658 #undef CMH4
1659 sfr at 0xE5 CMH4    ; // compare register 4 high byte SAB80517 specific
1660 #endif
1661
1662 #ifdef CMH5
1663 #undef CMH5
1664 sfr at 0xE7 CMH5    ; // compare register 5 high byte SAB80517 specific
1665 #endif
1666
1667 #ifdef CMH6
1668 #undef CMH6
1669 sfr at 0xF3 CMH6    ; // compare register 6 high byte SAB80517 specific
1670 #endif
1671
1672 #ifdef CMH7
1673 #undef CMH7
1674 sfr at 0xF5 CMH7    ; // compare register 7 high byte SAB80517 specific
1675 #endif
1676
1677 #ifdef CML0
1678 #undef CML0
1679 sfr at 0xD2 CML0    ; // compare register 0 low byte SAB80517 specific
1680 #endif
1681
1682 #ifdef CML1
1683 #undef CML1
1684 sfr at 0xD4 CML1    ; // compare register 1 low byte SAB80517 specific
1685 #endif
1686
1687 #ifdef CML2
1688 #undef CML2
1689 sfr at 0xD6 CML2    ; // compare register 2 low byte SAB80517 specific
1690 #endif
1691
1692 #ifdef CML3
1693 #undef CML3
1694 sfr at 0xE2 CML3    ; // compare register 3 low byte SAB80517 specific
1695 #endif
1696
1697 #ifdef CML4
1698 #undef CML4
1699 sfr at 0xE4 CML4    ; // compare register 4 low byte SAB80517 specific
1700 #endif
1701
1702 #ifdef CML5
1703 #undef CML5
1704 sfr at 0xE6 CML5    ; // compare register 5 low byte SAB80517 specific
1705 #endif
1706
1707 #ifdef CML6
1708 #undef CML6
1709 sfr at 0xF2 CML6    ; // compare register 6 low byte SAB80517 specific
1710 #endif
1711
1712 #ifdef CML7
1713 #undef CML7
1714 sfr at 0xF4 CML7    ; // compare register 7 low byte SAB80517 specific
1715 #endif
1716
1717 #ifdef CMSEL
1718 #undef CMSEL
1719 sfr at 0xF7 CMSEL   ; // compare input select SAB80517
1720 #endif
1721
1722 #ifdef COR
1723 #undef COR
1724 sfr at 0xCE COR     ; // Dallas DS80C390 specific
1725 #define CLKOE       0x01
1726 #define COD0        0x02
1727 #define COD1        0x04
1728 #define C0BPR6      0x08
1729 #define C0BPR7      0x10
1730 #define C1BPR6      0x20
1731 #define C1BPR7      0x40
1732 #define IRDACK      0x80
1733 #endif
1734
1735 #ifdef CRC
1736 #undef CRC
1737 sfr at 0xC1 CRC     ; // Dallas DS5001 specific
1738 #define CRC_        0x01
1739 #define MDM         0x02
1740 #define RNGE0       0x10
1741 #define RNGE1       0x20
1742 #define RNGE2       0x40
1743 #define RNGE3       0x80
1744 #endif
1745
1746 #ifdef CRCH
1747 #undef CRCH
1748 sfr at 0xCB CRCH    ; // compare/reload/capture register, high byte SAB80515 specific
1749 #endif
1750
1751 #ifdef CRCHIGH
1752 #undef CRCHIGH
1753 sfr at 0xC3 CRCHIGH ; // DS5001 specific
1754 #endif
1755
1756 #ifdef CRCL
1757 #undef CRCL
1758 sfr at 0xCA CRCL    ; // compare/reload/capture register, low byte SAB80515 specific
1759 #endif
1760
1761 #ifdef CRCLOW
1762 #undef CRCLOW
1763 sfr at 0xC2 CRCLOW  ; // DS5001 specific
1764 #endif
1765
1766 #ifdef CTCON
1767 #undef CTCON
1768 sfr at 0xE1 CTCON    ; // com.timer control register SAB80517
1769 #endif
1770
1771 #ifdef CTRELH
1772 #undef CTRELH
1773 sfr at 0xDF CTRELH  ; // com.timer rel register high byte SAB80517
1774 #endif
1775
1776 #ifdef CTRELL
1777 #undef CTRELL
1778 sfr at 0xDE CTRELL  ; // com.timer rel register low byte SAB80517
1779 #endif
1780
1781 #ifdef DAPR__SAB80515
1782 #undef DAPR__SAB80515
1783 sfr at 0xD8 DAPR    ; // D/A-converter program register SAB80515 specific
1784 #endif
1785
1786 #ifdef DAPR__SAB80517
1787 #undef DAPR__SAB80517
1788 sfr at 0xDA DAPR    ; // D/A-converter program register SAB80517 specific
1789 #endif
1790
1791 #ifdef DPH
1792 #undef DPH
1793 sfr at 0x83 DPH  ;
1794 sfr at 0x83 DP0H ;  // Alternate name for AT89S53
1795 #endif
1796
1797 #ifdef DPH1
1798 #undef DPH1
1799 sfr at 0x85 DPH1  ; // DS80C320 specific
1800 sfr at 0x85 DP1H  ; // Alternate name for AT89S53
1801 #endif
1802
1803 #ifdef DPL
1804 #undef DPL
1805 sfr at 0x82 DPL  ;  // Alternate name for AT89S53
1806 sfr at 0x82 DP0L ;
1807 #endif
1808
1809 #ifdef DPL1
1810 #undef DPL1
1811 sfr at 0x84 DPL1  ; // DS80C320 specific
1812 sfr at 0x84 DP1L  ; // Alternate name for AT89S53
1813 #endif
1814
1815 #ifdef DPS__x__x__x__x__x__x__x__SEL
1816 #undef DPS__x__x__x__x__x__x__x__SEL
1817 sfr at 0x86 DPS  ;
1818 // Not directly accessible DPS Bit. DS80C320 & DPS8XC520 specific
1819 #define SEL    0x01
1820 #endif
1821
1822 #ifdef DPS__ID1__ID0__TSL__x__x__x__x__SEL
1823 #undef DPS__ID1__ID0__TSL__x__x__x__x__SEL
1824 sfr at 0x86 DPS  ;
1825 // Not directly accessible DPS Bit. DS89C390 specific
1826 #define SEL    0x01
1827 #define TSL    0x20
1828 #define ID0    0x40
1829 #define ID1    0x80
1830 #endif
1831
1832 #ifdef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
1833 #undef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
1834 sfr at 0x86 DPS  ;
1835 // Not directly accessible DPS Bit. DS89C420 specific
1836 #define SEL    0x01
1837 #define AID    0x10
1838 #define TSL    0x20
1839 #define ID0    0x40
1840 #define ID1    0x80
1841 #endif
1842
1843 #ifdef DPSEL
1844 #undef DPSEL
1845 sfr at 0x92 DPSEL   ; // data pointer select register SAB80517
1846 #endif
1847
1848 #ifdef DPX
1849 #undef DPX
1850 sfr at 0x93 DPX1  ; // DS80C390 specific
1851 #endif
1852
1853 #ifdef DPX1
1854 #undef DPX1
1855 sfr at 0x95 DPX1  ; // DS80C390 specific
1856 #endif
1857
1858 #ifdef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
1859 #undef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
1860 sfr at 0xE8 EIE  ;
1861 // Bit registers DS80C320 specific
1862 sbit at 0xE8 EX2    ;
1863 sbit at 0xE9 EX3    ;
1864 sbit at 0xEA EX4    ;
1865 sbit at 0xEB EX5    ;
1866 sbit at 0xEC EWDI   ;
1867 #endif
1868
1869 #ifdef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
1870 #undef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
1871 sfr at 0xE8 EIE  ;
1872 // Bit registers DS80C390 specific
1873 sbit at 0xE8 EX2    ;
1874 sbit at 0xE9 EX3    ;
1875 sbit at 0xEA EX4    ;
1876 sbit at 0xEB EX5    ;
1877 sbit at 0xEC EWDI   ;
1878 sbit at 0xED C1IE   ;
1879 sbit at 0xEE C0IE   ;
1880 sbit at 0xEF CANBIE ;
1881 #endif
1882
1883 #ifdef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1884 #undef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1885 sfr at 0xF8 EIP  ;
1886 // Bit registers DS80C320 specific
1887 sbit at 0xF8 PX2    ;
1888 sbit at 0xF9 PX3    ;
1889 sbit at 0xFA PX4    ;
1890 sbit at 0xFB PX5    ;
1891 sbit at 0xFC PWDI   ;
1892 #endif
1893
1894 #ifdef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1895 #undef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
1896 sfr at 0xF8 EIP  ;
1897 // Bit registers DS80C320 specific
1898 sbit at 0xF8 PX2    ;
1899 sbit at 0xF9 PX3    ;
1900 sbit at 0xFA PX4    ;
1901 sbit at 0xFB PX5    ;
1902 sbit at 0xFC PWDI   ;
1903 sbit at 0xFD C1IP   ;
1904 sbit at 0xFE C0IP   ;
1905 sbit at 0xFF CANBIP ;
1906 #endif
1907
1908 #ifdef ESP
1909 #undef ESP
1910 sfr at 0x9B ESP  ;
1911 // Not directly accessible Bits DS80C390 specific
1912 #define ESP_0   0x01
1913 #define ESP_1   0x02
1914 #endif
1915
1916 #ifdef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
1917 #undef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
1918 sfr at 0x91 EXIF  ;
1919 // Not directly accessible EXIF Bits DS80C320 specific
1920 #define BGS    0x01
1921 #define RGSL   0x02
1922 #define RGMD   0x04
1923 #define IE2    0x10
1924 #define IE3    0x20
1925 #define IE4    0x40
1926 #define IE5    0x80
1927 #endif
1928
1929 #ifdef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
1930 #undef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
1931 sfr at 0x91 EXIF  ;
1932 // Not directly accessible EXIF Bits DS87C520 specific
1933 #define BGS    0x01
1934 #define RGSL   0x02
1935 #define RGMD   0x04
1936 #define XT_RG  0x08
1937 #define IE2    0x10
1938 #define IE3    0x20
1939 #define IE4    0x40
1940 #define IE5    0x80
1941 #endif
1942
1943 #ifdef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
1944 #undef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
1945 sfr at 0x91 EXIF  ;
1946 // Not directly accessible EXIF Bits DS80C390 & DS89C420 specific
1947 #define BGS    0x01
1948 #define RGSL   0x02
1949 #define RGMD   0x04
1950 #define CKRY   0x08
1951 #define IE2    0x10
1952 #define IE3    0x20
1953 #define IE4    0x40
1954 #define IE5    0x80
1955 #endif
1956
1957 #ifdef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1958 #undef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1959 sfr at 0xA8 IE   ;
1960 // Bit registers
1961 sbit at 0xA8 EX0  ;
1962 sbit at 0xA9 ET0  ;
1963 sbit at 0xAA EX1  ;
1964 sbit at 0xAB ET1  ;
1965 sbit at 0xAC ES   ;
1966 sbit at 0xAF EA   ;
1967 #endif
1968
1969 #ifdef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
1970 #undef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
1971 sfr at 0xA8 IE   ;
1972 // Bit registers
1973 sbit at 0xA8 EX0  ;
1974 sbit at 0xA9 ET0  ;
1975 sbit at 0xAA EX1  ;
1976 sbit at 0xAB ET1  ;
1977 sbit at 0xAC ES   ;
1978 sbit at 0xAD ET2  ; // Enable timer2 interrupt
1979 sbit at 0xAF EA   ;
1980 #endif // IE
1981
1982 #ifdef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
1983 #undef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
1984 sfr at 0xA8 IE   ;
1985 // Bit registers
1986 sbit at 0xA8 EX0  ;
1987 sbit at 0xA9 ET0  ;
1988 sbit at 0xAA EX1  ;
1989 sbit at 0xAB ET1  ;
1990 sbit at 0xAC ES   ;
1991 sbit at 0xAC ES0  ; // Alternate name
1992 sbit at 0xAD ET2  ; // Enable timer2 interrupt
1993 sbit at 0xAE ES1  ;
1994 sbit at 0xAF EA   ;
1995 #endif // IE
1996
1997 #ifdef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1998 #undef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1999 sfr at 0xA8 IE    ;
2000 sfr at 0xA8 IEN0  ; // Alternate name
2001 // Bit registers for the SAB80515 and compatible IE
2002 sbit at 0xA8 EX0  ;
2003 sbit at 0xA9 ET0  ;
2004 sbit at 0xAA EX1  ;
2005 sbit at 0xAB ET1  ;
2006 sbit at 0xAC ES   ;
2007 sbit at 0xAC ES0  ;
2008 sbit at 0xAD ET2  ; // Enable timer 2 overflow SAB80515 specific
2009 sbit at 0xAE WDT  ; // watchdog timer reset - SAB80515 specific
2010 sbit at 0xAF EA   ;
2011 sbit at 0xAF EAL  ; // EA as called by Infineon / Siemens
2012 #endif
2013
2014 #ifdef IEN1
2015 #undef IEN1
2016 sfr at 0xB8 IEN1        ; // interrupt enable register - SAB80515 specific
2017 // Bit registers
2018 sbit at 0xB8 EADC       ; // A/D converter interrupt enable
2019 sbit at 0xB9 EX2        ;
2020 sbit at 0xBA EX3        ;
2021 sbit at 0xBB EX4        ;
2022 sbit at 0xBC EX5        ;
2023 sbit at 0xBD EX6        ;
2024 sbit at 0xBE SWDT       ; // watchdog timer start/reset
2025 sbit at 0xBF EXEN2      ; // timer2 external reload interrupt enable
2026 #endif
2027
2028 #ifdef IEN2__SAB80517
2029 #undef IEN2__SAB80517
2030 sfr at 0x9A IEN2        ; // interrupt enable register 2 SAB80517
2031 #endif
2032
2033 #ifdef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2034 #undef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2035 sfr at 0xB8 IP   ;
2036 // Bit registers
2037 sbit at 0xB8 PX0  ;
2038 sbit at 0xB9 PT0  ;
2039 sbit at 0xBA PX1  ;
2040 sbit at 0xBB PT1  ;
2041 sbit at 0xBC PS   ;
2042 #endif
2043
2044 #ifdef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2045 #undef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2046 sfr at 0xB8 IP    ;
2047 // Bit registers
2048 sbit at 0xB8 PX0  ;
2049 sbit at 0xB9 PT0  ;
2050 sbit at 0xBA PX1  ;
2051 sbit at 0xBB PT1  ;
2052 sbit at 0xBC PS   ;
2053 sbit at 0xBC PS0  ;  // alternate name
2054 sbit at 0xBD PT2  ;
2055 #endif
2056
2057 #ifdef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2058 #undef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2059 sfr at 0xB8 IP   ;
2060 // Bit registers
2061 sbit at 0xB8 PX0  ;
2062 sbit at 0xB9 PT0  ;
2063 sbit at 0xBA PX1  ;
2064 sbit at 0xBB PT1  ;
2065 sbit at 0xBC PS   ;
2066 sbit at 0xBD PT2  ;
2067 sbit at 0xBE PS1  ;
2068 #endif
2069
2070 #ifdef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2071 #undef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2072 sfr at 0xB8 IP   ;
2073 // Bit registers
2074 sbit at 0xB8 PX0  ;
2075 sbit at 0xB9 PT0  ;
2076 sbit at 0xBA PX1  ;
2077 sbit at 0xBB PT1  ;
2078 sbit at 0xBC PS   ;
2079 sbit at 0xBF RWT  ;
2080 #endif
2081
2082 #ifdef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2083 #undef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2084 sfr at 0xA9 IP0   ; // interrupt priority register SAB80515 specific
2085 // Not directly accessible IP0 bits
2086 #define IP0_0    0x01
2087 #define IP0_1    0x02
2088 #define IP0_2    0x04
2089 #define IP0_3    0x08
2090 #define IP0_4    0x10
2091 #define IP0_5    0x20
2092 #define WDTS     0x40
2093 #endif
2094
2095 #ifdef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2096 #undef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2097 sfr at 0xB8 IP0   ; // interrupt priority register DS89C420 specific
2098 // Not directly accessible IP0 bits
2099 #define LPX0    0x01
2100 #define LPT0    0x02
2101 #define LPX1    0x04
2102 #define LPT1    0x08
2103 #define LPS0    0x10
2104 #define LPT2    0x20
2105 #define LPS1    0x40
2106 #endif
2107
2108 #ifdef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2109 #undef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2110 sfr at 0xB9 IP1   ; // interrupt priority register SAB80515 specific
2111 // Not directly accessible IP1 bits
2112 #define IP1_0    0x01
2113 #define IP1_1    0x02
2114 #define IP1_2    0x04
2115 #define IP1_3    0x08
2116 #define IP1_4    0x10
2117 #define IP1_5    0x20
2118 #endif
2119
2120 #ifdef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2121 #undef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2122 sfr at 0xB1 IP1   ; // interrupt priority register DS89C420 specific
2123 // Not directly accessible IP0 bits
2124 #define LPX0    0x01
2125 #define LPT0    0x02
2126 #define LPX1    0x04
2127 #define LPT1    0x08
2128 #define LPS0    0x10
2129 #define LPT2    0x20
2130 #define LPS1    0x40
2131 #endif
2132
2133 #ifdef IRCON
2134 #undef IRCON
2135 sfr at 0xC0 IRCON       ; // interrupt control register - SAB80515 specific
2136 // Bit registers
2137 sbit at 0xC0 IADC       ; // A/D converter irq flag
2138 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2139 sbit at 0xC2 IEX3       ;
2140 sbit at 0xC3 IEX4       ;
2141 sbit at 0xC4 IEX5       ;
2142 sbit at 0xC5 IEX6       ;
2143 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2144 sbit at 0xC7 EXF2       ; // timer2 reload flag
2145 #endif
2146
2147 #ifdef IRCON0
2148 #undef IRCON0
2149 sfr at 0xC0 IRCON0       ; // interrupt control register - SAB80515 specific
2150 // Bit registers
2151 sbit at 0xC0 IADC       ; // A/D converter irq flag
2152 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2153 sbit at 0xC2 IEX3       ;
2154 sbit at 0xC3 IEX4       ;
2155 sbit at 0xC4 IEX5       ;
2156 sbit at 0xC5 IEX6       ;
2157 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2158 sbit at 0xC7 EXF2       ; // timer2 reload flag
2159 #endif
2160
2161 #ifdef IRCON1
2162 #undef IRCON1
2163 sfr at 0xD1 IRCON1      ; // interrupt control register - SAB80515 specific
2164 #endif
2165
2166 #ifdef MA
2167 #undef MA
2168 sfr at 0xD3 MA          ; // DS80C390
2169 #endif
2170
2171 #ifdef MB
2172 #undef MB
2173 sfr at 0xD4 MB          ; // DS80C390
2174 #endif
2175
2176 #ifdef MC
2177 #undef MC
2178 sfr at 0xD5 MC          ; // DS80C390
2179 #endif
2180
2181 #ifdef MCNT0
2182 #undef MCNT0
2183 sfr at 0xD1 MCNT0       ; // DS80C390
2184 #define MAS0     0x01
2185 #define MAS1     0x02
2186 #define MAS2     0x04
2187 #define MAS3     0x08
2188 #define MAS4     0x10
2189 #define SCB      0x20
2190 #define CSE      0x40
2191 #define LSHIFT   0x80
2192 #endif
2193
2194 #ifdef MCNT1
2195 #undef MCNT1
2196 sfr at 0xD2 MCNT1       ; // DS80C390
2197 #define CLM      0x10
2198 #define MOF      0x40
2199 #define MST      0x80
2200 #endif
2201
2202 #ifdef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2203 #undef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2204 sfr at 0xC6 MCON        ; // DS80C390
2205 #define PDCE0    0x01
2206 #define PDCE1    0x02
2207 #define PDCE2    0x04
2208 #define PDCE3    0x08
2209 #define CMA      0x20
2210 #define IDM0     0x40
2211 #define IDM1     0x80
2212 #endif
2213
2214 #ifdef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2215 #undef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2216 sfr at 0xC6 MCON        ; // DS5000
2217 #define SL       0x01
2218 #define PAA      0x02
2219 #define ECE2     0x04
2220 #define RA32_8   0x08
2221 #define PA0      0x10
2222 #define PA1      0x20
2223 #define PA2      0x40
2224 #define PA3      0x80
2225 #endif
2226
2227 #ifdef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
2228 #undef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
2229 sfr at 0xC6 MCON        ; // DS5001
2230 #define SL       0x01
2231 #define PM       0x02
2232 #define PES      0x04
2233 #define RG1      0x08
2234 #define PA0      0x10
2235 #define PA1      0x20
2236 #define PA2      0x40
2237 #define PA3      0x80
2238 #endif
2239
2240 #ifdef MD0
2241 #undef MD0
2242 sfr at 0xE9 MD0         ; // MUL / DIV register 0 SAB80517
2243 #endif
2244
2245 #ifdef MD1
2246 #undef MD1
2247 sfr at 0xEA MD1         ; // MUL / DIV register 1 SAB80517
2248 #endif
2249
2250 #ifdef MD2
2251 #undef MD2
2252 sfr at 0xEB MD2         ; // MUL / DIV register 2 SAB80517
2253 #endif
2254
2255 #ifdef MD3
2256 #undef MD3
2257 sfr at 0xEC MD3         ; // MUL / DIV register 3 SAB80517
2258 #endif
2259
2260 #ifdef MD4
2261 #undef MD4
2262 sfr at 0xED MD4         ; // MUL / DIV register 4 SAB80517
2263 #endif
2264
2265 #ifdef MD5
2266 #undef MD5
2267 sfr at 0xEE MD5         ; // MUL / DIV register 5 SAB80517
2268 #endif
2269
2270 #ifdef MXAX
2271 #undef MXAX
2272 sfr at 0xEA MXAX        ; // Dallas DS80C390
2273 #endif
2274
2275 #ifdef P0
2276 #undef P0
2277 sfr at 0x80 P0   ;
2278 //  Bit Registers
2279 sbit at 0x80 P0_0 ;
2280 sbit at 0x81 P0_1 ;
2281 sbit at 0x82 P0_2 ;
2282 sbit at 0x83 P0_3 ;
2283 sbit at 0x84 P0_4 ;
2284 sbit at 0x85 P0_5 ;
2285 sbit at 0x86 P0_6 ;
2286 sbit at 0x87 P0_7 ;
2287 #endif
2288
2289 #ifdef P1
2290 #undef P1
2291 sfr at 0x90 P1   ;
2292 // Bit registers
2293 sbit at 0x90 P1_0 ;
2294 sbit at 0x91 P1_1 ;
2295 sbit at 0x92 P1_2 ;
2296 sbit at 0x93 P1_3 ;
2297 sbit at 0x94 P1_4 ;
2298 sbit at 0x95 P1_5 ;
2299 sbit at 0x96 P1_6 ;
2300 sbit at 0x97 P1_7 ;
2301 #endif
2302
2303 #ifdef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
2304 #undef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
2305 // P1 alternate functions
2306 sbit at 0x90 T2   ;
2307 sbit at 0x91 T2EX ;
2308 sbit at 0x92 RXD1 ;
2309 sbit at 0x93 TXD1 ;
2310 sbit at 0x94 INT2 ;
2311 sbit at 0x95 INT3 ;
2312 sbit at 0x96 INT4 ;
2313 sbit at 0x97 INT5 ;
2314 #endif
2315
2316 #ifdef P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
2317 sbit at 0x90 INT3_CC0   ; // P1 alternate functions - SAB80515 specific
2318 sbit at 0x91 INT4_CC1   ;
2319 sbit at 0x92 INT5_CC2   ;
2320 sbit at 0x93 INT6_CC3   ;
2321 sbit at 0x94 INT2       ;
2322 sbit at 0x95 T2EX       ;
2323 sbit at 0x96 CLKOUT     ;
2324 sbit at 0x97 T2         ;
2325 #endif
2326
2327 #ifdef P1_EXT__x__x__x__x__x__x__T2EX__T2
2328 #undef P1_EXT__x__x__x__x__x__x__T2EX__T2
2329 // P1 alternate functions
2330 sbit at 0x90 T2         ;
2331 sbit at 0x91 T2EX       ;
2332 #endif
2333
2334 #ifdef P2
2335 #undef P2
2336 sfr at 0xA0 P2   ;
2337 // Bit registers
2338 sbit at 0xA0 P2_0 ;
2339 sbit at 0xA1 P2_1 ;
2340 sbit at 0xA2 P2_2 ;
2341 sbit at 0xA3 P2_3 ;
2342 sbit at 0xA4 P2_4 ;
2343 sbit at 0xA5 P2_5 ;
2344 sbit at 0xA6 P2_6 ;
2345 sbit at 0xA7 P2_7 ;
2346 #endif
2347
2348 #ifdef P3
2349 #undef P3
2350 sfr at 0xB0 P3   ;
2351 // Bit registers
2352 sbit at 0xB0 P3_0 ;
2353 sbit at 0xB1 P3_1 ;
2354 sbit at 0xB2 P3_2 ;
2355 sbit at 0xB3 P3_3 ;
2356 sbit at 0xB4 P3_4 ;
2357 sbit at 0xB5 P3_5 ;
2358 #ifndef MCS51REG_EXTERNAL_RAM
2359 sbit at 0xB6 P3_6 ;
2360 sbit at 0xB7 P3_7 ;
2361 #endif
2362 // alternate names
2363 sbit at 0xB0 RXD  ;
2364 sbit at 0xB0 RXD0  ;
2365 sbit at 0xB1 TXD  ;
2366 sbit at 0xB1 TXD0  ;
2367 sbit at 0xB2 INT0 ;
2368 sbit at 0xB3 INT1 ;
2369 sbit at 0xB4 T0   ;
2370 sbit at 0xB5 T1   ;
2371 #ifndef MCS51REG_EXTERNAL_RAM
2372 sbit at 0xB6 WR   ;
2373 sbit at 0xB7 RD   ;
2374 #endif
2375 #endif
2376
2377 #ifdef P4_AT_0X80
2378 #undef P4_AT_0X80
2379 sfr at 0x80 P4          ; // Port 4 - DS80C390
2380 // Bit registers
2381 sbit at 0x80 P4_0       ;
2382 sbit at 0x81 P4_1       ;
2383 sbit at 0x82 P4_2       ;
2384 sbit at 0x83 P4_3       ;
2385 sbit at 0x84 P4_4       ;
2386 sbit at 0x85 P4_5       ;
2387 sbit at 0x86 P4_6       ;
2388 sbit at 0x87 P4_7       ;
2389 #endif
2390
2391 #ifdef P4_AT_0XE8
2392 #undef P4_AT_0XE8
2393 sfr at 0xE8 P4          ; // Port 4 - SAB80515 & compatible microcontrollers
2394 // Bit registers
2395 sbit at 0xE8 P4_0       ;
2396 sbit at 0xE9 P4_1       ;
2397 sbit at 0xEA P4_2       ;
2398 sbit at 0xEB P4_3       ;
2399 sbit at 0xEC P4_4       ;
2400 sbit at 0xED P4_5       ;
2401 sbit at 0xEE P4_6       ;
2402 sbit at 0xEF P4_7       ;
2403 #endif
2404
2405 #ifdef P4CNT
2406 #undef P4CNT
2407 sfr at 0x92 P4CNT       ; // DS80C390
2408 // Not directly accessible bits
2409 #define P4CNT_0  0x01
2410 #define P4CNT_1  0x02
2411 #define P4CNT_2  0x04
2412 #define P4CNT_3  0x08
2413 #define P4CNT_4  0x10
2414 #define P4CNT_5  0x20
2415 #define SBCAN    0x40
2416 #endif
2417
2418 #ifdef P5_AT_0XA1
2419 #undef P5_AT_0XA1
2420 sfr at 0xA1 P5          ; // Port 5 - DS80C390
2421 #endif
2422
2423 #ifdef P5CNT
2424 #undef P5CNT
2425 sfr at 0xA2 P5CNT       ; // DS80C390
2426 // Not directly accessible bits
2427 #define P5CNT_0  0x01
2428 #define P5CNT_1  0x02
2429 #define P5CNT_2  0x04
2430 #define C0_I_O   0x08
2431 #define C1_I_O   0x10
2432 #define SP1EC    0x20
2433 #define SBCAN0BA 0x40
2434 #define SBCAN1BA 0x80
2435 #endif
2436
2437 #ifdef P5_AT_0XF8
2438 #undef P5_AT_0XF8
2439 sfr at 0xF8 P5          ; // Port 5 - SAB80515 & compatible microcontrollers
2440 // Bit registers
2441 sbit at 0xF8 P5_0       ;
2442 sbit at 0xF9 P5_1       ;
2443 sbit at 0xFA P5_2       ;
2444 sbit at 0xFB P5_3       ;
2445 sbit at 0xFC P5_4       ;
2446 sbit at 0xFD P5_5       ;
2447 sbit at 0xFE P5_6       ;
2448 sbit at 0xFF P5_7       ;
2449 #endif
2450
2451 #ifdef P6_AT_0XDB
2452 #undef P6_AT_0XDB
2453 sfr at 0xDB P6          ; // Port 6 - SAB80515 & compatible microcontrollers
2454 #endif
2455
2456 #ifdef P6_AT_0XFA
2457 #undef P6_AT_0XFA
2458 sfr at 0xFA P6          ; // Port 6 - SAB80517 specific
2459 #endif
2460
2461 #ifdef P7_AT_0XDB
2462 #undef P7_AT_0XDB
2463 sfr at 0xDB P7          ; // Port 7 - SAB80517 specific
2464 #endif
2465
2466 #ifdef P8_AT_0XDD
2467 #undef P8_AT_0XDD
2468 sfr at 0xDD P8          ; // Port 6 - SAB80517 specific
2469 #endif
2470
2471 #ifdef PCON__SMOD__x__x__x__x__x__x__x
2472 #undef PCON__SMOD__x__x__x__x__x__x__x
2473 sfr at 0x87 PCON ;
2474 // Not directly accessible PCON bits
2475 #define SMOD    0x80
2476 #endif
2477
2478 #ifdef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
2479 #undef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
2480 sfr at 0x87 PCON ;
2481 // Not directly accessible PCON bits
2482 #define IDL             0x01
2483 #define PD              0x02
2484 #define GF0             0x04
2485 #define GF1             0x08
2486 #define SMOD            0x80
2487 #endif
2488
2489 #ifdef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
2490 #undef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
2491 sfr at 0x87 PCON ;
2492 // Not directly accessible PCON bits
2493 #define IDL             0x01
2494 #define IDLE            0x01  ; same as IDL
2495 #define PD              0x02  ;
2496 #define PDE             0x02  ; same as PD
2497 #define IDLS            0x20
2498 #define PDS             0x40
2499 #define SMOD            0x80
2500 // alternate names
2501 #define PCON_IDLE       0x01
2502 #define PCON_PDE        0x02
2503 #define PCON_GF0        0x04
2504 #define PCON_GF1        0x08
2505 #define PCON_IDLS       0x20
2506 #define PCON_PDS        0x40
2507 #define PCON_SMOD       0x80
2508 #endif
2509
2510 #ifdef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
2511 #undef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
2512 sfr at 0x87 PCON ;
2513 // Not directly accessible PCON bits
2514 #define IDL             0x01
2515 #define IDLE            0x01  ; same as IDL
2516 #define STOP            0x02  ;
2517 #define EWT             0x04
2518 #define EPFW            0x08
2519 #define WTR             0x10
2520 #define PFW             0x20
2521 #define POR             0x40
2522 #define SMOD            0x80
2523 #endif
2524
2525 #ifdef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
2526 #undef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
2527 sfr at 0x87 PCON ;
2528 // Not directly accessible PCON bits
2529 #define IDL             0x01
2530 #define IDLE            0x01  ; same as IDL
2531 #define STOP            0x02  ;
2532 #define GF0             0x04
2533 #define GF1             0x08
2534 #define SMOD0           0x40
2535 #define SMOD            0x80
2536 #endif
2537
2538 #ifdef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
2539 #undef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
2540 sfr at 0x87 PCON ;
2541 // Not directly accessible PCON bits
2542 #define IDL             0x01
2543 #define IDLE            0x01  ; same as IDL
2544 #define STOP            0x02  ;
2545 #define GF0             0x04
2546 #define GF1             0x08
2547 #define OFDE            0x10
2548 #define OFDF            0x20
2549 #define SMOD0           0x40
2550 #define SMOD            0x80
2551 #define SMOD_0          0x80  ; same as SMOD
2552 #endif
2553
2554 #ifdef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1_DME0
2555 #undef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1_DME0
2556 sfr at 0xC4 PMR  ;   // DS87C520, DS83C520
2557 // Not directly accessible bits
2558 #define DME0    0x01
2559 #define DME1    0x02
2560 #define ALEOFF  0x04
2561 #define XTOFF   0x08
2562 #define SWB     0x20
2563 #define CD0     0x40
2564 #define CD1     0x80
2565 #endif
2566
2567 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
2568 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
2569 sfr at 0xC4 PMR  ;   // DS80C390
2570 // Not directly accessible bits
2571 #define ALEOFF  0x04
2572 #define XTOFF   0x08
2573 #define _4X_2X  0x10
2574 #define SWB     0x20
2575 #define CD0     0x40
2576 #define CD1     0x80
2577 #endif
2578
2579 #ifdef PSW
2580 #undef PSW
2581 sfr at 0xD0 PSW  ;
2582 // Bit registers
2583 sbit at 0xD0 P    ;
2584 sbit at 0xD1 F1   ;
2585 sbit at 0xD2 OV   ;
2586 sbit at 0xD3 RS0  ;
2587 sbit at 0xD4 RS1  ;
2588 sbit at 0xD5 F0   ;
2589 sbit at 0xD6 AC   ;
2590 sbit at 0xD7 CY   ;
2591 #endif
2592
2593 #ifdef RCAP2H
2594 #undef RCAP2H
2595 sfr at 0xCB RCAP2H  ;
2596 #endif
2597
2598 #ifdef RCAP2L
2599 #undef RCAP2L
2600 sfr at 0xCA RCAP2L  ;
2601 #endif
2602
2603 #ifdef RNR
2604 #undef RNR
2605 sfr at 0xCF RNR  ;
2606 #endif
2607
2608 #ifdef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
2609 #undef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
2610 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
2611 // Not directly accessible bits
2612 #define RSM0    0x01
2613 #define RSM1    0x02
2614 #define RSM2    0x04
2615 #endif
2616
2617 #ifdef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
2618 #undef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
2619 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
2620 // Not directly accessible bits
2621 #define RSM0    0x01
2622 #define RSM1    0x02
2623 #define RSM2    0x04
2624 #define PRAME   0x08
2625 #define MOVCX   0x10
2626 #define TE      0x20
2627 #define BPF     0x40
2628 #define HBPF    0x80
2629 #endif
2630
2631 #ifdef RPCTL
2632 #undef RPCTL
2633 sfr at 0xD8 RPCTL     ;  // Dallas DS5001 specific
2634 sbit at 0xD8 RG0      ;
2635 sbit at 0xD9 RPCON    ;
2636 sbit at 0xDA DMA      ;
2637 sbit at 0xDB IBI      ;
2638 sbit at 0xDC AE       ;
2639 sbit at 0xDD EXBS     ;
2640 sbit at 0xDF RNR_FLAG ;
2641 #endif
2642
2643 #ifdef S0BUF
2644 #undef S0BUF
2645 sfr at 0x99 S0BUF ; // serial channel 0 buffer register SAB80517 specific
2646 #endif
2647
2648 #ifdef S0CON
2649 #undef S0CON
2650 sfr at 0x98 S0CON ; // serial channel 0 control register SAB80517 specific
2651 // Bit registers
2652 sbit at 0x98 RI0  ; // S0CON.0: receiver0 interrupt flag
2653 sbit at 0x99 TI0  ; // S0CON.1: transmitter0 interrupt flag
2654 sbit at 0x9A RB80 ; // S0CON.2: receiver0 bit8
2655 sbit at 0x9B TB80 ; // S0CON.3: transmitter0 bit 8
2656 sbit at 0x9C REN0 ; // S0CON.4: receiver0 enable
2657 sbit at 0x9D SM20 ; // S0CON.5: multiprocessor feature
2658 sbit at 0x9E SM1  ; // S0CON.6: | select serial mode
2659 sbit at 0x9F SM0  ; // S0CON.7: |
2660 #endif
2661
2662 #ifdef S0RELL
2663 #undef S0RELL
2664 sfr at 0xAA S0RELL ; // serial channel 0 reload register low byte SAB80517 specific
2665 #endif
2666
2667 #ifdef S0RELH
2668 #undef S0RELH
2669 sfr at 0xBA S0RELH ; // serial channel 0 reload register high byte SAB80517 specific
2670 #endif
2671
2672 #ifdef S1BUF
2673 #undef S1BUF
2674 sfr at 0x9C S1BUF ; // serial channel 1 buffer register SAB80517 specific
2675 #endif
2676
2677 #ifdef S1CON
2678 #undef S1CON
2679 sfr at 0x9B S1CON ; // serial channel 1 control register SAB80517 specific
2680 #endif
2681
2682 #ifdef S1RELL
2683 #undef S1RELL
2684 sfr at 0x9D S1RELL ; // serial channel 1 reload register low byte SAB80517 specific
2685 #endif
2686
2687 #ifdef S1RELH
2688 #undef S1RELH
2689 sfr at 0xBB S1RELH ; // serial channel 1 reload register high byte SAB80517 specific
2690 #endif
2691
2692 #ifdef SADDR0
2693 #undef SADDR0
2694 // DS80C320 specific
2695 sfr at 0xA9 SADDR0  ;
2696 #endif
2697
2698 #ifdef SADDR1
2699 #undef SADDR1
2700 // DS80C320 specific
2701 sfr at 0xAA SADDR1  ;
2702 #endif
2703
2704 #ifdef SADEN0
2705 #undef SADEN0
2706 // DS80C320 & DS80C390 specific
2707 sfr at 0xB9 SADEN0  ;
2708 #endif
2709
2710 #ifdef SADEN1
2711 #undef SADEN1
2712 // DS80C320 & DS80C390 specific
2713 sfr at 0xBA SADEN1  ;
2714 #endif
2715
2716 #ifdef SBUF
2717 #undef SBUF
2718 sfr at 0x99 SBUF ;
2719 sfr at 0x99 SBUF0 ;
2720 #endif
2721
2722 #ifdef SBUF1
2723 #undef SBUF1
2724 // DS80C320 & DS80C390 specific
2725 sfr at 0xC1 SBUF1 ;
2726 #endif
2727
2728 #ifdef SCON
2729 #undef SCON
2730 sfr at 0x98 SCON ;
2731 // Bit registers
2732 sbit at 0x98 RI   ;
2733 sbit at 0x99 TI   ;
2734 sbit at 0x9A RB8  ;
2735 sbit at 0x9B TB8  ;
2736 sbit at 0x9C REN  ;
2737 sbit at 0x9D SM2  ;
2738 sbit at 0x9E SM1  ;
2739 sbit at 0x9F SM0  ;
2740 #endif
2741
2742 #ifdef SCON0
2743 #undef SCON0
2744 sfr at 0x98 SCON0 ;
2745 // Bit registers
2746 sbit at 0x98 RI_0   ;
2747 sbit at 0x99 TI_0   ;
2748 sbit at 0x9A RB8_0  ;
2749 sbit at 0x9B TB8_0  ;
2750 sbit at 0x9C REN_0  ;
2751 sbit at 0x9D SM2_0  ;
2752 sbit at 0x9E SM1_0  ;
2753 sbit at 0x9F SM0_0  ;
2754 sbit at 0x9F FE_0   ;
2755 sbit at 0x9F SM0_FE_0  ;
2756 #endif
2757
2758 #ifdef SCON1
2759 #undef SCON1
2760 // DS80C320 - 80C390 specific
2761 sfr at 0xC0 SCON1  ;
2762 // Bit registers
2763 sbit at 0xC0 RI_1         ;
2764 sbit at 0xC1 TI_1         ;
2765 sbit at 0xC2 RB8_1        ;
2766 sbit at 0xC3 TB8_1        ;
2767 sbit at 0xC4 REN_1        ;
2768 sbit at 0xC5 SM2_1        ;
2769 sbit at 0xC6 SM1_1        ;
2770 sbit at 0xC7 SM0_1        ;
2771 sbit at 0xC7 FE_1         ;
2772 sbit at 0xC7 SM0_FE_1     ;
2773 #endif
2774
2775 #ifdef SP
2776 #undef SP
2777 sfr at 0x81 SP   ;
2778 #endif
2779
2780 #ifdef SPCR
2781 #undef SPCR
2782 sfr at 0xD5 SPCR   ;   // AT89S53 specific
2783 // Not directly accesible bits
2784 #define SPR0 0x01
2785 #define SPR1 0x02
2786 #define CPHA 0x04
2787 #define CPOL 0x08
2788 #define MSTR 0x10
2789 #define DORD 0x20
2790 #define SPE  0x40
2791 #define SPIE 0x80
2792 #endif
2793
2794 #ifdef SPDR
2795 #undef SPDR
2796 sfr at 0x86 SPDR   ;   // AT89S53 specific
2797 // Not directly accesible bits
2798 #define SPD_0 0x01
2799 #define SPD_1 0x02
2800 #define SPD_2 0x04
2801 #define SPD_3 0x08
2802 #define SPD_4 0x10
2803 #define SPD_5 0x20
2804 #define SPD_6 0x40
2805 #define SPD_7 0x80
2806 #endif
2807
2808 #ifdef SPSR
2809 #undef SPSR
2810 sfr at 0xAA SPSR   ;   // AT89S53 specific
2811 // Not directly accesible bits
2812 #define SPIF 0x40
2813 #define WCOL 0x80
2814 #endif
2815
2816 #ifdef SRELH
2817 #undef SRELH
2818 sfr at 0xBA SRELH       ; // Baudrate generator reload high
2819 #endif
2820
2821 #ifdef SRELL
2822 #undef SRELL
2823 sfr at 0xAA SRELL       ; // Baudrate generator reload low
2824 #endif
2825
2826 #ifdef STATUS__PIP__HIP__LIP__x__x__x__x__x
2827 #undef STATUS__PIP__HIP__LIP__x__x__x__x__x
2828 // DS80C320 specific
2829 sfr at 0xC5 STATUS ;
2830 // Not directly accessible Bits. DS80C320 specific
2831 #define LIP  0x20
2832 #define HIP  0x40
2833 #define PIP  0x80
2834 #endif
2835
2836 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
2837 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
2838 sfr at 0xC5 STATUS ; // DS80C390 specific
2839 // Not directly accessible Bits.
2840 #define SPRA0  0x01
2841 #define SPTA0  0x02
2842 #define SPRA1  0x04
2843 #define SPTA1  0x08
2844 #define LIP    0x20
2845 #define HIP    0x40
2846 #define PIP    0x80
2847 #endif
2848
2849 #ifdef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
2850 #undef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
2851 sfr at 0xC5 STATUS ; // DS87C520 & DS83520specific
2852 // Not directly accessible Bits.
2853 #define SPRA0  0x01
2854 #define SPTA0  0x02
2855 #define SPTA1  0x04
2856 #define SPTA2  0x08
2857 #define XTUP   0x10
2858 #define LIP    0x20
2859 #define HIP    0x40
2860 #define PIP    0x80
2861 #endif
2862
2863 #ifdef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
2864 #undef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
2865 sfr at 0xDA STATUS ; // DS5001specific
2866 // Not directly accessible Bits.
2867 #define OBF    0x01
2868 #define IBF    0x02
2869 #define F0     0x04
2870 #define IA0    0x08
2871 #define ST4    0x10
2872 #define ST5    0x20
2873 #define ST6    0x40
2874 #define ST7    0x80
2875 #endif
2876
2877 #ifdef SYSCON
2878 #undef SYSCON
2879 sfr at 0xB1 SYSCON      ; // XRAM Controller Access Control
2880 // SYSCON bits
2881 #define SYSCON_XMAP0    0x01
2882 #define SYSCON_XMAP1    0x02
2883 #define SYSCON_RMAP             0x10
2884 #define SYSCON_EALE             0x20
2885 #endif
2886
2887 #ifdef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
2888 #undef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
2889 sfr at 0xC8 T2CON ;
2890 // Definitions for the 8052 compatible microcontrollers.
2891 // Bit registers
2892 sbit at 0xC8 CP_RL2  ;
2893 sbit at 0xC9 C_T2    ;
2894 sbit at 0xCA TR2     ;
2895 sbit at 0xCB EXEN2   ;
2896 sbit at 0xCC TCLK    ;
2897 sbit at 0xCD RCLK    ;
2898 sbit at 0xCE EXF2    ;
2899 sbit at 0xCF TF2     ;
2900 // alternate names
2901 sbit at 0xC8 T2CON_0 ;
2902 sbit at 0xC9 T2CON_1 ;
2903 sbit at 0xCA T2CON_2 ;
2904 sbit at 0xCB T2CON_3 ;
2905 sbit at 0xCC T2CON_4 ;
2906 sbit at 0xCD T2CON_5 ;
2907 sbit at 0xCE T2CON_6 ;
2908 sbit at 0xCF T2CON_7 ;
2909 #endif
2910
2911 #ifdef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
2912 #undef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
2913 sfr at 0xC8 T2CON ;
2914 // Definitions for the Infineon / Siemens SAB80515, SAB80515A, SAB80517
2915 // Bit registers
2916 sbit at 0xC8 T2I0 ;
2917 sbit at 0xC9 T2I1 ;
2918 sbit at 0xCA T2CM ;
2919 sbit at 0xCB T2R0 ;
2920 sbit at 0xCC T2R1 ;
2921 sbit at 0xCD I2FR ;
2922 sbit at 0xCE I3FR ;
2923 sbit at 0xCF T2PS ;
2924 // alternate names
2925 sbit at 0xC8 T2CON_0 ;
2926 sbit at 0xC9 T2CON_1 ;
2927 sbit at 0xCA T2CON_2 ;
2928 sbit at 0xCB T2CON_3 ;
2929 sbit at 0xCC T2CON_4 ;
2930 sbit at 0xCD T2CON_5 ;
2931 sbit at 0xCE T2CON_6 ;
2932 sbit at 0xCF T2CON_7 ;
2933 #endif
2934
2935 #ifdef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
2936 #undef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
2937 // Definitions for the timer/counter 2 of the Atmel & Dallas microcontrollers
2938 sfr at 0xC9 T2MOD  ;
2939 // Not not directly accessible T2MOD bits
2940 #define DCEN            0x01
2941 #define T2OE            0x02
2942 #define D13T2           0x08
2943 #define D13T1           0x10
2944 #endif
2945
2946 #ifdef T2MOD__x__x__x__x__x__x__T2OE__DCEN
2947 #undef T2MOD__x__x__x__x__x__x__T2OE__DCEN
2948 // Definitions for the timer/counter 2 of the Atmel 89x52 microcontroller
2949 sfr at 0xC9 T2MOD  ;
2950 // Not not directly accessible T2MOD bits
2951 #define DCEN            0x01
2952 #define T2OE            0x02
2953 // Alternate names
2954 #define DCEN_           0x01
2955 #define T2OE_           0x02
2956 #endif
2957
2958 #ifdef TA
2959 #undef TA
2960 // DS500x, DS80C320 & DS80C390 specific
2961 sfr at 0xC7 TA ;
2962 #endif
2963
2964 #ifdef TCON
2965 #undef TCON
2966 sfr at 0x88 TCON ;
2967 //  Bit registers
2968 sbit at 0x88 IT0  ;
2969 sbit at 0x89 IE0  ;
2970 sbit at 0x8A IT1  ;
2971 sbit at 0x8B IE1  ;
2972 sbit at 0x8C TR0  ;
2973 sbit at 0x8D TF0  ;
2974 sbit at 0x8E TR1  ;
2975 sbit at 0x8F TF1  ;
2976 #endif
2977
2978 #ifdef TH0
2979 #undef TH0
2980 sfr at 0x8C TH0  ;
2981 #endif
2982
2983 #ifdef TH1
2984 #undef TH1
2985 sfr at 0x8D TH1  ;
2986 #endif
2987
2988 #ifdef TH2
2989 #undef TH2
2990 sfr at 0xCD TH2     ;
2991 #endif
2992
2993 #ifdef TL0
2994 #undef TL0
2995 sfr at 0x8A TL0  ;
2996 #endif
2997
2998 #ifdef TL1
2999 #undef TL1
3000 sfr at 0x8B TL1  ;
3001 #endif
3002
3003 #ifdef TL2
3004 #undef TL2
3005 sfr at 0xCC TL2     ;
3006 #endif
3007
3008 #ifdef TMOD
3009 #undef TMOD
3010 sfr at 0x89 TMOD ;
3011 // Not directly accessible TMOD bits
3012 #define T0_M0           0x01
3013 #define T0_M1           0x02
3014 #define T0_CT           0x04
3015 #define T0_GATE         0x08
3016 #define T1_M0           0x10
3017 #define T1_M1           0x20
3018 #define T1_CT           0x40
3019 #define T1_GATE         0x80
3020
3021 #define T0_MASK         0x0F
3022 #define T1_MASK         0xF0
3023 #endif
3024
3025 #ifdef WCON
3026 #undef WCON
3027 sfr at 0x96 WCON   ;   // AT89S53 specific
3028 // Not directly accesible bits
3029 #define WDTEN  0x01
3030 #define WDTRST 0x02
3031 #define DPS    0x04
3032 #define PS0    0x20
3033 #define PS1    0x40
3034 #define PS2    0x80
3035 #endif
3036
3037 #ifdef WDCON
3038 #undef WDCON
3039 // DS80C320 - 390 specific
3040 sfr at 0xD8 WDCON ;
3041 //  Bit registers
3042 sbit at 0xD8 RWT    ;
3043 sbit at 0xD9 EWT    ;
3044 sbit at 0xDA WTRF   ;
3045 sbit at 0xDB WDIF   ;
3046 sbit at 0xDC PFI    ;
3047 sbit at 0xDD EPFI   ;
3048 sbit at 0xDE POR    ;
3049 sbit at 0xDF SMOD_1 ;
3050 #endif
3051
3052 #ifdef WDTREL
3053 #undef WDTREL
3054 sfr at 0x86 WDTREL    ; // Watchdof Timer reload register
3055 #endif
3056
3057 #ifdef XPAGE
3058 #undef XPAGE
3059 sfr at 0x91 XPAGE     ; // Page Address Register for Extended On-Chip Ram - Infineon / Siemens SAB80515A specific
3060 #endif
3061
3062
3063 /////////////////////////
3064 /// Interrupt vectors ///
3065 /////////////////////////
3066
3067 // Interrupt numbers: address = (number * 8) + 3
3068 #define IE0_VECTOR      0       // 0x03 external interrupt 0
3069 #define TF0_VECTOR      1       // 0x0b timer 0
3070 #define IE1_VECTOR      2       // 0x13 external interrupt 1
3071 #define TF1_VECTOR      3       // 0x1b timer 1
3072 #define SI0_VECTOR      4       // 0x23 serial port 0
3073
3074 #ifdef MICROCONTROLLER_AT89S53
3075 #define TF2_VECTOR      5       /* 0x2B timer 2 */
3076 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
3077 #endif
3078
3079 #ifdef MICROCONTROLLER_AT89X52
3080 #define TF2_VECTOR      5       /* 0x2B timer 2 */
3081 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
3082 #endif
3083
3084 #ifdef MICROCONTROLLER_AT89X55
3085 #define TF2_VECTOR      5       /* 0x2B timer 2 */
3086 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
3087 #endif
3088
3089 #ifdef MICROCONTROLLER_DS5000
3090 #define PFW_VECTOR      5       /* 0x2B */
3091 #endif
3092
3093 #ifdef MICROCONTROLLER_DS5001
3094 #define PFW_VECTOR      5       /* 0x2B */
3095 #endif
3096
3097 #ifdef MICROCONTROLLER_DS80C32X
3098 #define TF2_VECTOR      5  /* 0x2B */
3099 #define PFI_VECTOR      6  /* 0x33 */
3100 #define SIO1_VECTOR     7  /* 0x3B */
3101 #define IE2_VECTOR      8  /* 0x43 */
3102 #define IE3_VECTOR      9  /* 0x4B */
3103 #define IE4_VECTOR      10 /* 0x53 */
3104 #define IE5_VECTOR      11 /* 0x5B */
3105 #define WDI_VECTOR      12 /* 0x63 */
3106 #endif
3107
3108 #ifdef MICROCONTROLLER_DS8XC520
3109 #define TF2_VECTOR      5  /* 0x2B */
3110 #define PFI_VECTOR      6  /* 0x33 */
3111 #define SIO1_VECTOR     7  /* 0x3B */
3112 #define IE2_VECTOR      8  /* 0x43 */
3113 #define IE3_VECTOR      9  /* 0x4B */
3114 #define IE4_VECTOR      10 /* 0x53 */
3115 #define IE5_VECTOR      11 /* 0x5B */
3116 #define WDI_VECTOR      12 /* 0x63 */
3117 #endif
3118
3119 #ifdef MICROCONTROLLER_SAB80515
3120 #define TF2_VECTOR      5       // 0x2B timer 2
3121 #define EX2_VECTOR      5       // 0x2B external interrupt 2
3122 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
3123 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
3124 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
3125 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
3126 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
3127 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
3128 #endif
3129
3130 #ifdef MICROCONTROLLER_SAB80515A
3131 #define TF2_VECTOR      5       // 0x2B timer 2
3132 #define EX2_VECTOR      5       // 0x2B external interrupt 2
3133 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
3134 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
3135 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
3136 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
3137 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
3138 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
3139 #endif
3140
3141 #ifdef MICROCONTROLLER_SAB80517
3142 #define TF2_VECTOR      5       // 0x2B timer 2
3143 #define EX2_VECTOR      5       // 0x2B external interrupt 2
3144 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
3145 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
3146 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
3147 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
3148 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
3149 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
3150                                 // 0x73 not used
3151                                 // 0x7B not used
3152 #define SI1_VECTOR     16       // 0x83 serial port 1
3153                                 // 0x8B not used
3154                                 // 0x93 not used
3155 #define COMPARE_VECTOR 19       // 0x9B compare
3156 #endif
3157
3158 #endif  // End of the header -> #ifndef MCS51REG_H