port P6 added to sab80515.h
[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                       #ifndef 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    Version 1.0.7 (June 7, 2001)
65    #ifndef MCS51REG_DISABLE_WARNINGS removed
66    #ifdef MCS51REG_DISABLE_WARNINGS added - B. Torok / bela.torok@kssg.ch
67    Support for the Philips P80C552 added - Bernhard Held / Bernhard.Held@otelo-online.de
68
69    Version 1.0.8 (Feb 28, 2002)
70    Dallas DS89C420 definitions corrected by B. Torok / bela.torok@kssg.ch
71    Revised by lanius@ewetel.net
72
73    Version 1.0.9 (Sept 9, 2002)
74    Register declarations for the Atmel T89C51RD2 added by Johannes Hoelzl / johannes.hoelzl@gmx.de
75
76    Version 1.0.10 (Sept 19, 2002)
77    Register declarations for the Philips P89C668 added by Eric Limpens / Eric@limpens.net
78
79    Adding support for additional microcontrollers:
80    -----------------------------------------------
81
82    1. Don't modify this file!!!
83
84    2. Insert your code in a separate file e.g.: mcs51reg_update.h and include
85       this after the #define HEADER_MCS51REG statement in this file
86
87    3. The mcs51reg_update.h file should contain following definitions:
88
89           a. An entry with the inventory of the register set of the
90              microcontroller in the  "Describe microcontrollers" section.
91
92           b. If necessary add entry(s) for registers not defined in this file
93
94           c. Define interrupt vectors
95
96    4. Compile a program for the microcontroller using the Preprocessor only, e.g.:,
97       sdcc -E test.c > t.txt
98       and check definitions for validity in the t.txt file.
99
100    5. If everithing seems to be OK send me the mcs51reg_update.h file. --> bela.torok@kssg.ch
101       I'm going to resolve conflicts & verify/merge new definitions to this file.
102
103
104    Microcontroller support:
105
106    Use one of the following options:
107
108    1. use #include <mcs51reg.h> in your program & define MICROCONTROLLER_XXXX in your makefile.
109
110    2. use following definitions prior the
111       #include <mcs51reg.h> line in your program:
112       e.g.:
113       #define MICROCONTROLLER_8052       -> 8052 type microcontroller
114       or
115       #define MICROCONTROLLER_AT89CX051  -> Atmel AT89C1051, AT89C2051 and AT89C4051 microcontrollers
116
117
118    Use only one of the following definitions!!!
119
120    Supported Microcontrollers:
121
122    No definition                8051
123    MICROCONTROLLER_8051         8051
124    MICROCONTROLLER_8052         8052
125    MICROCONTROLLER_AT89CX051    Atmel AT89C1051, AT89C2051 and AT89C4051
126    MICROCONTROLLER_AT89S53      Atmel AT89S53 microcontroller
127    MICROCONTROLLER_AT89X52      Atmel AT89C52 and AT80LV52 microcontrollers
128    MICROCONTROLLER_AT89X55      Atmel AT89C55 and AT80LV55 microcontrollers
129    MICROCONTROLLER_DS5000       Dallas DS5000 & DS2250 microcontroller
130    MICROCONTROLLER_DS5001       Dallas DS5001 & DS2251 microcontroller
131    MICROCONTROLLER_DS80C32X     Dallas DS80C320 and DS80C323 microcontrollers
132    MICROCONTROLLER_DS80C390     Dallas DS80C390 microcontroller
133    MICROCONTROLLER_DS89C420     Dallas DS89C420 microcontroller
134    MICROCONTROLLER_DS8XC520     Dallas DS87C520 and DS83C520 microcontrollers
135    MICROCONTROLLER_P80C552      Philips P80C552
136    MICROCONTROLLER_P89C668      Philips P89C668
137    MICROCONTROLLER_SAB80515     Infineon / Siemens SAB80515 & SAB80535
138    MICROCONTROLLER_SAB80515A    Infineon / Siemens SAB80515A
139    MICROCONTROLLER_SAB80517     Infineon / Siemens SAB80517
140    MICROCONTROLLER_T89C51RD2    Atmel T89C51RD2
141
142    Additional definitions (use them prior the #include mcs51reg.h statement):
143
144    Ports P0 & P2 are not available if external ROM used.
145    Use statement "#define MCS51REG_EXTERNAL_ROM" to undefine P0 & P2.
146
147    Ports P0, P2, P3_6, WR, P3_7 & RD are not available if external RAM is used.
148    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
149    P3_6, WR, P3_7 & RD.
150
151    #define MCS51REG_ENABLE_WARNINGS -> enable warnings
152
153 -----------------------------------------------------------------------*/
154
155
156 #ifndef HEADER_MCS51REG
157 #define HEADER_MCS51REG
158
159 ///////////////////////////////////////////////////////
160 ///  Insert header here (for developers only)       ///
161 ///  remove "//" from the begining of the next line ///
162 //#include "mcs51reg_update.h"                      ///
163 ///////////////////////////////////////////////////////
164
165 //////////////////////////////////
166 ///  Describe microcontrollers ///
167 ///  (inventory of registers)  ///
168 //////////////////////////////////
169
170 // definitions for the 8051
171 #ifdef MICROCONTROLLER_8051
172 #ifdef MICROCONTROLLER_DEFINED
173 #define MCS51REG_ERROR
174 #endif
175 #ifndef MICROCONTROLLER_DEFINED
176 #define MICROCONTROLLER_DEFINED
177 #endif
178 #ifdef MCS51REG_ENABLE_WARNINGS
179 #warning Selected HW: 8051
180 #endif
181 #define P0
182 #define SP
183 #define DPL
184 #define DPH
185 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
186 #define TCON
187 #define TMOD
188 #define TL0
189 #define TL1
190 #define TH0
191 #define TH1
192 #define P1
193 #define SCON
194 #define SBUF
195 #define P2
196 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
197 #define P3
198 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
199 #define PSW
200 #define ACC
201 #define B
202 #endif
203 // end of definitions for the 8051
204
205
206 // definitions for the 8052 microcontroller
207 #ifdef MICROCONTROLLER_8052
208 #ifdef MICROCONTROLLER_DEFINED
209 #define MCS51REG_ERROR
210 #endif
211 #ifndef MICROCONTROLLER_DEFINED
212 #define MICROCONTROLLER_DEFINED
213 #endif
214 #ifdef MCS51REG_ENABLE_WARNINGS
215 #warning Selected HW: 8052
216 #endif
217 // 8051 register set
218 #define P0
219 #define SP
220 #define DPL
221 #define DPH
222 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
223 #define TCON
224 #define TMOD
225 #define TL0
226 #define TL1
227 #define TH0
228 #define TH1
229 #define P1
230 #define SCON
231 #define SBUF
232 #define P2
233 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
234 #define P3
235 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
236 #define PSW
237 #define ACC
238 #define B
239 // 8052 specific registers
240 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
241 #define RCAP2L
242 #define RCAP2H
243 #define TL2
244 #define TH2
245 #endif
246 // end of definitions for the 8052 microcontroller
247
248
249 // definitionsons for the Atmel
250 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
251 #ifdef MICROCONTROLLER_AT89CX051
252 #ifdef MICROCONTROLLER_DEFINED
253 #define MCS51REG_ERROR
254 #endif
255 #ifndef MICROCONTROLLER_DEFINED
256 #define MICROCONTROLLER_DEFINED
257 #endif
258 #ifdef MCS51REG_ENABLE_WARNINGS
259 #warning Selected HW: Atmel AT89Cx051
260 #endif
261 // 8051 register set without P0 & P2
262 #define SP
263 #define DPL
264 #define DPH
265 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
266 #define TCON
267 #define TMOD
268 #define TL0
269 #define TL1
270 #define TH0
271 #define TH1
272 #define P1
273 #define SCON
274 #define SBUF
275 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
276 #define P3
277 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
278 #define PSW
279 #define ACC
280 #define B
281 #endif
282 // end of definitionsons for the Atmel
283 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
284
285
286 // definitions for the Atmel AT89S53
287 #ifdef MICROCONTROLLER_AT89S53
288 #ifdef MICROCONTROLLER_DEFINED
289 #define MCS51REG_ERROR
290 #endif
291 #ifndef MICROCONTROLLER_DEFINED
292 #define MICROCONTROLLER_DEFINED
293 #endif
294 #ifdef MCS51REG_ENABLE_WARNINGS
295 #warning Selected HW: AT89S53
296 #endif
297 // 8051 register set
298 #define P0
299 #define SP
300 #define DPL
301 #define DPH
302 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
303 #define TCON
304 #define TMOD
305 #define TL0
306 #define TL1
307 #define TH0
308 #define TH1
309 #define P1
310 #define SCON
311 #define SBUF
312 #define P2
313 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
314 #define P3
315 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
316 #define PSW
317 #define ACC
318 #define B
319 // 8052 specific registers
320 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
321 #define RCAP2L
322 #define RCAP2H
323 #define TL2
324 #define TH2
325 // AT89S53 specific register
326 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
327 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
328 #define SPCR
329 #define SPDR
330 #define SPSR
331 #define WCOM
332 #define DPL1
333 #define DPH1
334 #endif
335 // end of definitions for the Atmel AT89S53 microcontroller
336
337
338 // definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
339 #ifdef MICROCONTROLLER_AT89X52
340 #ifdef MICROCONTROLLER_DEFINED
341 #define MCS51REG_ERROR
342 #endif
343 #ifndef MICROCONTROLLER_DEFINED
344 #define MICROCONTROLLER_DEFINED
345 #endif
346 #ifdef MCS51REG_ENABLE_WARNINGS
347 #warning Selected HW: AT89C52 or AT89LV52
348 #endif
349 // 8051 register set
350 #define P0
351 #define SP
352 #define DPL
353 #define DPH
354 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
355 #define TCON
356 #define TMOD
357 #define TL0
358 #define TL1
359 #define TH0
360 #define TH1
361 #define P1
362 #define SCON
363 #define SBUF
364 #define P2
365 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
366 #define P3
367 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
368 #define PSW
369 #define ACC
370 #define B
371 // 8052 specific registers
372 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
373 #define RCAP2L
374 #define RCAP2H
375 #define TL2
376 #define TH2
377 // AT89X55 specific register
378 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
379 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
380 #endif
381 // end of definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
382
383
384 // definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
385 #ifdef MICROCONTROLLER_AT89X55
386 #ifdef MICROCONTROLLER_DEFINED
387 #define MCS51REG_ERROR
388 #endif
389 #ifndef MICROCONTROLLER_DEFINED
390 #define MICROCONTROLLER_DEFINED
391 #endif
392 #ifdef MCS51REG_ENABLE_WARNINGS
393 #warning Selected HW: AT89C55 or AT89LV55
394 #endif
395 // 8051 register set
396 #define P0
397 #define SP
398 #define DPL
399 #define DPH
400 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
401 #define TCON
402 #define TMOD
403 #define TL0
404 #define TL1
405 #define TH0
406 #define TH1
407 #define P1
408 #define SCON
409 #define SBUF
410 #define P2
411 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
412 #define P3
413 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
414 #define PSW
415 #define ACC
416 #define B
417 // 8052 specific registers
418 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
419 #define RCAP2L
420 #define RCAP2H
421 #define TL2
422 #define TH2
423 // AT89X55 specific register
424 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
425 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
426 #endif
427 // end of definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
428
429
430 // definitions for the Dallas DS5000
431 #ifdef MICROCONTROLLER_DS5000
432 #ifdef MICROCONTROLLER_DEFINED
433 #define MCS51REG_ERROR
434 #endif
435 #ifndef MICROCONTROLLER_DEFINED
436 #define MICROCONTROLLER_DEFINED
437 #endif
438 #ifdef MCS51REG_ENABLE_WARNINGS
439 #warning Selected HW: DS5000
440 #endif
441 #define P0
442 #define SP
443 #define DPL
444 #define DPH
445 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
446 #define TCON
447 #define TMOD
448 #define TL0
449 #define TL1
450 #define TH0
451 #define TH1
452 #define P1
453 #define SCON
454 #define SBUF
455 #define P2
456 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
457 #define P3
458 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
459 #define MCON__SL__PAA__ECE2__RA32_8__PA0__PA1__PA2__PA3
460 #define TA
461 #define PSW
462 #define ACC
463 #define B
464 #endif
465 // end of definitions for the Dallas DS5000
466
467
468 // definitions for the Dallas DS5001
469 #ifdef MICROCONTROLLER_DS5001
470 #ifdef MICROCONTROLLER_DEFINED
471 #define MCS51REG_ERROR
472 #endif
473 #ifndef MICROCONTROLLER_DEFINED
474 #define MICROCONTROLLER_DEFINED
475 #endif
476 #ifdef MCS51REG_ENABLE_WARNINGS
477 #warning Selected HW: DS5001
478 #endif
479 #define P0
480 #define SP
481 #define DPL
482 #define DPH
483 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
484 #define TCON
485 #define TMOD
486 #define TL0
487 #define TL1
488 #define TH0
489 #define TH1
490 #define P1
491 #define SCON
492 #define SBUF
493 #define P2
494 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
495 #define P3
496 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
497 #define CRC
498 #define CRCLOW
499 #define CRCHIGH
500 #define MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
501 #define TA
502 #define RNR
503 #define PSW
504 #define RPCTL
505 #define STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
506 #define ACC
507 #define B
508 #endif
509 // end of definitions for the Dallas DS5001
510
511
512 // definitions for the Dallas DS80C320 and DS80C323 microcontrollers
513 #ifdef MICROCONTROLLER_DS80C32X
514 #ifdef MICROCONTROLLER_DEFINED
515 #define MCS51REG_ERROR
516 #endif
517 #ifndef MICROCONTROLLER_DEFINED
518 #define MICROCONTROLLER_DEFINED
519 #endif
520 #ifdef MCS51REG_ENABLE_WARNINGS
521 #warning Selected HW: Dallas DS80C320 or DS80C323
522 #endif
523 // 8051 register set
524 #define P0
525 #define SP
526 #define DPL
527 #define DPH
528 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
529 #define TCON
530 #define TMOD
531 #define TL0
532 #define TL1
533 #define TH0
534 #define TH1
535 #define P1
536 #define SCON
537 #define SCON0
538 #define SBUF
539 #define P2
540 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
541 #define P3
542 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
543 #define PSW
544 #define ACC
545 #define B
546 // 8052 specific registers
547 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
548 #define RCAP2L
549 #define RCAP2H
550 #define TL2
551 #define TH2
552 // DS80C320 specific register
553 #define DPL1
554 #define DPH1
555 #define DPS__x__x__x__x__x__x__x__SEL
556 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
557 #define EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
558 #define SADDR0
559 #define SADDR1
560 #define SADEN0
561 #define SADEN1
562 #define SCON1
563 #define SBUF1
564 #define STATUS__PIP__HIP__LIP__x__x__x__x__x
565 #define TA
566 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
567 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
568 #define WDCON
569 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
570 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
571 #endif
572 // end of definitions for the Dallas DS80C320 and DS80C323 microcontrollers
573
574
575 // definitions for the Dallas DS80C390
576 #ifdef MICROCONTROLLER_DS80C390
577 #ifdef MICROCONTROLLER_DEFINED
578 #define MCS51REG_ERROR
579 #endif
580 #ifndef MICROCONTROLLER_DEFINED
581 #define MICROCONTROLLER_DEFINED
582 #endif
583 #ifdef MCS51REG_ENABLE_WARNINGS
584 #warning Selected HW: Dallas DS80C390
585 #endif
586 // 8051 register set
587 #define P0
588 #define SP
589 #define DPL
590 #define DPH
591 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
592 #define TCON
593 #define TMOD
594 #define TL0
595 #define TL1
596 #define TH0
597 #define TH1
598 #define P1
599 #define SCON
600 #define SCON0
601 #define SBUF
602 #define P2
603 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
604 #define P3
605 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
606 #define PSW
607 #define ACC
608 #define B
609 // 8052 specific registers
610 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
611 #define RCAP2L
612 #define RCAP2H
613 #define TL2
614 #define TH2
615 // DS80C390 specific register
616 #define P4_AT_0X80
617 #define DPL1
618 #define DPH1
619 #define DPS__ID1__ID0__TSL__x__x__x__x__SEL
620 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
621 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
622 #define P4CNT
623 #define DPX
624 #define DPX1
625 #define C0RMS0
626 #define C0RMS1
627 #define ESP
628 #define AP
629 #define ACON__x__x__x__x__x__SA__AM1__AM0
630 #define C0TMA0
631 #define C0TMA1
632 #define P5_AT_0XA1
633 #define P5CNT
634 #define C0C
635 #define C0S
636 #define C0IR
637 #define C0TE
638 #define C0RE
639 #define SADDR0
640 #define SADDR1
641 #define C0M1C
642 #define C0M2C
643 #define C0M3C
644 #define C0M4C
645 #define C0M5C
646 #define C0M6C
647 #define C0M7C
648 #define C0M8C
649 #define C0M9C
650 #define C0M10C
651 #define SADEN0
652 #define SADEN1
653 #define C0M11C
654 #define C0M12C
655 #define C0M13C
656 #define C0M14C
657 #define C0M15C
658 #define SCON1
659 #define SBUF1
660 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
661 #define STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
662 #define MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
663 #define TA
664 #define T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
665 #define COR
666 #define MCNT0
667 #define MCNT1
668 #define MA
669 #define MB
670 #define MC
671 #define C1RSM0
672 #define C1RSM1
673 #define WDCON
674 #define C1TMA0
675 #define C1TMA1
676 #define C1C
677 #define C1S
678 #define C1IR
679 #define C1TE
680 #define C1RE
681 #define EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
682 #define MXMAX
683 #define C1M1C
684 #define C1M2C
685 #define C1M3C
686 #define C1M4C
687 #define C1M5C
688 #define C1M6C
689 #define C1M7C
690 #define C1M8C
691 #define C1M9C
692 #define EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
693 #define C1M10C
694 #define C1M11C
695 #define C1M12C
696 #define C1M13C
697 #define C1M14C
698 #define C1M15C
699 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
700 #endif
701 // end of definitions for the Dallas DS80C390
702
703 // definitions for the Dallas DS89C420 microcontroller
704 #ifdef MICROCONTROLLER_DS89C420
705 #ifdef MICROCONTROLLER_DEFINED
706 #define MCS51REG_ERROR
707 #endif
708 #ifndef MICROCONTROLLER_DEFINED
709 #define MICROCONTROLLER_DEFINED
710 #endif
711 #ifdef MCS51REG_ENABLE_WARNINGS
712 #warning Selected HW: Dallas DS89C420
713 #endif
714 // 8051 register set
715 #define P0
716 #define SP
717 #define DPL
718 #define DPH
719 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
720 #define TCON
721 #define TMOD
722 #define TL0
723 #define TL1
724 #define TH0
725 #define TH1
726 #define P1
727 #define SCON
728 #define SCON0
729 #define SBUF
730 #define P2
731 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
732 #define P3
733 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
734 #define PSW
735 #define ACC
736 #define B
737 // 8052 specific registers
738 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
739 #define RCAP2L
740 #define RCAP2H
741 #define TL2
742 #define TH2
743 // DS8XC420 specific registers
744 #define ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
745 #define DPL1
746 #define DPH1
747 #define DPS__ID1__ID0__TSL__AID__x__x__x__SEL
748 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
749 #define CKMOD
750 #define IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
751 #define IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
752 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
753 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
754 #define SADDR0
755 #define SADDR1
756 #define SADEN0
757 #define SADEN1
758 #define SCON1
759 #define SBUF1
760 #define STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
761 #define TA
762 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
763 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
764 #define ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
765 #define WDCON
766 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
767 #define EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
768 #define EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
769 #define FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
770 #endif
771 // end of definitions for the Dallas DS89C420 microcontroller
772
773 // definitions for the Dallas DS87C520 and DS83C520 microcontrollers
774 #ifdef MICROCONTROLLER_DS8XC520
775 #ifdef MICROCONTROLLER_DEFINED
776 #define MCS51REG_ERROR
777 #endif
778 #ifndef MICROCONTROLLER_DEFINED
779 #define MICROCONTROLLER_DEFINED
780 #endif
781 #ifdef MCS51REG_ENABLE_WARNINGS
782 #warning Selected HW: Dallas DS87C520 or DS85C520
783 #endif
784 // 8051 register set
785 #define P0
786 #define SP
787 #define DPL
788 #define DPH
789 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
790 #define TCON
791 #define TMOD
792 #define TL0
793 #define TL1
794 #define TH0
795 #define TH1
796 #define P1
797 #define SCON
798 #define SCON0
799 #define SBUF
800 #define P2
801 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
802 #define P3
803 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
804 #define PSW
805 #define ACC
806 #define B
807 // 8052 specific registers
808 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
809 #define RCAP2L
810 #define RCAP2H
811 #define TL2
812 #define TH2
813 // DS8XC520 specific registers
814 #define DPL1
815 #define DPH1
816 #define DPS__x__x__x__x__x__x__x__SEL
817 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
818 #define EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
819 #define PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
820 #define SADDR0
821 #define SADDR1
822 #define SADEN0
823 #define SADEN1
824 #define SCON1
825 #define SBUF1
826 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
827 #define TA
828 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
829 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
830 #define WDCON
831 #define ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
832 #define BP2
833 #define WDCON
834 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
835 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
836 #endif
837 // end of definitions for the Dallas DS87C520 and DS83C520 microcontrollers
838
839
840 // definitions for the Philips P80C552 microcontroller
841 #ifdef MICROCONTROLLER_P80C552
842 #ifdef MICROCONTROLLER_DEFINED
843 #define MCS51REG_ERROR
844 #endif
845 #ifndef MICROCONTROLLER_DEFINED
846 #define MICROCONTROLLER_DEFINED
847 #endif
848 #ifdef MCS51REG_ENABLE_WARNINGS
849 #warning Selected HW: Philips P80C552
850 #endif
851 // 8051 register set
852 #define P0
853 #define SP
854 #define DPL
855 #define DPH
856 #define PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
857 #define TCON
858 #define TMOD
859 #define TL0
860 #define TL1
861 #define TH0
862 #define TH1
863 #define P1
864 #define SCON
865 #define SBUF
866 #define P2
867 #define IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
868 #define P3
869 #define IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
870 #define PSW
871 #define ACC
872 #define B
873 // P80C552 specific register-names
874 #define S0BUF           // same as SBUF, set in mcs51reg.h
875 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
876 // P80C552 specific registers
877 #define ADCH_AT_0XC6
878 #define ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
879 #define CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
880 #define CTH0_AT_0XCC
881 #define CTH1_AT_0XCD
882 #define CTH2_AT_0XCE
883 #define CTH3_AT_0XCF
884 #define CMH0_AT_0XC9
885 #define CMH1_AT_0XCA
886 #define CMH2_AT_0XCB
887 #define CTL0_AT_0XAC
888 #define CTL1_AT_0XAD
889 #define CTL2_AT_0XAE
890 #define CTL3_AT_0XAF
891 #define CML0_AT_0XA9
892 #define CML1_AT_0XAA
893 #define CML2_AT_0XAB
894 #define IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
895 #define IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
896 #define PWM0_AT_0XFC
897 #define PWM1_AT_0XFD
898 #define PWMP_AT_0XFE
899 #define P1_EXT__SDA__SCL__RT2__T2__CT3I__CT2I__CT1I__CT0I
900 #define P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
901 #define P5_AT_0XC4
902 #define RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
903 #define S1ADR__x__x__x__x__x__x__x__GC
904 #define S1DAT_AT_0XDA
905 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
906 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
907 #define STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
908 #define TMH2_AT_0XED
909 #define TML2_AT_0XEC
910 #define TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
911 #define TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
912 #define T3_AT_0XFF
913 #endif
914 // end of definitions for the Philips P80C552 microcontroller
915
916
917 // definitions for the Philips P89C668
918 #ifdef MICROCONTROLLER_P89C668
919 #ifdef MICROCONTROLLER_DEFINED
920 #define MCS51REG_ERROR
921 #endif
922 #ifndef MICROCONTROLLER_DEFINED
923 #define MICROCONTROLLER_DEFINED
924 #endif
925 #ifdef MCS51REG_ENABLE_WARNINGS
926 #warning Selected HW: P89C668
927 #endif
928 #define P0
929 #define P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
930 #define P1
931 #define P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
932 #define P2
933 #define P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
934 #define P3
935 #define P3_EXT__x__x__CEX4__CEX3__x__x__x__x
936 #define SP
937 #define DPL
938 #define DPH
939 #define TCON
940 #define TMOD
941 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
942 #define TL0
943 #define TL1
944 #define TH0
945 #define TH1
946 #define SCON
947 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
948 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
949 #define SBUF
950 #define S0BUF SBUF
951 #define PSW
952 #define ACC
953 #define B
954 #define SADR_AT_0XA9
955 #define SADEN_AT_0XB9
956 #define S1IST_AT_0XDC
957 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
958 #define S1DAT_AT_0XDA
959 #define S1ADR__x__x__x__x__x__x__x__GC
960 #define SBUF
961 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
962 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
963 #define RCAP2L
964 #define RCAP2H
965 #define TL2
966 #define TH2
967 #define IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
968 #define IEN1__x__x__x__x__x__x__x__ET2
969 #define IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
970 #define IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
971 #define CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
972 #define CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
973 #define AUXR__x__x__x__x__x__x__EXTRAM__A0
974 #define AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
975 #define WDTRST_AT_0XA6
976 #define CCAPM0_AT_0XC2
977 #define CCAPM1_AT_0XC3
978 #define CCAPM2_AT_0XC4
979 #define CCAPM3_AT_0XC5
980 #define CCAPM4_AT_0XC6
981 #define CCAP0L_AT_0XEA
982 #define CCAP1L_AT_0XEB
983 #define CCAP2L_AT_0XEC
984 #define CCAP3L_AT_0XED
985 #define CCAP4L_AT_0XEE
986 #define CH_AT_0XF9
987 #define CL_AT_0XE9
988 #define CCAP0H_AT_0XFA
989 #define CCAP1H_AT_0XFB
990 #define CCAP2H_AT_0XFC
991 #define CCAP3H_AT_0XFD
992 #define CCAP4H_AT_0XFE
993 #endif
994 // end of definitions for the Philips P89C668
995
996
997 // definitions for the Infineon / Siemens SAB80515 & SAB80535
998 #ifdef MICROCONTROLLER_SAB80515
999 #ifdef MICROCONTROLLER_DEFINED
1000 #define MCS51REG_ERROR
1001 #endif
1002 #ifndef MICROCONTROLLER_DEFINED
1003 #define MICROCONTROLLER_DEFINED
1004 #endif
1005 #ifdef MCS51REG_ENABLE_WARNINGS
1006 #warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
1007 #endif
1008 // 8051 register set without IP
1009 #define P0
1010 #define SP
1011 #define DPL
1012 #define DPH
1013 #define PCON__SMOD__x__x__x__x__x__x__x
1014 #define TCON
1015 #define TMOD
1016 #define TL0
1017 #define TL1
1018 #define TH0
1019 #define TH1
1020 #define P1
1021 #define SCON
1022 #define SBUF
1023 #define P2
1024 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1025 #define P3
1026 #define PSW
1027 #define ACC
1028 #define B
1029 // SAB80515 specific registers
1030 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1031 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1032 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1033 #define IRCON
1034 #define CCEN
1035 #define CCL1
1036 #define CCH1
1037 #define CCL2
1038 #define CCH2
1039 #define CCL3
1040 #define CCH3
1041 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1042 #define CRCL
1043 #define CRCH
1044 #define TL2
1045 #define TH2
1046 #define ADCON
1047 #define ADDAT
1048 #define DAPR__SAB80515
1049 #define P4_AT_0XE8
1050 #define P5_AT_0XF8
1051 #define P6_AT_0XDB
1052 #endif
1053 // end of definitions for the Infineon / Siemens SAB80515
1054
1055
1056 // definitions for the Infineon / Siemens SAB80515A
1057 #ifdef MICROCONTROLLER_SAB80515A
1058 #ifdef MICROCONTROLLER_DEFINED
1059 #define MCS51REG_ERROR
1060 #endif
1061 #ifndef MICROCONTROLLER_DEFINED
1062 #define MICROCONTROLLER_DEFINED
1063 #endif
1064 #ifdef MCS51REG_ENABLE_WARNINGS
1065 #warning Selected HW: Infineon / Siemens SAB80515A
1066 #endif
1067 // 8051 register set without IP
1068 #define P0
1069 #define SP
1070 #define DPL
1071 #define DPH
1072 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1073 #define TCON
1074 #define TMOD
1075 #define TL0
1076 #define TL1
1077 #define TH0
1078 #define TH1
1079 #define P1
1080 #define SCON
1081 #define SBUF
1082 #define P2
1083 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1084 #define P3
1085 #define PSW
1086 #define ACC
1087 #define B
1088 // SAB80515A specific registers
1089 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1090 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1091 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1092 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1093 #define IRCON
1094 #define CCEN
1095 #define CCL1
1096 #define CCH1
1097 #define CCL2
1098 #define CCH2
1099 #define CCL3
1100 #define CCH3
1101 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1102 #define CRCL
1103 #define CRCH
1104 #define TL2
1105 #define TH2
1106 #define ADCON0
1107 #define ADDATH
1108 #define ADDATL
1109 #define ADCON1
1110 #define SRELL
1111 #define SYSCON
1112 #define SRELH
1113 #define P4_AT_0XE8
1114 #define P5_AT_0XF8
1115 #define P6_AT_0XDB
1116 #define XPAGE
1117 #endif
1118 // end of definitions for the Infineon / Siemens SAB80515A
1119
1120
1121 // definitions for the Infineon / Siemens SAB80517
1122 #ifdef MICROCONTROLLER_SAB80517
1123 #ifdef MICROCONTROLLER_DEFINED
1124 #define MCS51REG_ERROR
1125 #endif
1126 #ifndef MICROCONTROLLER_DEFINED
1127 #define MICROCONTROLLER_DEFINED
1128 #endif
1129 #ifdef MCS51REG_ENABLE_WARNINGS
1130 #warning Selected HW: Infineon / Siemens SAB80517
1131 #endif
1132 // 8051 register set without IP, SCON & SBUF
1133 #define P0
1134 #define SP
1135 #define DPL
1136 #define DPH
1137 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1138 #define TCON
1139 #define TMOD
1140 #define TL0
1141 #define TL1
1142 #define TH0
1143 #define TH1
1144 #define P1
1145 // #define SCON
1146 // #define SBUF
1147 #define P2
1148 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1149 #define P3
1150 #define PSW
1151 #define ACC
1152 #define B
1153 // SAB80517 specific registers
1154 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1155 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1156 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1157 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1158 #define IEN2__SAB80517
1159 #define IRCON
1160 #define CCEN
1161 #define CCL1
1162 #define CCH1
1163 #define CCL2
1164 #define CCH2
1165 #define CCL3
1166 #define CCH3
1167 #define CCL4
1168 #define CCH4
1169 #define CC4EN
1170 #define CMEN
1171 #define CMH0
1172 #define CML0
1173 #define CMH1
1174 #define CML1
1175 #define CMH2
1176 #define CML2
1177 #define CMH3
1178 #define CML3
1179 #define CMH4
1180 #define CML4
1181 #define CMH5
1182 #define CML5
1183 #define CMH6
1184 #define CML6
1185 #define CMH7
1186 #define CML7
1187 #define CMSEL
1188 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1189 #define CRCL
1190 #define CRCH
1191 #define CTCOM_AT_0XE1
1192 #define CTRELH
1193 #define CTRELL
1194 #define TL2
1195 #define TH2
1196 #define ADCON0
1197 #define ADCON1
1198 #define ADDAT
1199 #define DAPR__SAB80517
1200 #define P4_AT_0XE8
1201 #define P5_AT_0XF8
1202 #define P6_AT_0XFA
1203 #define P7_AT_0XDB
1204 #define P8_AT_0XDD
1205 #define DPSEL
1206 #define ARCON
1207 #define MD0
1208 #define MD1
1209 #define MD2
1210 #define MD3
1211 #define MD4
1212 #define MD5
1213 #define S0BUF
1214 #define S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
1215 #define S0RELH
1216 #define S0RELL
1217 #define S1BUF
1218 #define S1CON_AT_0X9B
1219 #define S1RELH
1220 #define S1RELL
1221 #define WDTH
1222 #define WDTL
1223 #define WDTREL
1224 #endif
1225 // end of definitions for the Infineon / Siemens SAB80517
1226
1227
1228 // definitions for the Atmel T89C51RD2
1229 #ifdef MICROCONTROLLER_T89C51RD2
1230 #ifdef MICROCONTROLLER_DEFINED
1231 #define MCS51REG_ERROR
1232 #endif
1233 #ifndef MICROCONTROLLER_DEFINED
1234 #define MICROCONTROLLER_DEFINED
1235 #endif
1236 #ifdef MCS51REG_ENABLE_WARNINGS
1237 #warning Selected HW: T89C51RD2
1238 #endif
1239
1240 // 8051 register set
1241 #define P0
1242 #define SP
1243 #define DPL
1244 #define DPH
1245 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
1246 #define TCON
1247 #define TMOD
1248 #define TL0
1249 #define TL1
1250 #define TH0
1251 #define TH1
1252 #define P1
1253 #define SCON
1254 #define SBUF
1255 #define P2
1256 #define IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
1257 #define SADDR
1258 #define P3
1259 #define IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
1260 #define PSW
1261 #define ACC
1262 #define B
1263
1264 // 8052 register set
1265 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
1266 #define RCAP2L
1267 #define RCAP2H
1268 #define TL2
1269 #define TH2
1270
1271 // T89C51RD2 register set
1272 #define P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
1273 #define P5_AT_0XE8
1274 #define SADEN0
1275
1276 #define AUXR1__x__x__x__x__GF3__x__x__DPS
1277 #define WDTRST_AT_0XA6
1278 #define WDTPRG_AT_0XA7
1279 #define AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1280 #define IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
1281 #define FCON
1282 #define EECON
1283 #define EETIM
1284 #define CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
1285 #define CCON__0xD8__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
1286 #define CMOD__0xD9__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
1287 #define CCAPM0_AT_0XDA
1288 #define CCAPM1_AT_0XDB
1289 #define CCAPM2_AT_0XDC
1290 #define CCAPM3_AT_0XDD
1291 #define CCAPM4_AT_0XDE
1292 #define CL_AT_0XE9
1293 #define CCAP0L_AT_0XEA
1294 #define CCAP1L_AT_0XEB
1295 #define CCAP2L_AT_0XEC
1296 #define CCAP3L_AT_0XED
1297 #define CCAP4L_AT_0XEE
1298 #define CH_AT_0XF9
1299 #define CCAP0H_AT_0XFA
1300 #define CCAP1H_AT_0XFB
1301 #define CCAP2H_AT_0XFC
1302 #define CCAP3H_AT_0XFD
1303 #define CCAP4H_AT_0XFE
1304 #endif /* MICROCONTROLLER_T89C51RD2 */
1305 /* end of definition for the Atmel T89C51RD2 */
1306
1307
1308 /////////////////////////////////////////////////////////
1309 ///  don't specify microcontrollers below this line!  ///
1310 /////////////////////////////////////////////////////////
1311
1312
1313 // default microcontroller -> 8051
1314 // use default if no microcontroller specified
1315 #ifndef MICROCONTROLLER_DEFINED
1316 #define MICROCONTROLLER_DEFINED
1317 #ifdef MCS51REG_ENABLE_WARNINGS
1318 #warning No microcontroller defined!
1319 #warning Code generated for the 8051
1320 #endif
1321 // 8051 register set
1322 #define P0
1323 #define SP
1324 #define DPL
1325 #define DPH
1326 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
1327 #define TCON
1328 #define TMOD
1329 #define TL0
1330 #define TL1
1331 #define TH0
1332 #define TH1
1333 #define P1
1334 #define SCON
1335 #define SBUF
1336 #define P2
1337 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1338 #define P3
1339 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
1340 #define PSW
1341 #define ACC
1342 #define B
1343 #endif
1344 // end of definitions for the default microcontroller
1345
1346
1347 #ifdef MCS51REG_ERROR
1348 #error Two or more microcontrollers defined!
1349 #endif
1350
1351 #ifdef MCS51REG_EXTERNAL_ROM
1352 #ifndef MCS51REG_UNDEFINE_P0
1353 #define MCS51REG_UNDEFINE_P0
1354 #endif
1355 #ifndef MCS51REG_UNDEFINE_P2
1356 #define MCS51REG_UNDEFINE_P2
1357 #endif
1358 #endif
1359
1360 #ifdef MCS51REG_EXTERNAL_RAM
1361 #ifndef MCS51REG_UNDEFINE_P0
1362 #define MCS51REG_UNDEFINE_P0
1363 #endif
1364 #ifndef MCS51REG_UNDEFINE_P2
1365 #define MCS51REG_UNDEFINE_P2
1366 #endif
1367 #endif
1368
1369 #ifdef MCS51REG_UNDEFINE_P0
1370 #undef P0
1371 #endif
1372
1373 #ifdef MCS51REG_UNDEFINE_P2
1374 #undef P2
1375 #endif
1376
1377 ////////////////////////////////
1378 ///  Register definitions    ///
1379 ///  (In alphabetical order) ///
1380 ////////////////////////////////
1381
1382 #ifdef ACC
1383 #undef ACC
1384 sfr at 0xE0 ACC         ;
1385 #endif
1386
1387 #ifdef ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
1388 #undef ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
1389 sfr at 0x9D ACON        ; // DS89C420 specific
1390 // Not directly accessible bits
1391 #define PAGES0      0x20
1392 #define PAGES1      0x40
1393 #define PAGEE       0x80
1394 #endif
1395
1396 #ifdef ACON__x__x__x__x__x__SA__AM1__AM0
1397 #undef ACON__x__x__x__x__x__SA__AM1__AM0
1398 sfr at 0x9D ACON        ; // DS89C390 specific
1399 // Not directly accessible bits
1400 #define AM0         0x01
1401 #define AM1         0x02
1402 #define SA          0x04
1403 #endif
1404
1405 #ifdef ADCH_AT_0XC6
1406 #undef ADCH_AT_0XC6
1407 sfr at 0xC6 ADCH        ; // A/D converter high
1408 #endif
1409
1410 #ifdef ADCON
1411 #undef ADCON
1412 sfr at 0xD8 ADCON       ; // A/D-converter control register SAB80515 specific
1413 // Bit registers
1414 sbit at 0xD8 MX0        ;
1415 sbit at 0xD9 MX1        ;
1416 sbit at 0xDA MX2        ;
1417 sbit at 0xDB ADM        ;
1418 sbit at 0xDC BSY        ;
1419 sbit at 0xDE CLK        ;
1420 sbit at 0xDF BD         ;
1421 #endif
1422
1423 // ADCON0 ... Infineon / Siemens also called this register ADCON in the User Manual
1424 #ifdef ADCON0
1425 #undef ADCON0
1426 sfr at 0xD8 ADCON0      ; // A/D-converter control register 0 SAB80515A &
1427 // Bit registers          // SAB80517 specific
1428 sbit at 0xD8 MX0        ;
1429 sbit at 0xD9 MX1        ;
1430 sbit at 0xDA MX2        ;
1431 sbit at 0xDB ADM        ;
1432 sbit at 0xDC BSY        ;
1433 sbit at 0xDD ADEX       ;
1434 sbit at 0xDE CLK        ;
1435 sbit at 0xDF BD         ;
1436 // Not directly accessible ADCON0
1437 #define ADCON0_MX0  0x01
1438 #define ADCON0_MX1  0x02
1439 #define ADCON0_MX2  0x04
1440 #define ADCON0_ADM  0x08
1441 #define ADCON0_BSY  0x10
1442 #define ADCON0_ADEX 0x20
1443 #define ADCON0_CLK  0x40
1444 #define ADCON0_BD   0x80
1445 #endif
1446
1447 #ifdef ADCON1
1448 #undef ADCON1
1449 sfr at 0xDC ADCON1      ; // A/D-converter control register 1 SAB80515A & SAB80517 specific
1450 // Not directly accessible ADCON1
1451 #define ADCON1_MX0  0x01
1452 #define ADCON1_MX1  0x02
1453 #define ADCON1_MX2  0x04
1454 #define ADCON1_ADCL 0x80
1455 #endif
1456
1457 #ifdef ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
1458 #undef ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
1459 sfr at 0xC5 ADCON       ; // A/D control, P80C552 specific
1460 // Not directly accessible Bits.
1461 #define AADR0       0x01
1462 #define AADR1       0x02
1463 #define AADR2       0x04
1464 #define ADCS        0x08
1465 #define ADCI        0x10
1466 #define ADEX        0x20
1467 #define ADC_0       0x40    // different name as ADC0 in P5
1468 #define ADC_1       0x80    // different name as ADC1 in P5
1469 #endif
1470
1471 #ifdef ADDAT
1472 #undef ADDAT
1473 sfr at 0xD9 ADDAT       ; // A/D-converter data register SAB80515 specific
1474 #endif
1475
1476 #ifdef ADDATH
1477 #undef ADDATH
1478 sfr at 0xD9 ADDATH      ; // A/D data high byte SAB80515A specific
1479 #endif
1480
1481 #ifdef ADDATL
1482 #undef ADDATL
1483 sfr at 0xDA ADDATL      ; // A/D data low byte SAB80515A specific
1484 #endif
1485
1486 #ifdef ARCON
1487 #undef ARCON
1488 sfr at 0xEF ARCON       ; // arithmetic control register SAB80517
1489 #endif
1490
1491 #ifdef AP
1492 #undef AP
1493 sfr at 0x9C AP          ; // DS80C390
1494 #endif
1495
1496 #ifdef AUXR__x__x__x__x__x__x__EXTRAM__A0
1497 #undef AUXR__x__x__x__x__x__x__EXTRAM__A0
1498 // P89C668 specific, Auxilary
1499 sfr at 0x8E AUXR        ;
1500 // not bit addressable:
1501 #define EXTRAM      0x02
1502 #define A0          0x01
1503 #endif
1504
1505 #ifdef AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1506 #undef AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1507 sfr at 0x8E AUXR        ;
1508 #define AO          0x01
1509 #define EXTRAM      0x02
1510 #define XRS0        0x04
1511 #define XRS1        0x08
1512 #define M0          0x20
1513 #endif
1514 #ifdef B
1515 #undef B
1516 sfr at 0xF0 B           ;
1517 // Bit registers
1518 sbit at 0xF0 BREG_F0    ;
1519 sbit at 0xF1 BREG_F1    ;
1520 sbit at 0xF2 BREG_F2    ;
1521 sbit at 0xF3 BREG_F3    ;
1522 sbit at 0xF4 BREG_F4    ;
1523 sbit at 0xF5 BREG_F5    ;
1524 sbit at 0xF6 BREG_F6    ;
1525 sbit at 0xF7 BREG_F7    ;
1526 #endif
1527
1528 #ifdef AUXR1__x__x__x__x__GF3__x__x__DPS
1529 #undef AUXR1__x__x__x__x__GF3__x__x__DPS
1530 sfr at 0xA2 AUXR1       ;
1531 #define DPS         0x01
1532 #define GF3         0x08
1533 #endif
1534
1535 #ifdef AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
1536 #undef AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
1537 // P89C668 specific, Auxilary 1
1538 sfr at 0xA2 AUXR1       ;
1539 #define ENBOOT      0x20
1540 #define GF2         0x08
1541 #define ALWAYS_ZERO 0x04
1542 #define DPS         0x01
1543 #endif
1544
1545 #ifdef BP2
1546 #undef BP2
1547 sfr at 0xC3 BP2         ;
1548 // Not directly accessible bits
1549 #define MS0         0x01
1550 #define MS1         0x02
1551 #define MS2         0x04
1552 #define LB1         0x08
1553 #define LB2         0x10
1554 #define LB3         0x20
1555 #endif
1556
1557 #ifdef C0C
1558 #undef C0C
1559 sfr at 0xA3 C0C         ; // DS80C390 specific
1560 // Not directly accessible bits
1561 #define SWINT       0x01
1562 #define ERCS        0x02
1563 #define AUTOB       0x04
1564 #define CRST        0x08
1565 #define SIESTA      0x10
1566 #define PDE         0x20
1567 #define STIE        0x40
1568 #define ERIE        0x80
1569 #endif
1570
1571 #ifdef C0IR
1572 #undef C0IR
1573 sfr at 0xA5 C0IR        ; // DS80C390 specific
1574 // Not directly accessible bits
1575 #define INTIN0      0x01
1576 #define INTIN1      0x02
1577 #define INTIN2      0x04
1578 #define INTIN3      0x08
1579 #define INTIN4      0x10
1580 #define INTIN5      0x20
1581 #define INTIN6      0x40
1582 #define INTIN7      0x80
1583 #endif
1584
1585 #ifdef C0M1C
1586 #undef C0M1C
1587 sfr at 0xAB C0M1C       ; // DS80C390 specific
1588 // Not directly accessible bits
1589 #define DTUP        0x01
1590 #define ROW_TIH     0x02
1591 #define MTRQ        0x04
1592 #define EXTRQ       0x08
1593 #define INTRQ       0x10
1594 #define ERI         0x20
1595 #define ETI         0x40
1596 #define MSRDY       0x80
1597 #endif
1598
1599 #ifdef C0M2C
1600 #undef C0M2C
1601 sfr at 0xAC C0M2C       ; // DS80C390 specific
1602 #endif
1603
1604 #ifdef C0M3C
1605 #undef C0M3C
1606 sfr at 0xAD C0M3C       ; // DS80C390 specific
1607 #endif
1608
1609 #ifdef C0M4C
1610 #undef C0M4C
1611 sfr at 0xAE C0M4C       ; // DS80C390 specific
1612 #endif
1613
1614 #ifdef C0M5C
1615 #undef C0M5C
1616 sfr at 0xAF C0M5C       ; // DS80C390 specific
1617 #endif
1618
1619 #ifdef C0M6C
1620 #undef C0M6C
1621 sfr at 0xB3 C0M6C       ; // DS80C390 specific
1622 #endif
1623
1624 #ifdef C0M7C
1625 #undef C0M7C
1626 sfr at 0xB4 C0M7C       ; // DS80C390 specific
1627 #endif
1628
1629 #ifdef C0M8C
1630 #undef C0M8C
1631 sfr at 0xB5 C0M8C       ; // DS80C390 specific
1632 #endif
1633
1634 #ifdef C0M9C
1635 #undef C0M9C
1636 sfr at 0xB6 C0M9C       ; // DS80C390 specific
1637 #endif
1638
1639 #ifdef C0M10C
1640 #undef C0M10C
1641 sfr at 0xB7 C0M10C      ; // DS80C390 specific
1642 #endif
1643
1644 #ifdef C0M11C
1645 #undef C0M11C
1646 sfr at 0xBB C0M11C      ; // DS80C390 specific
1647 #endif
1648
1649 #ifdef C0M12C
1650 #undef C0M12C
1651 sfr at 0xBC C0M12C      ; // DS80C390 specific
1652 #endif
1653
1654 #ifdef C0M13C
1655 #undef C0M13C
1656 sfr at 0xBD C0M13C      ; // DS80C390 specific
1657 #endif
1658
1659 #ifdef C0M14C
1660 #undef C0M14C
1661 sfr at 0xBE C0M14C      ; // DS80C390 specific
1662 #endif
1663
1664 #ifdef C0M15C
1665 #undef C0M15C
1666 sfr at 0xBF C0M15C      ; // DS80C390 specific
1667 #endif
1668
1669 #ifdef C0RE
1670 #undef C0RE
1671 sfr at 0xA7 C0RE        ; // DS80C390 specific
1672 #endif
1673
1674 #ifdef C0RMS0
1675 #undef C0RMS0
1676 sfr at 0x96 C0RMS0      ; // DS80C390 specific
1677 #endif
1678
1679 #ifdef C0RMS1
1680 #undef C0RMS1
1681 sfr at 0x97 C0RMS1      ; // DS80C390 specific
1682 #endif
1683
1684 #ifdef C0S
1685 #undef C0S
1686 sfr at 0xA4 C0S         ; // DS80C390 specific
1687 // Not directly accessible bits
1688 #define ER0         0x01
1689 #define ER1         0x02
1690 #define ER2         0x04
1691 #define TXS         0x08
1692 #define RXS         0x10
1693 #define WKS         0x20
1694 #define EC96_128    0x40
1695 #define BSS         0x80
1696 #endif
1697
1698 #ifdef C0TE
1699 #undef C0TE
1700 sfr at 0xA6 C0TE        ; // DS80C390 specific
1701 #endif
1702
1703 #ifdef C0TMA0
1704 #undef C0TMA0
1705 sfr at 0x9E C0TMA0      ; // DS80C390 specific
1706 #endif
1707
1708 #ifdef C0TMA1
1709 #undef C0TMA1
1710 sfr at 0x9F C0TMA1      ; // DS80C390 specific
1711 #endif
1712
1713 #ifdef C1C
1714 #undef C1C
1715 sfr at 0xE3 C1C         ; // DS80C390 specific
1716 // Not directly accessible bits
1717 #define SWINT       0x01
1718 #define ERCS        0x02
1719 #define AUTOB       0x04
1720 #define CRST        0x08
1721 #define SIESTA      0x10
1722 #define PDE         0x20
1723 #define STIE        0x40
1724 #define ERIE        0x80
1725 #endif
1726
1727 #ifdef C1IR
1728 #undef C1IR
1729 sfr at 0xE5 C1IR        ; // DS80C390 specific
1730 // Not directly accessible bits
1731 #define INTIN0      0x01
1732 #define INTIN1      0x02
1733 #define INTIN2      0x04
1734 #define INTIN3      0x08
1735 #define INTIN4      0x10
1736 #define INTIN5      0x20
1737 #define INTIN6      0x40
1738 #define INTIN7      0x80
1739 #endif
1740
1741 #ifdef C1IRE
1742 #undef C1IRE
1743 sfr at 0xE7 C1RE        ; // DS80C390 specific
1744 #endif
1745
1746 #ifdef C1M1C
1747 #undef C1M1C
1748 sfr at 0xEB C1M1C       ; // DS80C390 specific
1749 #endif
1750
1751 #ifdef C1M2C
1752 #undef C1M2C
1753 sfr at 0xEC C1M2C       ; // DS80C390 specific
1754 #endif
1755
1756 #ifdef C1M3C
1757 #undef C1M3C
1758 sfr at 0xED C1M3C       ; // DS80C390 specific
1759 #endif
1760
1761 #ifdef C1M4C
1762 #undef C1M4C
1763 sfr at 0xEE C1M4C       ; // DS80C390 specific
1764 #endif
1765
1766 #ifdef C1M5C
1767 #undef C1M5C
1768 sfr at 0xEF C1M5C       ; // DS80C390 specific
1769 #endif
1770
1771 #ifdef C1M6C
1772 #undef C1M6C
1773 sfr at 0xF3 C1M6C       ; // DS80C390 specific
1774 #endif
1775
1776 #ifdef C1M7C
1777 #undef C1M7C
1778 sfr at 0xF4 C1M7C       ; // DS80C390 specific
1779 #endif
1780
1781 #ifdef C1M8C
1782 #undef C1M8C
1783 sfr at 0xF5 C1M8C       ; // DS80C390 specific
1784 #endif
1785
1786 #ifdef C1M9C
1787 #undef C1M9C
1788 sfr at 0xF6 C1M9C       ; // DS80C390 specific
1789 #endif
1790
1791 #ifdef C1M10C
1792 #undef C1M10C
1793 sfr at 0xF7 C1M10C      ; // DS80C390 specific
1794 #endif
1795
1796 #ifdef C1M11C
1797 #undef C1M11C
1798 sfr at 0xFB C1M11C      ; // DS80C390 specific
1799 #endif
1800
1801 #ifdef C1M12C
1802 #undef C1M12C
1803 sfr at 0xFC C1M12C      ; // DS80C390 specific
1804 #endif
1805
1806 #ifdef C1M13C
1807 #undef C1M13C
1808 sfr at 0xFD C1M13C      ; // DS80C390 specific
1809 #endif
1810
1811 #ifdef C1M14C
1812 #undef C1M14C
1813 sfr at 0xFE C1M14C      ; // DS80C390 specific
1814 #endif
1815
1816 #ifdef C1M15C
1817 #undef C1M15C
1818 sfr at 0xFF C1M15C      ; // DS80C390 specific
1819 #endif
1820
1821 #ifdef C1S
1822 #undef C1S
1823 sfr at 0xE4 C1S         ; // DS80C390 specific
1824 // Not directly accessible bits
1825 #define ER0         0x01
1826 #define ER1         0x02
1827 #define ER2         0x04
1828 #define TXS         0x08
1829 #define RXS         0x10
1830 #define WKS         0x20
1831 #define CECE        0x40
1832 #define BSS         0x80
1833 #endif
1834
1835 #ifdef C1ITE
1836 #undef C1ITE
1837 sfr at 0xE6 C1TE        ; // DS80C390 specific
1838 #endif
1839
1840 #ifdef C1RSM0
1841 #undef C1RSM0
1842 sfr at 0xD6 C1RSM0      ; // DS80C390 specific
1843 #endif
1844
1845 #ifdef C1RSM1
1846 #undef C1RSM1
1847 sfr at 0xD7 C1RSM1      ; // DS80C390 specific
1848 #endif
1849
1850 #ifdef C1TMA0
1851 #undef C1TMA0
1852 sfr at 0xDE C1TMA0      ; // DS80C390 specific
1853 #endif
1854
1855 #ifdef C1TMA1
1856 #undef C1TMA1
1857 sfr at 0xDF C1TMA1      ; // DS80C390 specific
1858 #endif
1859
1860 #ifdef CC4EN
1861 #undef CC4EN
1862 sfr at 0xC9 CC4EN       ; // compare/capture 4 enable register SAB80517 specific
1863 #endif
1864
1865 #ifdef CCAP0H_AT_0XFA
1866 #undef CCAP0H_AT_0XFA
1867 sfr at 0xFA CCAP0H      ;
1868 #endif
1869
1870 #ifdef CCAP1H_AT_0XFB
1871 #undef CCAP1H_AT_0XFB
1872 sfr at 0xFB CCAP1H      ;
1873 #endif
1874
1875 #ifdef CCAP2H_AT_0XFC
1876 #undef CCAP2H_AT_0XFC
1877 sfr at 0xFC CCAP2H      ;
1878 #endif
1879
1880 #ifdef CCAP3H_AT_0XFD
1881 #undef CCAP3H_AT_0XFD
1882 sfr at 0xFD CCAP3H      ;
1883 #endif
1884
1885 #ifdef CCAP4H_AT_0XFE
1886 #undef CCAP4H_AT_0XFE
1887 sfr at 0xFE CCAP4H      ;
1888 #endif
1889
1890 #ifdef CCAP0L_AT_0XEA
1891 #undef CCAP0L_AT_0XEA
1892 sfr at 0xEA CCAP0L      ;
1893 #endif
1894
1895 #ifdef CCAP1L_AT_0XEB
1896 #undef CCAP1L_AT_0XEB
1897 sfr at 0xEB CCAP1L      ;
1898 #endif
1899
1900 #ifdef CCAP2L_AT_0XEC
1901 #undef CCAP2L_AT_0XEC
1902 sfr at 0xEC CCAP2L      ;
1903 #endif
1904
1905 #ifdef CCAP3L_AT_0XED
1906 #undef CCAP3L_AT_0XED
1907 sfr at 0xED CCAP3L      ;
1908 #endif
1909
1910 #ifdef CCAP4L_AT_0XEE
1911 #undef CCAP4L_AT_0XEE
1912 sfr at 0xEE CCAP4L      ;
1913 #endif
1914
1915 #ifdef CCAPM0_AT_0XC2
1916 #undef CCAPM0_AT_0XC2
1917 // P89C668 specific, Capture module:
1918 sfr at 0xC2 CCAPM0      ;
1919 #endif
1920
1921 #ifdef CCAPM0_AT_0XDA
1922 #undef CCAPM0_AT_0XDA
1923 sfr at 0xDA CCAPM0      ;
1924 #define ECCF        0x01
1925 #define PWM         0x02
1926 #define TOG         0x04
1927 #define MAT         0x08
1928 #define CAPN        0x10
1929 #define CAPP        0x20
1930 #define ECOM        0x40
1931 #endif
1932
1933 #ifdef CCAPM1_AT_0XC3
1934 #undef CCAPM1_AT_0XC3
1935 sfr at 0xC3 CCAPM1      ;
1936 #endif
1937
1938 #ifdef CCAPM1_AT_0XDB
1939 #undef CCAPM1_AT_0XDB
1940 sfr at 0xDB CCAPM1      ;
1941 #endif
1942
1943 #ifdef CCAPM2_AT_0XC4
1944 #undef CCAPM2_AT_0XC4
1945 sfr at 0xC4 CCAPM2      ;
1946 #endif
1947
1948 #ifdef CCAPM2_AT_0XDC
1949 #undef CCAPM2_AT_0XDC
1950 sfr at 0x0DC CCAPM2     ;
1951 #endif
1952
1953 #ifdef CCAPM3_AT_0XC5
1954 #undef CCAPM3_AT_0XC5
1955 sfr at 0xC5 CCAPM3      ;
1956 #endif
1957
1958 #ifdef CCAPM3_AT_0XDD
1959 #undef CCAPM3_AT_0XDD
1960 sfr at 0x0DD CCAPM3     ;
1961 #endif
1962
1963 #ifdef CCAPM4_AT_0XDE
1964 #undef CCAPM4_AT_0XDE
1965 sfr at 0x0DE CCAPM4     ;
1966 #endif
1967
1968 #ifdef CCAPM4_AT_0XC6
1969 #undef CCAPM4_AT_0XC6
1970 sfr at 0xC6 CCAPM4      ;
1971 #endif
1972
1973 #ifdef CCEN
1974 #undef CCEN
1975 sfr at 0xC1 CCEN        ; // compare/capture enable register SAB80515 specific
1976 #endif
1977
1978 #ifdef CCH1
1979 #undef CCH1
1980 sfr at 0xC3 CCH1        ; // compare/capture register 1, high byte SAB80515 specific
1981 #endif
1982
1983 #ifdef CCH2
1984 #undef CCH2
1985 sfr at 0xC5 CCH2        ; // compare/capture register 2, high byte SAB80515 specific
1986 #endif
1987
1988 #ifdef CCH3
1989 #undef CCH3
1990 sfr at 0xC7 CCH3        ; // compare/capture register 3, high byte SAB80515 specific
1991 #endif
1992
1993 #ifdef CCH4
1994 #undef CCH4
1995 sfr at 0xCF CCH4        ; // compare/capture register 4, high byte SAB80515 specific
1996 #endif
1997
1998 #ifdef CCL1
1999 #undef CCL1
2000 sfr at 0xC2 CCL1        ; // compare/capture register 1, low byte SAB80515 specific
2001 #endif
2002
2003 #ifdef CCL2
2004 #undef CCL2
2005 sfr at 0xC4 CCL2        ; // compare/capture register 2, low byte SAB80515 specific
2006 #endif
2007
2008 #ifdef CCL3
2009 #undef CCL3
2010 sfr at 0xC6 CCL3        ; // compare/capture register 3, low byte SAB80515 specific
2011 #endif
2012
2013 #ifdef CCL4
2014 #undef CCL4
2015 sfr at 0xCE CCL4        ; // compare/capture register 4, low byte SAB80515 specific
2016 #endif
2017
2018 #ifdef CCON__0xD8__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2019 #undef CCON__0xD8__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2020 sfr at 0xD8 CCON        ; // T89C51RD2 specific register
2021 // Bit registers
2022 sbit at 0xD8 CCF0       ;
2023 sbit at 0xD9 CCF1       ;
2024 sbit at 0xDA CCF2       ;
2025 sbit at 0xDB CCF3       ;
2026 sbit at 0xDC CCF4       ;
2027 sbit at 0xDE CR         ;
2028 sbit at 0xDF CF         ;
2029 #endif
2030
2031 #ifdef CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2032 #undef CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2033 // P89C668 specific, PCA Counter control:
2034 sfr at 0xC0 CCON        ;
2035 // Bit registers
2036 sbit at 0xC0 CCF0       ;
2037 sbit at 0xC1 CCF1       ;
2038 sbit at 0xC2 CCF2       ;
2039 sbit at 0xC3 CCF3       ;
2040 sbit at 0xC4 CCF4       ;
2041 //sbit at 0xC5 -
2042 sbit at 0xC6 CR         ;
2043 sbit at 0xC7 CF         ;
2044 #endif
2045
2046 #ifdef CH_AT_0XF9
2047 #undef CH_AT_0XF9
2048 sfr at 0xF9 CH          ;
2049 #endif
2050
2051 #ifdef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2052 #undef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2053 // P89C668 specific, PCA Counter mode:
2054 sfr at 0xC1 CMOD        ;
2055 // not bit addressable:
2056 #define CIDL        0x80
2057 #define WDTE        0x40
2058 #define CPS1        0x04
2059 #define CPS0        0x02
2060 #define ECF         0x01
2061 #endif
2062
2063 #ifdef CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
2064 #undef CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
2065 sfr at 0x8E CKCON       ; // DS80C320 & DS80C390 specific
2066 // Not directly accessible Bits.
2067 #define MD0         0x01
2068 #define MD1         0x02
2069 #define MD2         0x04
2070 #define T0M         0x08
2071 #define T1M         0x10
2072 #define T2M         0x20
2073 #define WD0         0x40
2074 #define WD1         0x80
2075 #endif
2076
2077 #ifdef CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
2078 #undef CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
2079 sfr at 0x8F CKCON       ;
2080 #define X2          0x01
2081 #define T0X2        0x02
2082 #define T1X2        0x04
2083 #define T2X2        0x08
2084 #define SiX2        0x10
2085 #define PcaX2       0x20
2086 #define WdX2        0x40
2087 #endif
2088
2089 #ifdef CKMOD
2090 #undef CKMOD
2091 sfr at 0x96 CKMOD       ; // DS89C420 specific
2092 // Not directly accessible Bits.
2093 #define T0MH        0x08
2094 #define T1MH        0x10
2095 #define T2MH        0x20
2096 #endif
2097
2098 #ifdef CL_AT_0XE9
2099 #undef CL_AT_0XE9
2100 sfr at 0xE9 CL          ;
2101 #endif
2102
2103 #ifdef CMEN
2104 #undef CMEN
2105 sfr at 0xF6 CMEN        ; // compare enable register SAB80517 specific
2106 #endif
2107
2108 #ifdef CMH0
2109 #undef CMH0
2110 sfr at 0xD3 CMH0        ; // compare register 0 high byte SAB80517 specific
2111 #endif
2112
2113 #ifdef CMH1
2114 #undef CMH1
2115 sfr at 0xD5 CMH1        ; // compare register 1 high byte SAB80517 specific
2116 #endif
2117
2118 #ifdef CMH2
2119 #undef CMH2
2120 sfr at 0xD7 CMH2        ; // compare register 2 high byte SAB80517 specific
2121 #endif
2122
2123 #ifdef CMH3
2124 #undef CMH3
2125 sfr at 0xE3 CMH3        ; // compare register 3 high byte SAB80517 specific
2126 #endif
2127
2128 #ifdef CMH4
2129 #undef CMH4
2130 sfr at 0xE5 CMH4        ; // compare register 4 high byte SAB80517 specific
2131 #endif
2132
2133 #ifdef CMH5
2134 #undef CMH5
2135 sfr at 0xE7 CMH5        ; // compare register 5 high byte SAB80517 specific
2136 #endif
2137
2138 #ifdef CMH6
2139 #undef CMH6
2140 sfr at 0xF3 CMH6        ; // compare register 6 high byte SAB80517 specific
2141 #endif
2142
2143 #ifdef CMH7
2144 #undef CMH7
2145 sfr at 0xF5 CMH7        ; // compare register 7 high byte SAB80517 specific
2146 #endif
2147
2148 #ifdef CMH0_AT_0XC9
2149 #undef CMH0_AT_0XC9
2150 sfr at 0xC9 CMH0        ; // Compare high 0, P80C552 specific
2151 #endif
2152
2153 #ifdef CMH1_AT_0XCA
2154 #undef CMH1_AT_0XCA
2155 sfr at 0xCA CMH1        ; // Compare high 1, P80C552 specific
2156 #endif
2157
2158 #ifdef CMH2_AT_0XCB
2159 #undef CMH2_AT_0XCB
2160 sfr at 0xCB CMH2        ; // Compare high 2, P80C552 specific
2161 #endif
2162
2163 #ifdef CML0
2164 #undef CML0
2165 sfr at 0xD2 CML0        ; // compare register 0 low byte SAB80517 specific
2166 #endif
2167
2168 #ifdef CML1
2169 #undef CML1
2170 sfr at 0xD4 CML1        ; // compare register 1 low byte SAB80517 specific
2171 #endif
2172
2173 #ifdef CML2
2174 #undef CML2
2175 sfr at 0xD6 CML2        ; // compare register 2 low byte SAB80517 specific
2176 #endif
2177
2178 #ifdef CML3
2179 #undef CML3
2180 sfr at 0xE2 CML3        ; // compare register 3 low byte SAB80517 specific
2181 #endif
2182
2183 #ifdef CML4
2184 #undef CML4
2185 sfr at 0xE4 CML4        ; // compare register 4 low byte SAB80517 specific
2186 #endif
2187
2188 #ifdef CML5
2189 #undef CML5
2190 sfr at 0xE6 CML5        ; // compare register 5 low byte SAB80517 specific
2191 #endif
2192
2193 #ifdef CML6
2194 #undef CML6
2195 sfr at 0xF2 CML6        ; // compare register 6 low byte SAB80517 specific
2196 #endif
2197
2198 #ifdef CML7
2199 #undef CML7
2200 sfr at 0xF4 CML7        ; // compare register 7 low byte SAB80517 specific
2201 #endif
2202
2203 #ifdef CML0_AT_0XA9
2204 #undef CML0_AT_0XA9
2205 sfr at 0xA9 CML0        ; // Compare low 0, P80C552 specific
2206 #endif
2207
2208 #ifdef CML1_AT_0XAA
2209 #undef CML1_AT_0XAA
2210 sfr at 0xAA CML1        ; // Compare low 1, P80C552 specific
2211 #endif
2212
2213 #ifdef CML2_AT_0XAB
2214 #undef CML2_AT_0XAB
2215 sfr at 0xAB CML2        ; // Compare low 2, P80C552 specific
2216 #endif
2217
2218 #ifdef CMOD__0xD9__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2219 #undef CMOD__0xD9__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2220 sfr at 0xD9 CMOD        ;
2221 #define ECF         0x01
2222 #define CPS0        0x02
2223 #define CPS1        0x04
2224 #define WDTE        0x40
2225 #define CIDL        0x80
2226 #endif
2227
2228 #ifdef CMSEL
2229 #undef CMSEL
2230 sfr at 0xF7 CMSEL       ; // compare input select SAB80517
2231 #endif
2232
2233 #ifdef COR
2234 #undef COR
2235 sfr at 0xCE COR         ; // Dallas DS80C390 specific
2236 #define CLKOE       0x01
2237 #define COD0        0x02
2238 #define COD1        0x04
2239 #define C0BPR6      0x08
2240 #define C0BPR7      0x10
2241 #define C1BPR6      0x20
2242 #define C1BPR7      0x40
2243 #define IRDACK      0x80
2244 #endif
2245
2246 #ifdef CRC
2247 #undef CRC
2248 sfr at 0xC1 CRC         ; // Dallas DS5001 specific
2249 #define CRC_        0x01
2250 #define MDM         0x02
2251 #define RNGE0       0x10
2252 #define RNGE1       0x20
2253 #define RNGE2       0x40
2254 #define RNGE3       0x80
2255 #endif
2256
2257 #ifdef CRCH
2258 #undef CRCH
2259 sfr at 0xCB CRCH        ; // compare/reload/capture register, high byte SAB80515 specific
2260 #endif
2261
2262 #ifdef CRCHIGH
2263 #undef CRCHIGH
2264 sfr at 0xC3 CRCHIGH     ; // DS5001 specific
2265 #endif
2266
2267 #ifdef CRCL
2268 #undef CRCL
2269 sfr at 0xCA CRCL        ; // compare/reload/capture register, low byte SAB80515 specific
2270 #endif
2271
2272 #ifdef CRCLOW
2273 #undef CRCLOW
2274 sfr at 0xC2 CRCLOW      ; // DS5001 specific
2275 #endif
2276
2277 #ifdef CTCOM_AT_0XE1
2278 #undef CTCOM_AT_0XE1
2279 sfr at 0xE1 CTCON       ; // com.timer control register SAB80517
2280 #endif
2281
2282 #ifdef CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
2283 #undef CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
2284 sfr at 0xEB CTCON       ; // Capture control, P80C552 specific
2285 // Not directly accessible Bits.
2286 #define CTP0        0x01
2287 #define CTN0        0x02
2288 #define CTP1        0x04
2289 #define CTN1        0x08
2290 #define CTP2        0x10
2291 #define CTN2        0x20
2292 #define CTP3        0x40
2293 #define CTN3        0x80
2294 #endif
2295
2296 #ifdef CTH0_AT_0XCC
2297 #undef CTH0_AT_0XCC
2298 sfr at 0xCC CTH0        ; // Capture high 0, P80C552 specific
2299 #endif
2300
2301 #ifdef CTH1_AT_0XCD
2302 #undef CTH1_AT_0XCD
2303 sfr at 0xCD CTH1        ; // Capture high 1, P80C552 specific
2304 #endif
2305
2306 #ifdef CTH2_AT_0XCE
2307 #undef CTH2_AT_0XCE
2308 sfr at 0xCE CTH2        ; // Capture high 2, P80C552 specific
2309 #endif
2310
2311 #ifdef CTH3_AT_0XCF
2312 #undef CTH3_AT_0XCF
2313 sfr at 0xCF CTH3        ; // Capture high 3, P80C552 specific
2314 #endif
2315
2316 #ifdef CTL0_AT_0XAC
2317 #undef CTL0_AT_0XAC
2318 sfr at 0xAC CTL0        ; // Capture low 0, P80C552 specific
2319 #endif
2320
2321 #ifdef CTL1_AT_0XAD
2322 #undef CTL1_AT_0XAD
2323 sfr at 0xAD CTL1        ; // Capture low 1, P80C552 specific
2324 #endif
2325
2326 #ifdef CTL2_AT_0XAE
2327 #undef CTL2_AT_0XAE
2328 sfr at 0xAE CTL2        ; // Capture low 2, P80C552 specific
2329 #endif
2330
2331 #ifdef CTL3_AT_0XAF
2332 #undef CTL3_AT_0XAF
2333 sfr at 0xAF CTL3        ; // Capture low 3, P80C552 specific
2334 #endif
2335
2336 #ifdef CTRELH
2337 #undef CTRELH
2338 sfr at 0xDF CTRELH      ; // com.timer rel register high byte SAB80517
2339 #endif
2340
2341 #ifdef CTRELL
2342 #undef CTRELL
2343 sfr at 0xDE CTRELL      ; // com.timer rel register low byte SAB80517
2344 #endif
2345
2346 #ifdef DAPR__SAB80515
2347 #undef DAPR__SAB80515
2348 sfr at 0xD8 DAPR        ; // D/A-converter program register SAB80515 specific
2349 #endif
2350
2351 #ifdef DAPR__SAB80517
2352 #undef DAPR__SAB80517
2353 sfr at 0xDA DAPR        ; // D/A-converter program register SAB80517 specific
2354 #endif
2355
2356 #ifdef DPH
2357 #undef DPH
2358 sfr at 0x83 DPH         ;
2359 sfr at 0x83 DP0H        ;  // Alternate name for AT89S53
2360 #endif
2361
2362 #ifdef DPH1
2363 #undef DPH1
2364 sfr at 0x85 DPH1        ; // DS80C320 specific
2365 sfr at 0x85 DP1H        ; // Alternate name for AT89S53
2366 #endif
2367
2368 #ifdef DPL
2369 #undef DPL
2370 sfr at 0x82 DPL         ;  // Alternate name for AT89S53
2371 sfr at 0x82 DP0L        ;
2372 #endif
2373
2374 #ifdef DPL1
2375 #undef DPL1
2376 sfr at 0x84 DPL1        ; // DS80C320 specific
2377 sfr at 0x84 DP1L        ; // Alternate name for AT89S53
2378 #endif
2379
2380 #ifdef DPS__x__x__x__x__x__x__x__SEL
2381 #undef DPS__x__x__x__x__x__x__x__SEL
2382 sfr at 0x86 DPS         ;
2383 // Not directly accessible DPS Bit. DS80C320 & DPS8XC520 specific
2384 #define SEL         0x01
2385 #endif
2386
2387 #ifdef DPS__ID1__ID0__TSL__x__x__x__x__SEL
2388 #undef DPS__ID1__ID0__TSL__x__x__x__x__SEL
2389 sfr at 0x86 DPS         ;
2390 // Not directly accessible DPS Bit. DS89C390 specific
2391 #define SEL         0x01
2392 #define TSL         0x20
2393 #define ID0         0x40
2394 #define ID1         0x80
2395 #endif
2396
2397 #ifdef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
2398 #undef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
2399 sfr at 0x86 DPS         ;
2400 // Not directly accessible DPS Bit. DS89C420 specific
2401 #define SEL         0x01
2402 #define AID         0x10
2403 #define TSL         0x20
2404 #define ID0         0x40
2405 #define ID1         0x80
2406 #endif
2407
2408 #ifdef DPSEL
2409 #undef DPSEL
2410 sfr at 0x92 DPSEL       ; // data pointer select register SAB80517
2411 #endif
2412
2413 #ifdef DPX
2414 #undef DPX
2415 sfr at 0x93 DPX1        ; // DS80C390 specific
2416 #endif
2417
2418 #ifdef DPX1
2419 #undef DPX1
2420 sfr at 0x95 DPX1        ; // DS80C390 specific
2421 #endif
2422
2423 #ifdef EECON
2424 #undef EECON
2425 sfr at 0xD2 EECON       ;
2426 #define EEBUSY      0x01
2427 #define EEE         0x02
2428 #define EEPL0       0x10
2429 #define EEPL1       0x20
2430 #define EEPL2       0x40
2431 #define EEPL3       0x80
2432 #define EEPL        0xF0
2433 #endif
2434
2435 #ifdef EETIM
2436 #undef EETIM
2437 sfr at 0xD3 EETIM       ;
2438 #endif
2439
2440 #ifdef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
2441 #undef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
2442 sfr at 0xE8 EIE         ;
2443 // Bit registers DS80C320 specific
2444 sbit at 0xE8 EX2        ;
2445 sbit at 0xE9 EX3        ;
2446 sbit at 0xEA EX4        ;
2447 sbit at 0xEB EX5        ;
2448 sbit at 0xEC EWDI       ;
2449 #endif
2450
2451 #ifdef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
2452 #undef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
2453 sfr at 0xE8 EIE         ;
2454 // Bit registers DS80C390 specific
2455 sbit at 0xE8 EX2        ;
2456 sbit at 0xE9 EX3        ;
2457 sbit at 0xEA EX4        ;
2458 sbit at 0xEB EX5        ;
2459 sbit at 0xEC EWDI       ;
2460 sbit at 0xED C1IE       ;
2461 sbit at 0xEE C0IE       ;
2462 sbit at 0xEF CANBIE     ;
2463 #endif
2464
2465 #ifdef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
2466 #undef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
2467 sfr at 0xF8 EIP         ;
2468 // Bit registers DS80C320 specific
2469 sbit at 0xF8 PX2        ;
2470 sbit at 0xF9 PX3        ;
2471 sbit at 0xFA PX4        ;
2472 sbit at 0xFB PX5        ;
2473 sbit at 0xFC PWDI       ;
2474 #endif
2475
2476 #ifdef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
2477 #undef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
2478 sfr at 0xF8 EIP         ;
2479 // Bit registers DS80C320 specific
2480 sbit at 0xF8 PX2        ;
2481 sbit at 0xF9 PX3        ;
2482 sbit at 0xFA PX4        ;
2483 sbit at 0xFB PX5        ;
2484 sbit at 0xFC PWDI       ;
2485 sbit at 0xFD C1IP       ;
2486 sbit at 0xFE C0IP       ;
2487 sbit at 0xFF CANBIP     ;
2488 #endif
2489
2490 #ifdef EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
2491 #undef EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
2492 sfr at 0xF8 EIP0        ;
2493 // Bit registers DS89C420 specific
2494 sbit at 0xF8 LPX2       ;
2495 sbit at 0xF9 LPX3       ;
2496 sbit at 0xFA LPX4       ;
2497 sbit at 0xFB LPX5       ;
2498 sbit at 0xFC LPWDI      ;
2499 #endif
2500
2501 #ifdef EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
2502 #undef EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
2503 sfr at 0xF1 EIP1        ;
2504 // Not directly accessible Bits DS89C420 specific
2505 #define MPX2        0x01
2506 #define MPX3        0x02
2507 #define MPX4        0x04
2508 #define MPX5        0x08
2509 #define MPWDI       0x10
2510 #endif
2511
2512 #ifdef ESP
2513 #undef ESP
2514 sfr at 0x9B ESP         ;
2515 // Not directly accessible Bits DS80C390 specific
2516 #define ESP_0       0x01
2517 #define ESP_1       0x02
2518 #endif
2519
2520 #ifdef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
2521 #undef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
2522 sfr at 0x91 EXIF        ;
2523 // Not directly accessible EXIF Bits DS80C320 specific
2524 #define BGS         0x01
2525 #define RGSL        0x02
2526 #define RGMD        0x04
2527 #define IE2         0x10
2528 #define IE3         0x20
2529 #define IE4         0x40
2530 #define IE5         0x80
2531 #endif
2532
2533 #ifdef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
2534 #undef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
2535 sfr at 0x91 EXIF        ;
2536 // Not directly accessible EXIF Bits DS87C520 specific
2537 #define BGS         0x01
2538 #define RGSL        0x02
2539 #define RGMD        0x04
2540 #define XT_RG       0x08
2541 #define IE2         0x10
2542 #define IE3         0x20
2543 #define IE4         0x40
2544 #define IE5         0x80
2545 #endif
2546
2547 #ifdef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
2548 #undef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
2549 sfr at 0x91 EXIF        ;
2550 // Not directly accessible EXIF Bits DS80C390 & DS89C420 specific
2551 #define BGS         0x01
2552 #define RGSL        0x02
2553 #define RGMD        0x04
2554 #define CKRY        0x08
2555 #define IE2         0x10
2556 #define IE3         0x20
2557 #define IE4         0x40
2558 #define IE5         0x80
2559 #endif
2560
2561 #ifdef FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
2562 #undef FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
2563 sfr at 0xD5 FCNTL       ;
2564 // Not directly accessible DS89C420 specific
2565 #define FC0         0x01
2566 #define FC1         0x02
2567 #define FC2         0x04
2568 #define FC3         0x08
2569 #define FERR        0x40
2570 #define FBUSY       0x80
2571 #endif
2572
2573 #ifdef FCON
2574 #undef FCON
2575 sfr at 0xD1 FCON        ;
2576 #define FBUSY       0x01
2577 #define FMOD0       0x02
2578 #define FMOD1       0x04
2579 #define FPS         0x08
2580 #define FPL0        0x10
2581 #define FPL1        0x20
2582 #define FPL2        0x40
2583 #define FPL3        0x80
2584 #define FPL         0xF0
2585 #endif
2586
2587 #ifdef FDATA
2588 #undef FDATA
2589 sfr at 0xD6 FDATA       ;
2590 #endif
2591
2592 #ifdef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
2593 #undef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
2594 sfr at 0xA8 IE          ;
2595 // Bit registers
2596 sbit at 0xA8 EX0        ;
2597 sbit at 0xA9 ET0        ;
2598 sbit at 0xAA EX1        ;
2599 sbit at 0xAB ET1        ;
2600 sbit at 0xAC ES         ;
2601 sbit at 0xAF EA         ;
2602 #endif
2603
2604 #ifdef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
2605 #undef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
2606 sfr at 0xA8 IE          ;
2607 // Bit registers
2608 sbit at 0xA8 EX0        ;
2609 sbit at 0xA9 ET0        ;
2610 sbit at 0xAA EX1        ;
2611 sbit at 0xAB ET1        ;
2612 sbit at 0xAC ES         ;
2613 sbit at 0xAD ET2        ; // Enable timer2 interrupt
2614 sbit at 0xAF EA         ;
2615 #endif // IE
2616
2617 #ifdef IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
2618 #undef IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
2619 sfr at 0xA8 IE          ; // same as IEN0 - Interrupt enable 0, P80C552 specific
2620 sfr at 0xA8 IEN0        ; // alternate name
2621 // Bit registers
2622 sbit at 0xA8 EX0        ;
2623 sbit at 0xA9 ET0        ;
2624 sbit at 0xAA EX1        ;
2625 sbit at 0xAB ET1        ;
2626 sbit at 0xAC ES0        ;
2627 sbit at 0xAD ES1        ;
2628 sbit at 0xAE EAD        ;
2629 sbit at 0xAF EEA        ;
2630 #endif
2631
2632 #ifdef IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
2633 #undef IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
2634 sfr at 0xA8 IE          ;
2635 sbit at 0xA8 EX0        ;
2636 sbit at 0xA9 ET0        ;
2637 sbit at 0xAA EX1        ;
2638 sbit at 0xAB ET1        ;
2639 sbit at 0xAC ES         ;
2640 sbit at 0xAD ET2        ;
2641 sbit at 0xAE EC         ;
2642 sbit at 0xAF EA         ;
2643 #endif
2644
2645 #ifdef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2646 #undef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2647 sfr at 0xA8 IE          ;
2648 // Bit registers
2649 sbit at 0xA8 EX0        ;
2650 sbit at 0xA9 ET0        ;
2651 sbit at 0xAA EX1        ;
2652 sbit at 0xAB ET1        ;
2653 sbit at 0xAC ES         ;
2654 sbit at 0xAC ES0        ; // Alternate name
2655 sbit at 0xAD ET2        ; // Enable timer2 interrupt
2656 sbit at 0xAE ES1        ;
2657 sbit at 0xAF EA         ;
2658 #endif // IE
2659
2660 #ifdef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2661 #undef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2662 sfr at 0xA8 IE          ;
2663 sfr at 0xA8 IEN0        ; // Alternate name
2664 // Bit registers for the SAB80515 and compatible IE
2665 sbit at 0xA8 EX0        ;
2666 sbit at 0xA9 ET0        ;
2667 sbit at 0xAA EX1        ;
2668 sbit at 0xAB ET1        ;
2669 sbit at 0xAC ES         ;
2670 sbit at 0xAC ES0        ;
2671 sbit at 0xAD ET2        ; // Enable timer 2 overflow SAB80515 specific
2672 sbit at 0xAE WDT        ; // watchdog timer reset - SAB80515 specific
2673 sbit at 0xAF EA         ;
2674 sbit at 0xAF EAL        ; // EA as called by Infineon / Siemens
2675 #endif
2676
2677 #ifdef IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
2678 #undef IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
2679 // P89C668 specific
2680 sfr at 0xA8 IEN0        ;
2681 // Bit registers
2682 sbit at 0xA8 EX0        ;
2683 sbit at 0xA9 ET0        ;
2684 sbit at 0xAA EX1        ;
2685 sbit at 0xAB ET1        ;
2686 sbit at 0xAC ES0        ;
2687 sbit at 0xAD ES1        ;
2688 sbit at 0xAE EC         ;
2689 sbit at 0xAF EA         ;
2690 #endif
2691
2692 #ifdef IEN1__x__x__x__x__x__x__x__ET2
2693 #undef IEN1__x__x__x__x__x__x__x__ET2
2694 // P89C668 specific bit registers
2695 sfr at 0xE8 IEN1        ;
2696 // Bit registers
2697 sbit at 0xE8 ET2        ;
2698 #endif
2699
2700 #ifdef IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
2701 #undef IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
2702 sfr at 0xE8 IEN1        ; // Interrupt enable 1, P80C552 specific
2703 // Bit registers
2704 sbit at 0xE8 ECT0       ;
2705 sbit at 0xE9 ECT1       ;
2706 sbit at 0xEA ECT2       ;
2707 sbit at 0xEB ECT3       ;
2708 sbit at 0xEC ECM0       ;
2709 sbit at 0xED ECM1       ;
2710 sbit at 0xEE ECM2       ;
2711 sbit at 0xEF ET2        ;
2712 #endif
2713
2714 #ifdef IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
2715 #undef IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
2716 sfr at 0xB8 IEN1        ; // interrupt enable register - SAB80515 specific
2717 // Bit registers
2718 sbit at 0xB8 EADC       ; // A/D converter interrupt enable
2719 sbit at 0xB9 EX2        ;
2720 sbit at 0xBA EX3        ;
2721 sbit at 0xBB EX4        ;
2722 sbit at 0xBC EX5        ;
2723 sbit at 0xBD EX6        ;
2724 sbit at 0xBE SWDT       ; // watchdog timer start/reset
2725 sbit at 0xBF EXEN2      ; // timer2 external reload interrupt enable
2726 #endif
2727
2728 #ifdef IEN2__SAB80517
2729 #undef IEN2__SAB80517
2730 sfr at 0x9A IEN2        ; // interrupt enable register 2 SAB80517
2731 #endif
2732
2733 #ifdef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2734 #undef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2735 sfr at 0xB8 IP          ;
2736 // Bit registers
2737 sbit at 0xB8 PX0        ;
2738 sbit at 0xB9 PT0        ;
2739 sbit at 0xBA PX1        ;
2740 sbit at 0xBB PT1        ;
2741 sbit at 0xBC PS         ;
2742 #endif
2743
2744 #ifdef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2745 #undef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2746 sfr at 0xB8 IP          ;
2747 // Bit registers
2748 sbit at 0xB8 PX0        ;
2749 sbit at 0xB9 PT0        ;
2750 sbit at 0xBA PX1        ;
2751 sbit at 0xBB PT1        ;
2752 sbit at 0xBC PS         ;
2753 sbit at 0xBC PS0        ;  // alternate name
2754 sbit at 0xBD PT2        ;
2755 #endif
2756
2757 #ifdef IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
2758 #undef IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
2759 sfr at 0xB8 IP          ; // Interrupt priority 0, P80C552 specific
2760 sfr at 0xB8 IP0         ; // alternate name
2761 // Bit registers
2762 sbit at 0xB8 PX0        ;
2763 sbit at 0xB9 PT0        ;
2764 sbit at 0xBA PX1        ;
2765 sbit at 0xBB PT1        ;
2766 sbit at 0xBC PS0        ;
2767 sbit at 0xBD PS1        ;
2768 sbit at 0xBE PAD        ;
2769 #endif
2770
2771 #ifdef IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
2772 #undef IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
2773 sfr at 0xB8 IP          ;
2774 // Bit registers
2775 sbit at 0xB8 PX0        ;
2776 sbit at 0xB9 PT0        ;
2777 sbit at 0xBA PX1        ;
2778 sbit at 0xBB PT1        ;
2779 sbit at 0xBC PS         ;
2780 sbit at 0xBD PT2        ;
2781 sbit at 0xBE PPC        ;
2782 #endif
2783
2784 #ifdef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2785 #undef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2786 sfr at 0xB8 IP          ;
2787 // Bit registers
2788 sbit at 0xB8 PX0        ;
2789 sbit at 0xB9 PT0        ;
2790 sbit at 0xBA PX1        ;
2791 sbit at 0xBB PT1        ;
2792 sbit at 0xBC PS         ;
2793 sbit at 0xBD PT2        ;
2794 sbit at 0xBE PS1        ;
2795 #endif
2796
2797 #ifdef IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
2798 #undef IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
2799 // P89C668 specific:
2800 sfr at 0xB8 IP          ;
2801 // Bit registers
2802 sbit at 0xB8 PX0        ;
2803 sbit at 0xB9 PT0        ;
2804 sbit at 0xBA PX1        ;
2805 sbit at 0xBB PT1        ;
2806 sbit at 0xBC PS0        ;
2807 sbit at 0xBD PS1        ;
2808 sbit at 0xBE PPC        ;
2809 sbit at 0xBF PT2        ;
2810 #endif
2811
2812 #ifdef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2813 #undef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2814 sfr at 0xB8 IP          ;
2815 // Bit registers
2816 sbit at 0xB8 PX0        ;
2817 sbit at 0xB9 PT0        ;
2818 sbit at 0xBA PX1        ;
2819 sbit at 0xBB PT1        ;
2820 sbit at 0xBC PS         ;
2821 sbit at 0xBF RWT        ;
2822 #endif
2823
2824 #ifdef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2825 #undef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2826 sfr at 0xA9 IP0         ; // interrupt priority register SAB80515 specific
2827 // Not directly accessible IP0 bits
2828 #define IP0_0       0x01
2829 #define IP0_1       0x02
2830 #define IP0_2       0x04
2831 #define IP0_3       0x08
2832 #define IP0_4       0x10
2833 #define IP0_5       0x20
2834 #define WDTS        0x40
2835 #endif
2836
2837 #ifdef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2838 #undef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2839 sfr at 0xB8 IP0         ; // interrupt priority register DS89C420 specific
2840 // Not directly accessible IP0 bits
2841 #define LPX0        0x01
2842 #define LPT0        0x02
2843 #define LPX1        0x04
2844 #define LPT1        0x08
2845 #define LPS0        0x10
2846 #define LPT2        0x20
2847 #define LPS1        0x40
2848 #endif
2849
2850 #ifdef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2851 #undef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2852 sfr at 0xB9 IP1         ; // interrupt priority register SAB80515 specific
2853 // Not directly accessible IP1 bits
2854 #define IP1_0       0x01
2855 #define IP1_1       0x02
2856 #define IP1_2       0x04
2857 #define IP1_3       0x08
2858 #define IP1_4       0x10
2859 #define IP1_5       0x20
2860 #endif
2861
2862 #ifdef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2863 #undef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2864 sfr at 0xB1 IP1         ; // interrupt priority register DS89C420 specific
2865 // Not directly accessible IP0 bits
2866 #define LPX0        0x01
2867 #define LPT0        0x02
2868 #define LPX1        0x04
2869 #define LPT1        0x08
2870 #define LPS0        0x10
2871 #define LPT2        0x20
2872 #define LPS1        0x40
2873 #endif
2874
2875 #ifdef IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
2876 #undef IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
2877 sfr at 0xF8 IP1         ; // Interrupt priority 1, P80C552 specific
2878 // Bit registers
2879 sbit at 0xF8 PCT0       ;
2880 sbit at 0xF9 PCT1       ;
2881 sbit at 0xFA PCT2       ;
2882 sbit at 0xFB PCT3       ;
2883 sbit at 0xFC PCM0       ;
2884 sbit at 0xFD PCM1       ;
2885 sbit at 0xFE PCM2       ;
2886 sbit at 0xFF PT2        ;
2887 #endif
2888
2889 #ifdef IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
2890 #undef IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
2891 sfr at 0xB7 IPH         ;
2892 #define PX0H        0x01
2893 #define PT0H        0x02
2894 #define PX1H        0x04
2895 #define PT1H        0x08
2896 #define PSH         0x10
2897 #define PT2H        0x20
2898 #define PPCH        0x40
2899 #endif
2900
2901 #ifdef IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
2902 #undef IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
2903 // P89C668 specific:
2904 sfr at 0xB7 IPH         ;
2905 // not bit addressable:
2906 #define PX0H        0x01
2907 #define PT0H        0x02
2908 #define PX1H        0x04
2909 #define PT1H        0x08
2910 #define PS0H        0x10
2911 #define PS1H        0x20
2912 #define PPCH        0x40
2913 #define PT2H        0x80
2914 #endif
2915
2916 #ifdef IRCON
2917 #undef IRCON
2918 sfr at 0xC0 IRCON       ; // interrupt control register - SAB80515 specific
2919 // Bit registers
2920 sbit at 0xC0 IADC       ; // A/D converter irq flag
2921 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2922 sbit at 0xC2 IEX3       ;
2923 sbit at 0xC3 IEX4       ;
2924 sbit at 0xC4 IEX5       ;
2925 sbit at 0xC5 IEX6       ;
2926 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2927 sbit at 0xC7 EXF2       ; // timer2 reload flag
2928 #endif
2929
2930 #ifdef IRCON0
2931 #undef IRCON0
2932 sfr at 0xC0 IRCON0      ; // interrupt control register - SAB80515 specific
2933 // Bit registers
2934 sbit at 0xC0 IADC       ; // A/D converter irq flag
2935 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2936 sbit at 0xC2 IEX3       ;
2937 sbit at 0xC3 IEX4       ;
2938 sbit at 0xC4 IEX5       ;
2939 sbit at 0xC5 IEX6       ;
2940 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2941 sbit at 0xC7 EXF2       ; // timer2 reload flag
2942 #endif
2943
2944 #ifdef IRCON1
2945 #undef IRCON1
2946 sfr at 0xD1 IRCON1      ; // interrupt control register - SAB80515 specific
2947 #endif
2948
2949 #ifdef MA
2950 #undef MA
2951 sfr at 0xD3 MA          ; // DS80C390
2952 #endif
2953
2954 #ifdef MB
2955 #undef MB
2956 sfr at 0xD4 MB          ; // DS80C390
2957 #endif
2958
2959 #ifdef MC
2960 #undef MC
2961 sfr at 0xD5 MC          ; // DS80C390
2962 #endif
2963
2964 #ifdef MCNT0
2965 #undef MCNT0
2966 sfr at 0xD1 MCNT0       ; // DS80C390
2967 #define MAS0        0x01
2968 #define MAS1        0x02
2969 #define MAS2        0x04
2970 #define MAS3        0x08
2971 #define MAS4        0x10
2972 #define SCB         0x20
2973 #define CSE         0x40
2974 #define LSHIFT      0x80
2975 #endif
2976
2977 #ifdef MCNT1
2978 #undef MCNT1
2979 sfr at 0xD2 MCNT1       ; // DS80C390
2980 #define CLM         0x10
2981 #define MOF         0x40
2982 #define MST         0x80
2983 #endif
2984
2985 #ifdef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2986 #undef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2987 sfr at 0xC6 MCON        ; // DS80C390
2988 #define PDCE0       0x01
2989 #define PDCE1       0x02
2990 #define PDCE2       0x04
2991 #define PDCE3       0x08
2992 #define CMA         0x20
2993 #define IDM0        0x40
2994 #define IDM1        0x80
2995 #endif
2996
2997 #ifdef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2998 #undef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2999 sfr at 0xC6 MCON        ; // DS5000
3000 #define SL          0x01
3001 #define PAA         0x02
3002 #define ECE2        0x04
3003 #define RA32_8      0x08
3004 #define PA0         0x10
3005 #define PA1         0x20
3006 #define PA2         0x40
3007 #define PA3         0x80
3008 #endif
3009
3010 #ifdef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
3011 #undef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
3012 sfr at 0xC6 MCON        ; // DS5001
3013 #define SL          0x01
3014 #define PM          0x02
3015 #define PES         0x04
3016 #define RG1         0x08
3017 #define PA0         0x10
3018 #define PA1         0x20
3019 #define PA2         0x40
3020 #define PA3         0x80
3021 #endif
3022
3023 #ifdef MD0
3024 #undef MD0
3025 sfr at 0xE9 MD0         ; // MUL / DIV register 0 SAB80517
3026 #endif
3027
3028 #ifdef MD1
3029 #undef MD1
3030 sfr at 0xEA MD1         ; // MUL / DIV register 1 SAB80517
3031 #endif
3032
3033 #ifdef MD2
3034 #undef MD2
3035 sfr at 0xEB MD2         ; // MUL / DIV register 2 SAB80517
3036 #endif
3037
3038 #ifdef MD3
3039 #undef MD3
3040 sfr at 0xEC MD3         ; // MUL / DIV register 3 SAB80517
3041 #endif
3042
3043 #ifdef MD4
3044 #undef MD4
3045 sfr at 0xED MD4         ; // MUL / DIV register 4 SAB80517
3046 #endif
3047
3048 #ifdef MD5
3049 #undef MD5
3050 sfr at 0xEE MD5         ; // MUL / DIV register 5 SAB80517
3051 #endif
3052
3053 #ifdef MXAX
3054 #undef MXAX
3055 sfr at 0xEA MXAX        ; // Dallas DS80C390
3056 #endif
3057
3058 #ifdef P0
3059 #undef P0
3060 sfr at 0x80 P0          ;
3061 //  Bit Registers
3062 sbit at 0x80 P0_0       ;
3063 sbit at 0x81 P0_1       ;
3064 sbit at 0x82 P0_2       ;
3065 sbit at 0x83 P0_3       ;
3066 sbit at 0x84 P0_4       ;
3067 sbit at 0x85 P0_5       ;
3068 sbit at 0x86 P0_6       ;
3069 sbit at 0x87 P0_7       ;
3070 #endif
3071
3072 #ifdef P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
3073 #undef P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
3074 // P89C668 alternate names for bits in P0
3075 sbit at 0x80 AD0        ;
3076 sbit at 0x81 AD1        ;
3077 sbit at 0x82 AD2        ;
3078 sbit at 0x83 AD3        ;
3079 sbit at 0x84 AD4        ;
3080 sbit at 0x85 AD5        ;
3081 sbit at 0x86 AD6        ;
3082 sbit at 0x87 AD7        ;
3083 #endif
3084
3085 #ifdef P1
3086 #undef P1
3087 sfr at 0x90 P1          ;
3088 // Bit registers
3089 sbit at 0x90 P1_0       ;
3090 sbit at 0x91 P1_1       ;
3091 sbit at 0x92 P1_2       ;
3092 sbit at 0x93 P1_3       ;
3093 sbit at 0x94 P1_4       ;
3094 sbit at 0x95 P1_5       ;
3095 sbit at 0x96 P1_6       ;
3096 sbit at 0x97 P1_7       ;
3097 #endif
3098
3099 #ifdef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
3100 #undef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
3101 // P1 alternate functions
3102 sbit at 0x90 T2         ;
3103 sbit at 0x91 T2EX       ;
3104 sbit at 0x92 RXD1       ;
3105 sbit at 0x93 TXD1       ;
3106 sbit at 0x94 INT2       ;
3107 sbit at 0x95 INT3       ;
3108 sbit at 0x96 INT4       ;
3109 sbit at 0x97 INT5       ;
3110 #endif
3111
3112 #ifdef P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3113 #undef P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3114 // P89C669 alternate names for bits at P1
3115 // P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3116 sbit at 0x90 T2         ;
3117 sbit at 0x91 T2EX       ;
3118 sbit at 0x92 ECI        ;
3119 sbit at 0x93 CEX0       ;
3120 sbit at 0x94 CEX1       ;
3121 sbit at 0x95 CEX2       ;
3122 sbit at 0x96 SCL        ;
3123 sbit at 0x97 SDA        ;
3124 #endif
3125
3126 #ifdef P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
3127 sbit at 0x90 INT3_CC0   ; // P1 alternate functions - SAB80515 specific
3128 sbit at 0x91 INT4_CC1   ;
3129 sbit at 0x92 INT5_CC2   ;
3130 sbit at 0x93 INT6_CC3   ;
3131 sbit at 0x94 INT2       ;
3132 sbit at 0x95 T2EX       ;
3133 sbit at 0x96 CLKOUT     ;
3134 sbit at 0x97 T2         ;
3135 #endif
3136
3137 #ifdef P1_EXT__CT0I__CT1I__CT2I__CT3I__T2__RT2__SCL__SDA
3138 #undef P1_EXT__CT0I__CT1I__CT2I__CT3I__T2__RT2__SCL__SDA
3139 // Bit registers
3140 sbit at 0x90 CT0I       ; // Port 1 alternate functions, P80C552 specific
3141 sbit at 0x91 CT1I       ;
3142 sbit at 0x92 CT2I       ;
3143 sbit at 0x93 CT3I       ;
3144 sbit at 0x94 T2         ;
3145 sbit at 0x95 RT2        ;
3146 sbit at 0x96 SCL        ;
3147 sbit at 0x97 SDA        ;
3148 #endif
3149
3150 #ifdef P1_EXT__x__x__x__x__x__x__T2EX__T2
3151 #undef P1_EXT__x__x__x__x__x__x__T2EX__T2
3152 // P1 alternate functions
3153 sbit at 0x90 T2         ;
3154 sbit at 0x91 T2EX       ;
3155 #endif
3156
3157 #ifdef P2
3158 #undef P2
3159 sfr at 0xA0 P2          ;
3160 // Bit registers
3161 sbit at 0xA0 P2_0       ;
3162 sbit at 0xA1 P2_1       ;
3163 sbit at 0xA2 P2_2       ;
3164 sbit at 0xA3 P2_3       ;
3165 sbit at 0xA4 P2_4       ;
3166 sbit at 0xA5 P2_5       ;
3167 sbit at 0xA6 P2_6       ;
3168 sbit at 0xA7 P2_7       ;
3169 #endif
3170
3171 #ifdef P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
3172 #undef P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
3173 // P89C668 specific bit registers at P2:
3174 sbit at 0xA0 AD8        ;
3175 sbit at 0xA1 AD9        ;
3176 sbit at 0xA2 AD10       ;
3177 sbit at 0xA3 AD11       ;
3178 sbit at 0xA4 AD12       ;
3179 sbit at 0xA5 AD13       ;
3180 sbit at 0xA6 AD14       ;
3181 sbit at 0xA7 AD15       ;
3182 #endif
3183
3184 #ifdef P3
3185 #undef P3
3186 sfr at 0xB0 P3          ;
3187 // Bit registers
3188 sbit at 0xB0 P3_0       ;
3189 sbit at 0xB1 P3_1       ;
3190 sbit at 0xB2 P3_2       ;
3191 sbit at 0xB3 P3_3       ;
3192 sbit at 0xB4 P3_4       ;
3193 sbit at 0xB5 P3_5       ;
3194 #ifndef MCS51REG_EXTERNAL_RAM
3195 sbit at 0xB6 P3_6       ;
3196 sbit at 0xB7 P3_7       ;
3197 #endif
3198 // alternate names
3199 sbit at 0xB0 RXD        ;
3200 sbit at 0xB0 RXD0       ;
3201 sbit at 0xB1 TXD        ;
3202 sbit at 0xB1 TXD0       ;
3203 sbit at 0xB2 INT0       ;
3204 sbit at 0xB3 INT1       ;
3205 sbit at 0xB4 T0         ;
3206 sbit at 0xB5 T1         ;
3207 #ifndef MCS51REG_EXTERNAL_RAM
3208 sbit at 0xB6 WR         ;
3209 sbit at 0xB7 RD         ;
3210 #endif
3211 #endif
3212
3213 #ifdef P3_EXT__x__x__CEX4__CEX3__x__x__x__x
3214 #undef P3_EXT__x__x__CEX4__CEX3__x__x__x__x
3215 // P89C668 specific bit registers at P3 (alternate names)
3216 sbit at 0xB5 CEX4       ;
3217 sbit at 0xB4 CEX3       ;
3218 #endif
3219
3220 #ifdef P4_AT_0X80
3221 #undef P4_AT_0X80
3222 sfr at 0x80 P4          ; // Port 4 - DS80C390
3223 // Bit registers
3224 sbit at 0x80 P4_0       ;
3225 sbit at 0x81 P4_1       ;
3226 sbit at 0x82 P4_2       ;
3227 sbit at 0x83 P4_3       ;
3228 sbit at 0x84 P4_4       ;
3229 sbit at 0x85 P4_5       ;
3230 sbit at 0x86 P4_6       ;
3231 sbit at 0x87 P4_7       ;
3232 #endif
3233
3234 #ifdef P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
3235 #undef P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
3236 sfr at 0xC0 P4          ; // Port 4, P80C552 specific
3237 // Bit registers
3238 sbit at 0xC0 CMSR0      ;
3239 sbit at 0xC1 CMSR1      ;
3240 sbit at 0xC2 CMSR2      ;
3241 sbit at 0xC3 CMSR3      ;
3242 sbit at 0xC4 CMSR4      ;
3243 sbit at 0xC5 CMSR5      ;
3244 sbit at 0xC6 CMT0       ;
3245 sbit at 0xC7 CMT1       ;
3246 #endif
3247
3248 #ifdef P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
3249 #undef P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
3250 sfr at 0xC0 P4          ; // Port 4, T89C51 specific
3251 // Bit registers
3252 sbit at 0xC0 P4_0       ;
3253 sbit at 0xC1 P4_1       ;
3254 sbit at 0xC2 P4_2       ;
3255 sbit at 0xC3 P4_3       ;
3256 sbit at 0xC4 P4_4       ;
3257 sbit at 0xC5 P4_5       ;
3258 sbit at 0xC6 P4_6       ;
3259 sbit at 0xC7 P4_7       ;
3260 #endif
3261
3262 #ifdef P4_AT_0XE8
3263 #undef P4_AT_0XE8
3264 sfr at 0xE8 P4          ; // Port 4 - SAB80515 & compatible microcontrollers
3265 // Bit registers
3266 sbit at 0xE8 P4_0       ;
3267 sbit at 0xE9 P4_1       ;
3268 sbit at 0xEA P4_2       ;
3269 sbit at 0xEB P4_3       ;
3270 sbit at 0xEC P4_4       ;
3271 sbit at 0xED P4_5       ;
3272 sbit at 0xEE P4_6       ;
3273 sbit at 0xEF P4_7       ;
3274 #endif
3275
3276 #ifdef P4CNT
3277 #undef P4CNT
3278 sfr at 0x92 P4CNT       ; // DS80C390
3279 // Not directly accessible bits
3280 #define P4CNT_0     0x01
3281 #define P4CNT_1     0x02
3282 #define P4CNT_2     0x04
3283 #define P4CNT_3     0x08
3284 #define P4CNT_4     0x10
3285 #define P4CNT_5     0x20
3286 #define SBCAN       0x40
3287 #endif
3288
3289 #ifdef P5_AT_0XA1
3290 #undef P5_AT_0XA1
3291 sfr at 0xA1 P5          ; // Port 5 - DS80C390
3292 #endif
3293
3294 #ifdef P5_AT_0XE8
3295 #undef P5_AT_0XE8
3296 sfr at 0xE8 P5          ; // Port 5 - T89C51RD2
3297 // Bit registers
3298 sbit at 0xE8 P5_0       ;
3299 sbit at 0xE9 P5_1       ;
3300 sbit at 0xEA P5_2       ;
3301 sbit at 0xEB P5_3       ;
3302 sbit at 0xEC P5_4       ;
3303 sbit at 0xED P5_5       ;
3304 sbit at 0xEE P5_6       ;
3305 sbit at 0xEF P5_7       ;
3306 #endif
3307
3308 #ifdef P5CNT
3309 #undef P5CNT
3310 sfr at 0xA2 P5CNT       ; // DS80C390
3311 // Not directly accessible bits
3312 #define P5CNT_0     0x01
3313 #define P5CNT_1     0x02
3314 #define P5CNT_2     0x04
3315 #define C0_I_O      0x08
3316 #define C1_I_O      0x10
3317 #define SP1EC       0x20
3318 #define SBCAN0BA    0x40
3319 #define SBCAN1BA    0x80
3320 #endif
3321
3322 #ifdef P5_AT_0XC4
3323 #undef P5_AT_0XC4
3324 sfr at 0xC4 P5          ; // Port 5, P80C552 specific
3325 // Not directly accessible Bits.
3326 #define ADC0        0x01
3327 #define ADC1        0x02
3328 #define ADC2        0x04
3329 #define ADC3        0x08
3330 #define ADC4        0x10
3331 #define ADC5        0x20
3332 #define ADC6        0x40
3333 #define ADC7        0x80
3334 #endif
3335
3336 #ifdef P5_AT_0XF8
3337 #undef P5_AT_0XF8
3338 sfr at 0xF8 P5          ; // Port 5 - SAB80515 & compatible microcontrollers
3339 // Bit registers
3340 sbit at 0xF8 P5_0       ;
3341 sbit at 0xF9 P5_1       ;
3342 sbit at 0xFA P5_2       ;
3343 sbit at 0xFB P5_3       ;
3344 sbit at 0xFC P5_4       ;
3345 sbit at 0xFD P5_5       ;
3346 sbit at 0xFE P5_6       ;
3347 sbit at 0xFF P5_7       ;
3348 #endif
3349
3350 #ifdef P6_AT_0XDB
3351 #undef P6_AT_0XDB
3352 sfr at 0xDB P6          ; // Port 6 - SAB80515 & compatible microcontrollers
3353 #endif
3354
3355 #ifdef P6_AT_0XFA
3356 #undef P6_AT_0XFA
3357 sfr at 0xFA P6          ; // Port 6 - SAB80517 specific
3358 #endif
3359
3360 #ifdef P7_AT_0XDB
3361 #undef P7_AT_0XDB
3362 sfr at 0xDB P7          ; // Port 7 - SAB80517 specific
3363 #endif
3364
3365 #ifdef P8_AT_0XDD
3366 #undef P8_AT_0XDD
3367 sfr at 0xDD P8          ; // Port 6 - SAB80517 specific
3368 #endif
3369
3370 #ifdef PCON__SMOD__x__x__x__x__x__x__x
3371 #undef PCON__SMOD__x__x__x__x__x__x__x
3372 sfr at 0x87 PCON        ;
3373 // Not directly accessible PCON bits
3374 #define SMOD        0x80
3375 #endif
3376
3377 #ifdef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
3378 #undef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
3379 sfr at 0x87 PCON        ;
3380 // Not directly accessible PCON bits
3381 #define IDL         0x01
3382 #define PD          0x02
3383 #define GF0         0x04
3384 #define GF1         0x08
3385 #define SMOD        0x80
3386 #endif
3387
3388 #ifdef PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
3389 #undef PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
3390 sfr at 0x87 PCON        ; // PCON, P80C552 specific
3391 // Not directly accessible Bits.
3392 #define IDL         0x01
3393 #define IDLE        0x01 /* same as IDL */
3394 #define PD          0x02
3395 #define GF0         0x04
3396 #define GF1         0x08
3397 #define WLE         0x10
3398 #define SMOD        0x80
3399 #endif
3400
3401 #ifdef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
3402 #undef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
3403 sfr at 0x87 PCON        ;
3404 // Not directly accessible PCON bits
3405 #define IDL         0x01
3406 #define IDLE        0x01 /* same as IDL */
3407 #define PD          0x02
3408 #define PDE         0x02 /* same as PD */
3409 #define IDLS        0x20
3410 #define PDS         0x40
3411 #define SMOD        0x80
3412 // alternate names
3413 #define PCON_IDLE   0x01
3414 #define PCON_PDE    0x02
3415 #define PCON_GF0    0x04
3416 #define PCON_GF1    0x08
3417 #define PCON_IDLS   0x20
3418 #define PCON_PDS    0x40
3419 #define PCON_SMOD   0x80
3420 #endif
3421
3422 #ifdef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
3423 #undef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
3424 sfr at 0x87 PCON        ;
3425 // Not directly accessible PCON bits
3426 #define IDL         0x01
3427 #define IDLE        0x01 /* same as IDL */
3428 #define STOP        0x02
3429 #define EWT         0x04
3430 #define EPFW        0x08
3431 #define WTR         0x10
3432 #define PFW         0x20
3433 #define POR         0x40
3434 #define SMOD        0x80
3435 #endif
3436
3437 #ifdef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
3438 #undef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
3439 sfr at 0x87 PCON        ;
3440 // Not directly accessible PCON bits
3441 #define IDL         0x01
3442 #define IDLE        0x01  /* same as IDL */
3443 #define STOP        0x02
3444 #define GF0         0x04
3445 #define GF1         0x08
3446 #define SMOD0       0x40
3447 #define SMOD        0x80
3448 #endif
3449
3450 #ifdef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
3451 #undef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
3452 sfr at 0x87 PCON        ;
3453 // Not directly accessible PCON bits
3454 #define IDL         0x01
3455 #define IDLE        0x01 /* same as IDL */
3456 #define STOP        0x02
3457 #define GF0         0x04
3458 #define GF1         0x08
3459 #define OFDE        0x10
3460 #define OFDF        0x20
3461 #define SMOD0       0x40
3462 #define SMOD        0x80
3463 #define SMOD_0      0x80 /* same as SMOD */
3464 #endif
3465
3466 #ifdef PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
3467 #undef PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
3468 sfr at 0x87 PCON        ;
3469 #define IDL         0x01
3470 #define PD          0x02
3471 #define GF0         0x04
3472 #define GF1         0x08
3473 #define POF         0x10
3474 #define SMOD0       0x40
3475 #define SMOD1       0x80
3476 #endif
3477
3478 #ifdef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
3479 #undef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
3480 sfr at 0xC4 PMR         ; // DS87C520, DS83C520
3481 // Not directly accessible bits
3482 #define DME0        0x01
3483 #define DME1        0x02
3484 #define ALEOFF      0x04
3485 #define XTOFF       0x08
3486 #define SWB         0x20
3487 #define CD0         0x40
3488 #define CD1         0x80
3489 #endif
3490
3491 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
3492 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
3493 sfr at 0xC4 PMR         ; // DS80C390
3494 // Not directly accessible bits
3495 #define ALEOFF      0x04
3496 #define XTOFF       0x08
3497 #define _4X_2X      0x10
3498 #define SWB         0x20
3499 #define CD0         0x40
3500 #define CD1         0x80
3501 #endif
3502
3503 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
3504 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
3505 sfr at 0xC4 PMR         ; // DS89C420
3506 // Not directly accessible bits
3507 #define DME0        0x01
3508 #define DME1        0x02
3509 #define ALEON       0x04
3510 #define _4X_2X      0x08
3511 #define CTM         0x10
3512 #define SWB         0x20
3513 #define CD0         0x40
3514 #define CD1         0x80
3515 #endif
3516
3517 #ifdef PSW
3518 #undef PSW
3519 sfr at 0xD0 PSW         ;
3520 // Bit registers
3521 sbit at 0xD0 P          ;
3522 sbit at 0xD1 F1         ;
3523 sbit at 0xD2 OV         ;
3524 sbit at 0xD3 RS0        ;
3525 sbit at 0xD4 RS1        ;
3526 sbit at 0xD5 F0         ;
3527 sbit at 0xD6 AC         ;
3528 sbit at 0xD7 CY         ;
3529 #endif
3530
3531 #ifdef PWM0_AT_0XFC
3532 #undef PWM0_AT_0XFC
3533 sfr at 0xFC PWM0        ; // PWM register 0, P80C552 specific
3534 #endif
3535
3536 #ifdef PWM1_AT_0XFD
3537 #undef PWM1_AT_0XFD
3538 sfr at 0xFD PWM1        ; // PWM register 1, P80C552 specific
3539 #endif
3540
3541 #ifdef PWMP_AT_0XFE
3542 #undef PWMP_AT_0XFE
3543 sfr at 0xFE PWMP        ; // PWM prescaler, P80C552 specific
3544 #endif
3545
3546 #ifdef RCAP2H
3547 #undef RCAP2H
3548 sfr at 0xCB RCAP2H      ;
3549 #endif
3550
3551 #ifdef RCAP2L
3552 #undef RCAP2L
3553 sfr at 0xCA RCAP2L      ;
3554 #endif
3555
3556 #ifdef RNR
3557 #undef RNR
3558 sfr at 0xCF RNR         ;
3559 #endif
3560
3561 #ifdef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
3562 #undef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
3563 sfr at 0xC2 ROMSIZE     ; // DS87C520, DS83C520
3564 // Not directly accessible bits
3565 #define RSM0        0x01
3566 #define RSM1        0x02
3567 #define RSM2        0x04
3568 #endif
3569
3570 #ifdef ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
3571 #undef ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
3572 sfr at 0xC2 ROMSIZE     ; // DS89C420
3573 // Not directly accessible bits
3574 #define RSM0        0x01
3575 #define RSM1        0x02
3576 #define RSM2        0x04
3577 #define PRAME       0x08
3578 #endif
3579
3580 #ifdef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
3581 #undef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
3582 sfr at 0xC2 ROMSIZE     ; // DS87C520, DS83C520
3583 // Not directly accessible bits
3584 #define RSM0        0x01
3585 #define RSM1        0x02
3586 #define RSM2        0x04
3587 #define PRAME       0x08
3588 #define MOVCX       0x10
3589 #define TE          0x20
3590 #define BPF         0x40
3591 #define HBPF        0x80
3592 #endif
3593
3594 #ifdef RPCTL
3595 #undef RPCTL
3596 sfr at 0xD8 RPCTL       ;  // Dallas DS5001 specific
3597 sbit at 0xD8 RG0        ;
3598 sbit at 0xD9 RPCON      ;
3599 sbit at 0xDA DMA        ;
3600 sbit at 0xDB IBI        ;
3601 sbit at 0xDC AE         ;
3602 sbit at 0xDD EXBS       ;
3603 sbit at 0xDF RNR_FLAG   ;
3604 #endif
3605
3606 #ifdef RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
3607 #undef RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
3608 sfr at 0xEF RTE         ; // Reset/toggle enable, P80C552 specific
3609 // Not directly accessible Bits.
3610 #define RP40        0x01
3611 #define RP41        0x02
3612 #define RP42        0x04
3613 #define RP43        0x08
3614 #define RP44        0x10
3615 #define RP45        0x20
3616 #define TP46        0x40
3617 #define TP47        0x80
3618 #endif
3619
3620 #ifdef S0BUF
3621 #undef S0BUF
3622 sfr at 0x99 S0BUF       ; // serial channel 0 buffer register SAB80517 specific
3623 #endif
3624
3625 #ifdef S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
3626 #undef S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
3627 sfr at 0x98 S0CON       ; // serial channel 0 control register P80C552 specific
3628 // Bit registers
3629 // Already defined in SCON
3630 //sbit at 0x98 RI0  ;
3631 //sbit at 0x99 TI0  ;
3632 //sbit at 0x9A RB8  ;
3633 //sbit at 0x9B TB8  ;
3634 //sbit at 0x9C REN  ;
3635 //sbit at 0x9D SM2  ;
3636 //sbit at 0x9E SM1  ;
3637 //sbit at 0x9F SM0  ;
3638 #endif
3639
3640 #ifdef S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
3641 #undef S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
3642 // serial channel 0 buffer register SAB80517 specific(same as stock SCON)
3643 sfr at 0x98 S0CON       ;
3644 sbit at 0x98 RI0        ;
3645 sbit at 0x99 TI0        ;
3646 sbit at 0x9A RB80       ;
3647 sbit at 0x9B TB80       ;
3648 sbit at 0x9C REN0       ;
3649 sbit at 0x9D SM20       ;
3650 sbit at 0x9E SM1        ;
3651 sbit at 0x9F SM0        ;
3652 #endif
3653
3654 #ifdef S0RELL
3655 #undef S0RELL
3656 sfr at 0xAA S0RELL      ; // serial channel 0 reload register low byte SAB80517 specific
3657 #endif
3658
3659 #ifdef S0RELH
3660 #undef S0RELH
3661 sfr at 0xBA S0RELH      ; // serial channel 0 reload register high byte SAB80517 specific
3662 #endif
3663
3664 #ifdef S1ADR__x__x__x__x__x__x__x__GC
3665 #undef S1ADR__x__x__x__x__x__x__x__GC
3666 sfr at 0xDB S1ADR       ; // Serial 1 address, P80C552 specific
3667 // Not directly accessible Bits.
3668 #define GC      0x01
3669 #endif
3670
3671 #ifdef S1BUF
3672 #undef S1BUF
3673 sfr at 0x9C S1BUF       ; // serial channel 1 buffer register SAB80517 specific
3674 #endif
3675
3676 #ifdef S1CON_AT_0X9B
3677 #undef S1CON_AT_0X9B
3678 sfr at 0x9B S1CON       ; // serial channel 1 control register SAB80517 specific
3679 #endif
3680
3681 #ifdef S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
3682 #undef S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
3683 sfr at 0xD8 S1CON       ; // Serial 1 control, P80C552 specific
3684 sfr at 0xD8 SICON       ; // sometimes called SICON
3685 // Bit register
3686 sbit at 0xD8 CR0        ;
3687 sbit at 0xD9 CR1        ;
3688 sbit at 0xDA AA         ;
3689 sbit at 0xDB SI         ;
3690 sbit at 0xDC ST0        ;
3691 sbit at 0xDD STA        ;
3692 sbit at 0xDE ENS1       ;
3693 sbit at 0xDF CR2        ;
3694 #endif
3695
3696 #ifdef S1DAT_AT_0XDA
3697 #undef S1DAT_AT_0XDA
3698 sfr at 0xDA S1DAT       ; // Serial 1 data, P80C552 specific
3699 sfr at 0xDA SIDAT       ; // sometimes called SIDAT
3700 #endif
3701
3702 #ifdef S1IST_AT_0XDC
3703 #undef S1IST_AT_0XDC
3704 // P89C668 specific
3705 sfr at 0xDC S1IST       ;
3706 #endif
3707
3708 #ifdef S1RELL
3709 #undef S1RELL
3710 sfr at 0x9D S1RELL      ; // serial channel 1 reload register low byte SAB80517 specific
3711 #endif
3712
3713 #ifdef S1RELH
3714 #undef S1RELH
3715 sfr at 0xBB S1RELH      ; // serial channel 1 reload register high byte SAB80517 specific
3716 #endif
3717
3718 #ifdef S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
3719 #undef S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
3720 sfr at 0xD9 S1STA       ; // Serial 1 status, P80C552 specific
3721 // Not directly accessible Bits.
3722 #define SC0         0x08
3723 #define SC1         0x10
3724 #define SC2         0x20
3725 #define SC3         0x40
3726 #define SC4         0x80
3727 #endif
3728
3729 #ifdef SADR_AT_0XA9
3730 #undef SADR_AT_0XA9
3731 sfr at 0xA9 SADDR       ;
3732 #endif
3733
3734 #ifdef SADDR0
3735 #undef SADDR0
3736 // DS80C320 specific
3737 sfr at 0xA9 SADDR0      ;
3738 #endif
3739
3740 #ifdef SADDR1
3741 #undef SADDR1
3742 // DS80C320 specific
3743 sfr at 0xAA SADDR1      ;
3744 #endif
3745
3746 #ifdef SADEN_AT_0XB9
3747 #undef SADEN_AT_0XB9
3748 sfr at 0xB9 SADEN       ;
3749 #endif
3750
3751 #ifdef SADEN0
3752 #undef SADEN0
3753 // DS80C320 & DS80C390 specific
3754 sfr at 0xB9 SADEN0      ;
3755 #endif
3756
3757 #ifdef SADEN1
3758 #undef SADEN1
3759 // DS80C320 & DS80C390 specific
3760 sfr at 0xBA SADEN1      ;
3761 #endif
3762
3763 #ifdef SBUF
3764 #undef SBUF
3765 sfr at 0x99 SBUF        ;
3766 sfr at 0x99 SBUF0       ;
3767 #endif
3768
3769 #ifdef SBUF1
3770 #undef SBUF1
3771 // DS80C320 & DS80C390 specific
3772 sfr at 0xC1 SBUF1       ;
3773 #endif
3774
3775 #ifdef SCON
3776 #undef SCON
3777 sfr at 0x98 SCON        ;
3778 // Bit registers
3779 sbit at 0x98 RI         ;
3780 sbit at 0x99 TI         ;
3781 sbit at 0x9A RB8        ;
3782 sbit at 0x9B TB8        ;
3783 sbit at 0x9C REN        ;
3784 sbit at 0x9D SM2        ;
3785 sbit at 0x9E SM1        ;
3786 sbit at 0x9F SM0        ;
3787 #endif
3788
3789 #ifdef SCON0
3790 #undef SCON0
3791 sfr at 0x98 SCON0       ;
3792 // Bit registers
3793 sbit at 0x98 RI_0       ;
3794 sbit at 0x99 TI_0       ;
3795 sbit at 0x9A RB8_0      ;
3796 sbit at 0x9B TB8_0      ;
3797 sbit at 0x9C REN_0      ;
3798 sbit at 0x9D SM2_0      ;
3799 sbit at 0x9E SM1_0      ;
3800 sbit at 0x9F SM0_0      ;
3801 sbit at 0x9F FE_0       ;
3802 sbit at 0x9F SM0_FE_0   ;
3803 #endif
3804
3805 #ifdef SCON1
3806 #undef SCON1
3807 // DS80C320 - 80C390 specific
3808 sfr at 0xC0 SCON1       ;
3809 // Bit registers
3810 sbit at 0xC0 RI_1       ;
3811 sbit at 0xC1 TI_1       ;
3812 sbit at 0xC2 RB8_1      ;
3813 sbit at 0xC3 TB8_1      ;
3814 sbit at 0xC4 REN_1      ;
3815 sbit at 0xC5 SM2_1      ;
3816 sbit at 0xC6 SM1_1      ;
3817 sbit at 0xC7 SM0_1      ;
3818 sbit at 0xC7 FE_1       ;
3819 sbit at 0xC7 SM0_FE_1   ;
3820 #endif
3821
3822 #ifdef SP
3823 #undef SP
3824 sfr at 0x81 SP          ;
3825 #endif
3826
3827 #ifdef SPCR
3828 #undef SPCR
3829 sfr at 0xD5 SPCR        ; // AT89S53 specific
3830 // Not directly accesible bits
3831 #define SPR0        0x01
3832 #define SPR1        0x02
3833 #define CPHA        0x04
3834 #define CPOL        0x08
3835 #define MSTR        0x10
3836 #define DORD        0x20
3837 #define SPE         0x40
3838 #define SPIE        0x80
3839 #endif
3840
3841 #ifdef SPDR
3842 #undef SPDR
3843 sfr at 0x86 SPDR        ; // AT89S53 specific
3844 // Not directly accesible bits
3845 #define SPD_0       0x01
3846 #define SPD_1       0x02
3847 #define SPD_2       0x04
3848 #define SPD_3       0x08
3849 #define SPD_4       0x10
3850 #define SPD_5       0x20
3851 #define SPD_6       0x40
3852 #define SPD_7       0x80
3853 #endif
3854
3855 #ifdef SPSR
3856 #undef SPSR
3857 sfr at 0xAA SPSR        ; // AT89S53 specific
3858 // Not directly accesible bits
3859 #define SPIF        0x40
3860 #define WCOL        0x80
3861 #endif
3862
3863 #ifdef SRELH
3864 #undef SRELH
3865 sfr at 0xBA SRELH       ; // Baudrate generator reload high
3866 #endif
3867
3868 #ifdef SRELL
3869 #undef SRELL
3870 sfr at 0xAA SRELL       ; // Baudrate generator reload low
3871 #endif
3872
3873 #ifdef STATUS__PIP__HIP__LIP__x__x__x__x__x
3874 #undef STATUS__PIP__HIP__LIP__x__x__x__x__x
3875 // DS80C320 specific
3876 sfr at 0xC5 STATUS      ;
3877 // Not directly accessible Bits. DS80C320 specific
3878 #define LIP         0x20
3879 #define HIP         0x40
3880 #define PIP         0x80
3881 #endif
3882
3883 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3884 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3885 sfr at 0xC5 STATUS      ; // DS80C390 specific
3886 // Not directly accessible Bits.
3887 #define SPRA0       0x01
3888 #define SPTA0       0x02
3889 #define SPRA1       0x04
3890 #define SPTA1       0x08
3891 #define LIP         0x20
3892 #define HIP         0x40
3893 #define PIP         0x80
3894 #endif
3895
3896 #ifdef STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
3897 #undef STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
3898 sfr at 0xC5 STATUS      ; // DS89C420 specific
3899 // Not directly accessible Bits.
3900 #define SPRA0       0x01
3901 #define SPTA0       0x02
3902 #define SPRA1       0x04
3903 #define SPTA1       0x08
3904 #define PIS0        0x20
3905 #define PIS1        0x40
3906 #define PIS2        0x80
3907 #endif
3908
3909 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3910 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3911 sfr at 0xC5 STATUS      ; // DS80C390 specific
3912 // Not directly accessible Bits.
3913 #define SPRA0       0x01
3914 #define SPTA0       0x02
3915 #define SPRA1       0x04
3916 #define SPTA1       0x08
3917 #define LIP         0x20
3918 #define HIP         0x40
3919 #define PIP         0x80
3920 #endif
3921
3922 #ifdef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
3923 #undef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
3924 sfr at 0xC5 STATUS      ; // DS87C520 & DS83520specific
3925 // Not directly accessible Bits.
3926 #define SPRA0       0x01
3927 #define SPTA0       0x02
3928 #define SPTA1       0x04
3929 #define SPTA2       0x08
3930 #define XTUP        0x10
3931 #define LIP         0x20
3932 #define HIP         0x40
3933 #define PIP         0x80
3934 #endif
3935
3936 #ifdef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
3937 #undef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
3938 sfr at 0xDA STATUS      ; // DS5001specific
3939 // Not directly accessible Bits.
3940 #define OBF         0x01
3941 #define IBF         0x02
3942 #define F0          0x04
3943 #define IA0         0x08
3944 #define ST4         0x10
3945 #define ST5         0x20
3946 #define ST6         0x40
3947 #define ST7         0x80
3948 #endif
3949
3950 #ifdef STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
3951 #undef STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
3952 sfr at 0xEE STE         ; // Set enable, P80C552 specific
3953 // Not directly accessible Bits.
3954 #define SP40        0x01
3955 #define SP41        0x02
3956 #define SP42        0x04
3957 #define SP43        0x08
3958 #define SP44        0x10
3959 #define SP45        0x20
3960 #define TG46        0x40
3961 #define TG47        0x80
3962 #endif
3963
3964 #ifdef SYSCON
3965 #undef SYSCON
3966 sfr at 0xB1 SYSCON      ; // XRAM Controller Access Control
3967 // SYSCON bits
3968 #define SYSCON_XMAP0 0x01
3969 #define SYSCON_XMAP1 0x02
3970 #define SYSCON_RMAP  0x10
3971 #define SYSCON_EALE  0x20
3972 #endif
3973
3974 #ifdef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
3975 #undef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
3976 sfr at 0xC8 T2CON       ;
3977 // Definitions for the 8052 compatible microcontrollers.
3978 // Bit registers
3979 sbit at 0xC8 CP_RL2     ;
3980 sbit at 0xC9 C_T2       ;
3981 sbit at 0xCA TR2        ;
3982 sbit at 0xCB EXEN2      ;
3983 sbit at 0xCC TCLK       ;
3984 sbit at 0xCD RCLK       ;
3985 sbit at 0xCE EXF2       ;
3986 sbit at 0xCF TF2        ;
3987 // alternate names
3988 sbit at 0xC8 T2CON_0    ;
3989 sbit at 0xC9 T2CON_1    ;
3990 sbit at 0xCA T2CON_2    ;
3991 sbit at 0xCB T2CON_3    ;
3992 sbit at 0xCC T2CON_4    ;
3993 sbit at 0xCD T2CON_5    ;
3994 sbit at 0xCE T2CON_6    ;
3995 sbit at 0xCF T2CON_7    ;
3996 #endif
3997
3998 #ifdef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
3999 #undef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
4000 sfr at 0xC8 T2CON       ;
4001 // Definitions for the Infineon / Siemens SAB80515, SAB80515A, SAB80517
4002 // Bit registers
4003 sbit at 0xC8 T2I0       ;
4004 sbit at 0xC9 T2I1       ;
4005 sbit at 0xCA T2CM       ;
4006 sbit at 0xCB T2R0       ;
4007 sbit at 0xCC T2R1       ;
4008 sbit at 0xCD I2FR       ;
4009 sbit at 0xCE I3FR       ;
4010 sbit at 0xCF T2PS       ;
4011 // alternate names
4012 sbit at 0xC8 T2CON_0    ;
4013 sbit at 0xC9 T2CON_1    ;
4014 sbit at 0xCA T2CON_2    ;
4015 sbit at 0xCB T2CON_3    ;
4016 sbit at 0xCC T2CON_4    ;
4017 sbit at 0xCD T2CON_5    ;
4018 sbit at 0xCE T2CON_6    ;
4019 sbit at 0xCF T2CON_7    ;
4020 #endif
4021
4022 #ifdef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
4023 #undef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
4024 // Definitions for the timer/counter 2 of the Atmel & Dallas microcontrollers
4025 sfr at 0xC9 T2MOD       ;
4026 // Not not directly accessible T2MOD bits
4027 #define DCEN        0x01
4028 #define T2OE        0x02
4029 #define D13T2       0x08
4030 #define D13T1       0x10
4031 #endif
4032
4033 #ifdef T2MOD__x__x__x__x__x__x__T2OE__DCEN
4034 #undef T2MOD__x__x__x__x__x__x__T2OE__DCEN
4035 // Definitions for the timer/counter 2 of the Atmel 89x52 microcontroller
4036 sfr at 0xC9 T2MOD       ;
4037 // Not not directly accessible T2MOD bits
4038 #define DCEN        0x01
4039 #define T2OE        0x02
4040 // Alternate names
4041 #define DCEN_       0x01
4042 #define T2OE_       0x02
4043 #endif
4044
4045 #ifdef T3_AT_0XFF
4046 #undef T3_AT_0XFF
4047 sfr at 0xFF T3          ; // Timer 3, P80C552 specific
4048 #endif
4049
4050 #ifdef TA
4051 #undef TA
4052 // DS500x, DS80C320 & DS80C390 specific
4053 sfr at 0xC7 TA          ;
4054 #endif
4055
4056 #ifdef TCON
4057 #undef TCON
4058 sfr at 0x88 TCON        ;
4059 //  Bit registers
4060 sbit at 0x88 IT0        ;
4061 sbit at 0x89 IE0        ;
4062 sbit at 0x8A IT1        ;
4063 sbit at 0x8B IE1        ;
4064 sbit at 0x8C TR0        ;
4065 sbit at 0x8D TF0        ;
4066 sbit at 0x8E TR1        ;
4067 sbit at 0x8F TF1        ;
4068 #endif
4069
4070 #ifdef TH0
4071 #undef TH0
4072 sfr at 0x8C TH0         ;
4073 #endif
4074
4075 #ifdef TH1
4076 #undef TH1
4077 sfr at 0x8D TH1         ;
4078 #endif
4079
4080 #ifdef TH2
4081 #undef TH2
4082 sfr at 0xCD TH2         ;
4083 #endif
4084
4085 #ifdef TL0
4086 #undef TL0
4087 sfr at 0x8A TL0         ;
4088 #endif
4089
4090 #ifdef TL1
4091 #undef TL1
4092 sfr at 0x8B TL1         ;
4093 #endif
4094
4095 #ifdef TL2
4096 #undef TL2
4097 sfr at 0xCC TL2         ;
4098 #endif
4099
4100 #ifdef TMOD
4101 #undef TMOD
4102 sfr at 0x89 TMOD        ;
4103 // Not directly accessible TMOD bits
4104 #define T0_M0       0x01
4105 #define T0_M1       0x02
4106 #define T0_CT       0x04
4107 #define T0_GATE     0x08
4108 #define T1_M0       0x10
4109 #define T1_M1       0x20
4110 #define T1_CT       0x40
4111 #define T1_GATE     0x80
4112
4113 #define T0_MASK     0x0F
4114 #define T1_MASK     0xF0
4115 #endif
4116
4117 #ifdef TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
4118 #undef TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
4119 sfr at 0xEA TM2CON      ; // Timer 2 control, P80C552 specific
4120 // Not directly accessible Bits.
4121 #define T2MS0       0x01
4122 #define T2MS1       0x02
4123 #define T2P0        0x04
4124 #define T2P1        0x08
4125 #define T2B0        0x10
4126 #define T2ER        0x20
4127 #define T2IS0       0x40
4128 #define T2IS1       0x80
4129 #endif
4130
4131 #ifdef TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
4132 #undef TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
4133 sfr at 0xC8 TM2IR       ; // Timer 2 int flag reg, P80C552 specific
4134 // Bit register
4135 sbit at 0xC8 CTI0       ;
4136 sbit at 0xC9 CTI1       ;
4137 sbit at 0xCA CTI2       ;
4138 sbit at 0xCB CTI3       ;
4139 sbit at 0xCC CMI0       ;
4140 sbit at 0xCD CMI1       ;
4141 sbit at 0xCE CMI2       ;
4142 sbit at 0xCF T20V       ;
4143 #endif
4144
4145 #ifdef TMH2_AT_0XED
4146 #undef TMH2_AT_0XED
4147 sfr at 0xED TMH2        ; // Timer high 2, P80C552 specific
4148 #endif
4149
4150 #ifdef TML2_AT_0XEC
4151 #undef TML2_AT_0XEC
4152 sfr at 0xEC TML2        ; // Timer low 2, P80C552 specific
4153 #endif
4154
4155 #ifdef WCON
4156 #undef WCON
4157 sfr at 0x96 WCON        ;   // AT89S53 specific
4158 // Not directly accesible bits
4159 #define WDTEN       0x01
4160 #define WDTRST      0x02
4161 #define DPS         0x04
4162 #define PS0         0x20
4163 #define PS1         0x40
4164 #define PS2         0x80
4165 #endif
4166
4167 #ifdef WDCON
4168 #undef WDCON
4169 // DS80C320 - 390, DS89C420, etc. specific
4170 sfr at 0xD8 WDCON       ;
4171 //  Bit registers
4172 sbit at 0xD8 RWT        ;
4173 sbit at 0xD9 EWT        ;
4174 sbit at 0xDA WTRF       ;
4175 sbit at 0xDB WDIF       ;
4176 sbit at 0xDC PFI        ;
4177 sbit at 0xDD EPFI       ;
4178 sbit at 0xDE POR        ;
4179 sbit at 0xDF SMOD_1     ;
4180 #endif
4181
4182 #ifdef WDTPRG_AT_0XA7
4183 #undef WDTPRG_AT_0XA7
4184 sfr at 0xA7 WDTPRG      ;
4185 #define WDTRPRG_S0  0x01
4186 #define WDTRPRG_S1  0x02
4187 #define WDTRPRG_S2  0x04
4188 #endif
4189
4190 #ifdef WDTREL
4191 #undef WDTREL
4192 sfr at 0x86 WDTREL      ; // Watchdof Timer reload register
4193 #endif
4194
4195 #ifdef WDTRST_AT_0XA6
4196 #undef WDTRST_AT_0XA6
4197 sfr at 0xA6 WDTRST      ;
4198 #endif
4199
4200 #ifdef XPAGE
4201 #undef XPAGE
4202 sfr at 0x91 XPAGE       ; // Page Address Register for Extended On-Chip Ram - Infineon / Siemens SAB80515A specific
4203 #endif
4204
4205 /////////////////////////
4206 /// Interrupt vectors ///
4207 /////////////////////////
4208
4209 // Interrupt numbers: address = (number * 8) + 3
4210 #define IE0_VECTOR      0       // 0x03 external interrupt 0
4211 #define TF0_VECTOR      1       // 0x0b timer 0
4212 #define IE1_VECTOR      2       // 0x13 external interrupt 1
4213 #define TF1_VECTOR      3       // 0x1b timer 1
4214 #define SI0_VECTOR      4       // 0x23 serial port 0
4215
4216 #ifdef MICROCONTROLLER_AT89S53
4217 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4218 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
4219 #endif
4220
4221 #ifdef MICROCONTROLLER_AT89X52
4222 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4223 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
4224 #endif
4225
4226 #ifdef MICROCONTROLLER_AT89X55
4227 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4228 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
4229 #endif
4230
4231 #ifdef MICROCONTROLLER_DS5000
4232 #define PFW_VECTOR      5       /* 0x2B */
4233 #endif
4234
4235 #ifdef MICROCONTROLLER_DS5001
4236 #define PFW_VECTOR      5       /* 0x2B */
4237 #endif
4238
4239 #ifdef MICROCONTROLLER_DS80C32X
4240 #define TF2_VECTOR      5       /* 0x2B */
4241 #define PFI_VECTOR      6       /* 0x33 */
4242 #define SIO1_VECTOR     7       /* 0x3B */
4243 #define IE2_VECTOR      8       /* 0x43 */
4244 #define IE3_VECTOR      9       /* 0x4B */
4245 #define IE4_VECTOR     10       /* 0x53 */
4246 #define IE5_VECTOR     11       /* 0x5B */
4247 #define WDI_VECTOR     12       /* 0x63 */
4248 #endif
4249
4250 #ifdef MICROCONTROLLER_DS8XC520
4251 #define TF2_VECTOR      5       /* 0x2B */
4252 #define PFI_VECTOR      6       /* 0x33 */
4253 #define SIO1_VECTOR     7       /* 0x3B */
4254 #define IE2_VECTOR      8       /* 0x43 */
4255 #define IE3_VECTOR      9       /* 0x4B */
4256 #define IE4_VECTOR     10       /* 0x53 */
4257 #define IE5_VECTOR     11       /* 0x5B */
4258 #define WDI_VECTOR     12       /* 0x63 */
4259 #endif
4260
4261 #ifdef MICROCONTROLLER_P80C552
4262 #define SIO1_VECTOR     5       // 0x2B SIO1 (I2C)
4263 #define CT0_VECTOR      6       // 0x33 T2 capture 0
4264 #define CT1_VECTOR      7       // 0x3B T2 capture 1
4265 #define CT2_VECTOR      8       // 0x43 T2 capture 2
4266 #define CT3_VECTOR      9       // 0x4B T2 capture 3
4267 #define ADC_VECTOR     10       // 0x53 ADC completion
4268 #define CM0_VECTOR     11       // 0x5B T2 compare 0
4269 #define CM1_VECTOR     12       // 0x63 T2 compare 1
4270 #define CM2_VECTOR     13       // 0x6B T2 compare 2
4271 #define TF2_VECTOR     14       // 0x73 T2 overflow
4272 #endif
4273
4274 #ifdef MICROCONTROLLER_P89C668
4275 #define SIO1_VECTOR     5       // 0x2b SIO1 (i2c)
4276 #define PCA_VECTOR      6       // 0x33 (Programmable Counter Array)
4277 #define TF2_VECTOR      7       // 0x3B (Timer 2)
4278 #endif
4279
4280 #ifdef MICROCONTROLLER_SAB80515
4281 #define TF2_VECTOR      5       // 0x2B timer 2
4282 #define EX2_VECTOR      5       // 0x2B external interrupt 2
4283 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
4284 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
4285 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
4286 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
4287 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
4288 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
4289 #endif
4290
4291 #ifdef MICROCONTROLLER_SAB80515A
4292 #define TF2_VECTOR      5       // 0x2B timer 2
4293 #define EX2_VECTOR      5       // 0x2B external interrupt 2
4294 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
4295 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
4296 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
4297 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
4298 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
4299 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
4300 #endif
4301
4302 #ifdef MICROCONTROLLER_SAB80517
4303 #define TF2_VECTOR      5       // 0x2B timer 2
4304 #define EX2_VECTOR      5       // 0x2B external interrupt 2
4305 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
4306 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
4307 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
4308 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
4309 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
4310 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
4311                                 // 0x73 not used
4312                                 // 0x7B not used
4313 #define SI1_VECTOR     16       // 0x83 serial port 1
4314                                 // 0x8B not used
4315                                 // 0x93 not used
4316 #define COMPARE_VECTOR 19       // 0x9B compare
4317 #endif
4318
4319 #ifdef MICROCONTORLLER_T89C51RD2
4320 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4321 #define PCA_VECTOR      6       /* 0x33 Programmable Counter Array interrupt */
4322 #endif /* MICROCONTORLLER_T89C51RD2 */
4323
4324 #endif  // End of the header -> #ifndef MCS51REG_H