Philips P89C668 support added by Eric Limpers
[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 for the programmer if external ROM used.
145    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0 & P2.
146
147    Ports P0, P2, P3_6, WR, P3_7 & RD are not available for the programmer if
148    external RAM is used.
149    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
150    P3_6, WR, P3_7 & RD.
151
152    #define MCS51REG_ENABLE_WARNINGS -> enable warnings
153
154 -----------------------------------------------------------------------*/
155
156
157 #ifndef HEADER_MCS51REG
158 #define HEADER_MCS51REG
159
160 ///////////////////////////////////////////////////////
161 ///  Insert header here (for developers only)       ///
162 ///  remove "//" from the begining of the next line ///
163 //#include "mcs51reg_update.h"                      ///
164 ///////////////////////////////////////////////////////
165
166 //////////////////////////////////
167 ///  Describe microcontrollers ///
168 ///  (inventory of registers)  ///
169 //////////////////////////////////
170
171 // definitions for the 8051
172 #ifdef MICROCONTROLLER_8051
173 #ifdef MICROCONTROLLER_DEFINED
174 #define MCS51REG_ERROR
175 #endif
176 #ifndef MICROCONTROLLER_DEFINED
177 #define MICROCONTROLLER_DEFINED
178 #endif
179 #ifdef MCS51REG_ENABLE_WARNINGS
180 #warning Selected HW: 8051
181 #endif
182 #define P0
183 #define SP
184 #define DPL
185 #define DPH
186 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
187 #define TCON
188 #define TMOD
189 #define TL0
190 #define TL1
191 #define TH0
192 #define TH1
193 #define P1
194 #define SCON
195 #define SBUF
196 #define P2
197 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
198 #define P3
199 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
200 #define PSW
201 #define ACC
202 #define B
203 #endif
204 // end of definitions for the 8051
205
206
207 // definitions for the 8052 microcontroller
208 #ifdef MICROCONTROLLER_8052
209 #ifdef MICROCONTROLLER_DEFINED
210 #define MCS51REG_ERROR
211 #endif
212 #ifndef MICROCONTROLLER_DEFINED
213 #define MICROCONTROLLER_DEFINED
214 #endif
215 #ifdef MCS51REG_ENABLE_WARNINGS
216 #warning Selected HW: 8052
217 #endif
218 // 8051 register set
219 #define P0
220 #define SP
221 #define DPL
222 #define DPH
223 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
224 #define TCON
225 #define TMOD
226 #define TL0
227 #define TL1
228 #define TH0
229 #define TH1
230 #define P1
231 #define SCON
232 #define SBUF
233 #define P2
234 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
235 #define P3
236 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
237 #define PSW
238 #define ACC
239 #define B
240 // 8052 specific registers
241 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
242 #define RCAP2L
243 #define RCAP2H
244 #define TL2
245 #define TH2
246 #endif
247 // end of definitions for the 8052 microcontroller
248
249
250 // definitionsons for the Atmel
251 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
252 #ifdef MICROCONTROLLER_AT89CX051
253 #ifdef MICROCONTROLLER_DEFINED
254 #define MCS51REG_ERROR
255 #endif
256 #ifndef MICROCONTROLLER_DEFINED
257 #define MICROCONTROLLER_DEFINED
258 #endif
259 #ifdef MCS51REG_ENABLE_WARNINGS
260 #warning Selected HW: Atmel AT89Cx051
261 #endif
262 // 8051 register set without P0 & P2
263 #define SP
264 #define DPL
265 #define DPH
266 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
267 #define TCON
268 #define TMOD
269 #define TL0
270 #define TL1
271 #define TH0
272 #define TH1
273 #define P1
274 #define SCON
275 #define SBUF
276 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
277 #define P3
278 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
279 #define PSW
280 #define ACC
281 #define B
282 #endif
283 // end of definitionsons for the Atmel
284 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
285
286
287 // definitions for the Atmel AT89S53
288 #ifdef MICROCONTROLLER_AT89S53
289 #ifdef MICROCONTROLLER_DEFINED
290 #define MCS51REG_ERROR
291 #endif
292 #ifndef MICROCONTROLLER_DEFINED
293 #define MICROCONTROLLER_DEFINED
294 #endif
295 #ifdef MCS51REG_ENABLE_WARNINGS
296 #warning Selected HW: AT89S53
297 #endif
298 // 8051 register set
299 #define P0
300 #define SP
301 #define DPL
302 #define DPH
303 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
304 #define TCON
305 #define TMOD
306 #define TL0
307 #define TL1
308 #define TH0
309 #define TH1
310 #define P1
311 #define SCON
312 #define SBUF
313 #define P2
314 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
315 #define P3
316 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
317 #define PSW
318 #define ACC
319 #define B
320 // 8052 specific registers
321 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
322 #define RCAP2L
323 #define RCAP2H
324 #define TL2
325 #define TH2
326 // AT89S53 specific register
327 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
328 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
329 #define SPCR
330 #define SPDR
331 #define SPSR
332 #define WCOM
333 #define DPL1
334 #define DPH1
335 #endif
336 // end of definitions for the Atmel AT89S53 microcontroller
337
338
339 // definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
340 #ifdef MICROCONTROLLER_AT89X52
341 #ifdef MICROCONTROLLER_DEFINED
342 #define MCS51REG_ERROR
343 #endif
344 #ifndef MICROCONTROLLER_DEFINED
345 #define MICROCONTROLLER_DEFINED
346 #endif
347 #ifdef MCS51REG_ENABLE_WARNINGS
348 #warning Selected HW: AT89C52 or AT89LV52
349 #endif
350 // 8051 register set
351 #define P0
352 #define SP
353 #define DPL
354 #define DPH
355 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
356 #define TCON
357 #define TMOD
358 #define TL0
359 #define TL1
360 #define TH0
361 #define TH1
362 #define P1
363 #define SCON
364 #define SBUF
365 #define P2
366 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
367 #define P3
368 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
369 #define PSW
370 #define ACC
371 #define B
372 // 8052 specific registers
373 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
374 #define RCAP2L
375 #define RCAP2H
376 #define TL2
377 #define TH2
378 // AT89X55 specific register
379 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
380 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
381 #endif
382 // end of definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
383
384
385 // definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
386 #ifdef MICROCONTROLLER_AT89X55
387 #ifdef MICROCONTROLLER_DEFINED
388 #define MCS51REG_ERROR
389 #endif
390 #ifndef MICROCONTROLLER_DEFINED
391 #define MICROCONTROLLER_DEFINED
392 #endif
393 #ifdef MCS51REG_ENABLE_WARNINGS
394 #warning Selected HW: AT89C55 or AT89LV55
395 #endif
396 // 8051 register set
397 #define P0
398 #define SP
399 #define DPL
400 #define DPH
401 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
402 #define TCON
403 #define TMOD
404 #define TL0
405 #define TL1
406 #define TH0
407 #define TH1
408 #define P1
409 #define SCON
410 #define SBUF
411 #define P2
412 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
413 #define P3
414 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
415 #define PSW
416 #define ACC
417 #define B
418 // 8052 specific registers
419 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
420 #define RCAP2L
421 #define RCAP2H
422 #define TL2
423 #define TH2
424 // AT89X55 specific register
425 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
426 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
427 #endif
428 // end of definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
429
430
431 // definitions for the Dallas DS5000
432 #ifdef MICROCONTROLLER_DS5000
433 #ifdef MICROCONTROLLER_DEFINED
434 #define MCS51REG_ERROR
435 #endif
436 #ifndef MICROCONTROLLER_DEFINED
437 #define MICROCONTROLLER_DEFINED
438 #endif
439 #ifdef MCS51REG_ENABLE_WARNINGS
440 #warning Selected HW: DS5000
441 #endif
442 #define P0
443 #define SP
444 #define DPL
445 #define DPH
446 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
447 #define TCON
448 #define TMOD
449 #define TL0
450 #define TL1
451 #define TH0
452 #define TH1
453 #define P1
454 #define SCON
455 #define SBUF
456 #define P2
457 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
458 #define P3
459 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
460 #define MCON__SL__PAA__ECE2__RA32_8__PA0__PA1__PA2__PA3
461 #define TA
462 #define PSW
463 #define ACC
464 #define B
465 #endif
466 // end of definitions for the Dallas DS5000
467
468
469 // definitions for the Dallas DS5001
470 #ifdef MICROCONTROLLER_DS5001
471 #ifdef MICROCONTROLLER_DEFINED
472 #define MCS51REG_ERROR
473 #endif
474 #ifndef MICROCONTROLLER_DEFINED
475 #define MICROCONTROLLER_DEFINED
476 #endif
477 #ifdef MCS51REG_ENABLE_WARNINGS
478 #warning Selected HW: DS5001
479 #endif
480 #define P0
481 #define SP
482 #define DPL
483 #define DPH
484 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
485 #define TCON
486 #define TMOD
487 #define TL0
488 #define TL1
489 #define TH0
490 #define TH1
491 #define P1
492 #define SCON
493 #define SBUF
494 #define P2
495 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
496 #define P3
497 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
498 #define CRC
499 #define CRCLOW
500 #define CRCHIGH
501 #define MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
502 #define TA
503 #define RNR
504 #define PSW
505 #define RPCTL
506 #define STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
507 #define ACC
508 #define B
509 #endif
510 // end of definitions for the Dallas DS5001
511
512
513 // definitions for the Dallas DS80C320 and DS80C323 microcontrollers
514 #ifdef MICROCONTROLLER_DS80C32X
515 #ifdef MICROCONTROLLER_DEFINED
516 #define MCS51REG_ERROR
517 #endif
518 #ifndef MICROCONTROLLER_DEFINED
519 #define MICROCONTROLLER_DEFINED
520 #endif
521 #ifdef MCS51REG_ENABLE_WARNINGS
522 #warning Selected HW: Dallas DS80C320 or DS80C323
523 #endif
524 // 8051 register set
525 #define P0
526 #define SP
527 #define DPL
528 #define DPH
529 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
530 #define TCON
531 #define TMOD
532 #define TL0
533 #define TL1
534 #define TH0
535 #define TH1
536 #define P1
537 #define SCON
538 #define SCON0
539 #define SBUF
540 #define P2
541 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
542 #define P3
543 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
544 #define PSW
545 #define ACC
546 #define B
547 // 8052 specific registers
548 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
549 #define RCAP2L
550 #define RCAP2H
551 #define TL2
552 #define TH2
553 // DS80C320 specific register
554 #define DPL1
555 #define DPH1
556 #define DPS__x__x__x__x__x__x__x__SEL
557 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
558 #define EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
559 #define SADDR0
560 #define SADDR1
561 #define SADEN0
562 #define SADEN1
563 #define SCON1
564 #define SBUF1
565 #define STATUS__PIP__HIP__LIP__x__x__x__x__x
566 #define TA
567 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
568 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
569 #define WDCON
570 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
571 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
572 #endif
573 // end of definitions for the Dallas DS80C320 and DS80C323 microcontrollers
574
575
576 // definitions for the Dallas DS80C390
577 #ifdef MICROCONTROLLER_DS80C390
578 #ifdef MICROCONTROLLER_DEFINED
579 #define MCS51REG_ERROR
580 #endif
581 #ifndef MICROCONTROLLER_DEFINED
582 #define MICROCONTROLLER_DEFINED
583 #endif
584 #ifdef MCS51REG_ENABLE_WARNINGS
585 #warning Selected HW: Dallas DS80C390
586 #endif
587 // 8051 register set
588 #define P0
589 #define SP
590 #define DPL
591 #define DPH
592 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
593 #define TCON
594 #define TMOD
595 #define TL0
596 #define TL1
597 #define TH0
598 #define TH1
599 #define P1
600 #define SCON
601 #define SCON0
602 #define SBUF
603 #define P2
604 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
605 #define P3
606 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
607 #define PSW
608 #define ACC
609 #define B
610 // 8052 specific registers
611 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
612 #define RCAP2L
613 #define RCAP2H
614 #define TL2
615 #define TH2
616 // DS80C390 specific register
617 #define P4_AT_0X80
618 #define DPL1
619 #define DPH1
620 #define DPS__ID1__ID0__TSL__x__x__x__x__SEL
621 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
622 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
623 #define P4CNT
624 #define DPX
625 #define DPX1
626 #define C0RMS0
627 #define C0RMS1
628 #define ESP
629 #define AP
630 #define ACON__x__x__x__x__x__SA__AM1__AM0
631 #define C0TMA0
632 #define C0TMA1
633 #define P5_AT_0XA1
634 #define P5CNT
635 #define C0C
636 #define C0S
637 #define C0IR
638 #define C0TE
639 #define C0RE
640 #define SADDR0
641 #define SADDR1
642 #define C0M1C
643 #define C0M2C
644 #define C0M3C
645 #define C0M4C
646 #define C0M5C
647 #define C0M6C
648 #define C0M7C
649 #define C0M8C
650 #define C0M9C
651 #define C0M10C
652 #define SADEN0
653 #define SADEN1
654 #define C0M11C
655 #define C0M12C
656 #define C0M13C
657 #define C0M14C
658 #define C0M15C
659 #define SCON1
660 #define SBUF1
661 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
662 #define STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
663 #define MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
664 #define TA
665 #define T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
666 #define COR
667 #define MCNT0
668 #define MCNT1
669 #define MA
670 #define MB
671 #define MC
672 #define C1RSM0
673 #define C1RSM1
674 #define WDCON
675 #define C1TMA0
676 #define C1TMA1
677 #define C1C
678 #define C1S
679 #define C1IR
680 #define C1TE
681 #define C1RE
682 #define EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
683 #define MXMAX
684 #define C1M1C
685 #define C1M2C
686 #define C1M3C
687 #define C1M4C
688 #define C1M5C
689 #define C1M6C
690 #define C1M7C
691 #define C1M8C
692 #define C1M9C
693 #define EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
694 #define C1M10C
695 #define C1M11C
696 #define C1M12C
697 #define C1M13C
698 #define C1M14C
699 #define C1M15C
700 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
701 #endif
702 // end of definitions for the Dallas DS80C390
703
704 // definitions for the Dallas DS89C420 microcontroller
705 #ifdef MICROCONTROLLER_DS89C420
706 #ifdef MICROCONTROLLER_DEFINED
707 #define MCS51REG_ERROR
708 #endif
709 #ifndef MICROCONTROLLER_DEFINED
710 #define MICROCONTROLLER_DEFINED
711 #endif
712 #ifdef MCS51REG_ENABLE_WARNINGS
713 #warning Selected HW: Dallas DS89C420
714 #endif
715 // 8051 register set
716 #define P0
717 #define SP
718 #define DPL
719 #define DPH
720 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
721 #define TCON
722 #define TMOD
723 #define TL0
724 #define TL1
725 #define TH0
726 #define TH1
727 #define P1
728 #define SCON
729 #define SCON0
730 #define SBUF
731 #define P2
732 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
733 #define P3
734 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
735 #define PSW
736 #define ACC
737 #define B
738 // 8052 specific registers
739 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
740 #define RCAP2L
741 #define RCAP2H
742 #define TL2
743 #define TH2
744 // DS8XC420 specific registers
745 #define ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
746 #define DPL1
747 #define DPH1
748 #define DPS__ID1__ID0__TSL__AID__x__x__x__SEL
749 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
750 #define CKMOD
751 #define IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
752 #define IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
753 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
754 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
755 #define SADDR0
756 #define SADDR1
757 #define SADEN0
758 #define SADEN1
759 #define SCON1
760 #define SBUF1
761 #define STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
762 #define TA
763 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
764 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
765 #define ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
766 #define WDCON
767 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
768 #define EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
769 #define EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
770 #define FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
771 #endif
772 // end of definitions for the Dallas DS89C420 microcontroller
773
774 // definitions for the Dallas DS87C520 and DS83C520 microcontrollers
775 #ifdef MICROCONTROLLER_DS8XC520
776 #ifdef MICROCONTROLLER_DEFINED
777 #define MCS51REG_ERROR
778 #endif
779 #ifndef MICROCONTROLLER_DEFINED
780 #define MICROCONTROLLER_DEFINED
781 #endif
782 #ifdef MCS51REG_ENABLE_WARNINGS
783 #warning Selected HW: Dallas DS87C520 or DS85C520
784 #endif
785 // 8051 register set
786 #define P0
787 #define SP
788 #define DPL
789 #define DPH
790 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
791 #define TCON
792 #define TMOD
793 #define TL0
794 #define TL1
795 #define TH0
796 #define TH1
797 #define P1
798 #define SCON
799 #define SCON0
800 #define SBUF
801 #define P2
802 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
803 #define P3
804 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
805 #define PSW
806 #define ACC
807 #define B
808 // 8052 specific registers
809 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
810 #define RCAP2L
811 #define RCAP2H
812 #define TL2
813 #define TH2
814 // DS8XC520 specific registers
815 #define DPL1
816 #define DPH1
817 #define DPS__x__x__x__x__x__x__x__SEL
818 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
819 #define EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
820 #define PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
821 #define SADDR0
822 #define SADDR1
823 #define SADEN0
824 #define SADEN1
825 #define SCON1
826 #define SBUF1
827 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
828 #define TA
829 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
830 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
831 #define WDCON
832 #define ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
833 #define BP2
834 #define WDCON
835 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
836 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
837 #endif
838 // end of definitions for the Dallas DS87C520 and DS83C520 microcontrollers
839
840
841 // definitions for the Philips P80C552 microcontroller
842 #ifdef MICROCONTROLLER_P80C552
843 #ifdef MICROCONTROLLER_DEFINED
844 #define MCS51REG_ERROR
845 #endif
846 #ifndef MICROCONTROLLER_DEFINED
847 #define MICROCONTROLLER_DEFINED
848 #endif
849 #ifdef MCS51REG_ENABLE_WARNINGS
850 #warning Selected HW: Philips P80C552
851 #endif
852 // 8051 register set
853 #define P0
854 #define SP
855 #define DPL
856 #define DPH
857 #define PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
858 #define TCON
859 #define TMOD
860 #define TL0
861 #define TL1
862 #define TH0
863 #define TH1
864 #define P1
865 #define SCON
866 #define SBUF
867 #define P2
868 #define IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
869 #define P3
870 #define IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
871 #define PSW
872 #define ACC
873 #define B
874 // P80C552 specific register-names
875 #define S0BUF           // same as SBUF, set in mcs51reg.h
876 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
877 // P80C552 specific registers
878 #define ADCH_AT_0XC6
879 #define ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
880 #define CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
881 #define CTH0_AT_0XCC
882 #define CTH1_AT_0XCD
883 #define CTH2_AT_0XCE
884 #define CTH3_AT_0XCF
885 #define CMH0_AT_0XC9
886 #define CMH1_AT_0XCA
887 #define CMH2_AT_0XCB
888 #define CTL0_AT_0XAC
889 #define CTL1_AT_0XAD
890 #define CTL2_AT_0XAE
891 #define CTL3_AT_0XAF
892 #define CML0_AT_0XA9
893 #define CML1_AT_0XAA
894 #define CML2_AT_0XAB
895 #define IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
896 #define IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
897 #define PWM0_AT_0XFC
898 #define PWM1_AT_0XFD
899 #define PWMP_AT_0XFE
900 #define P1_EXT__SDA__SCL__RT2__T2__CT3I__CT2I__CT1I__CT0I
901 #define P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
902 #define P5_AT_0XC4
903 #define RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
904 #define S1ADR__x__x__x__x__x__x__x__GC
905 #define S1DAT_AT_0XDA
906 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
907 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
908 #define STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
909 #define TMH2_AT_0XED
910 #define TML2_AT_0XEC
911 #define TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
912 #define TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
913 #define T3_AT_0XFF
914 #endif
915 // end of definitions for the Philips P80C552 microcontroller
916
917
918 // definitions for the Philips P89C668
919 #ifdef MICROCONTROLLER_P89C668
920 #ifdef MICROCONTROLLER_DEFINED
921 #define MCS51REG_ERROR
922 #endif
923 #ifndef MICROCONTROLLER_DEFINED
924 #define MICROCONTROLLER_DEFINED
925 #endif
926 #ifdef MCS51REG_ENABLE_WARNINGS
927 #warning Selected HW: P89C668
928 #endif
929 #define P0
930 #define P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
931 #define P1
932 #define P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
933 #define P2
934 #define P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
935 #define P3
936 #define P3_EXT__x__x__CEX4__CEX3__x__x__x__x
937 #define SP
938 #define DPL
939 #define DPH
940 #define TCON
941 #define TMOD
942 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
943 #define TL0
944 #define TL1
945 #define TH0
946 #define TH1
947 #define SCON
948 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
949 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
950 #define SBUF
951 #define S0BUF SBUF
952 #define PSW
953 #define ACC
954 #define B
955 #define SADR_AT_0XA9
956 #define SADEN_AT_0XB9
957 #define S1IST_AT_0XDC
958 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
959 #define S1DAT_AT_0XDA
960 #define S1ADR__x__x__x__x__x__x__x__GC
961 #define SBUF
962 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
963 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
964 #define RCAP2L
965 #define RCAP2H
966 #define TL2
967 #define TH2
968 #define IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
969 #define IEN1__x__x__x__x__x__x__x__ET2
970 #define IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
971 #define IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
972 #define CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
973 #define CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
974 #define AUXR__x__x__x__x__x__x__EXTRAM__A0
975 #define AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
976 #define WDTRST_AT_0XA6
977 #define CCAPM0_AT_0XC2
978 #define CCAPM1_AT_0XC3
979 #define CCAPM2_AT_0XC4
980 #define CCAPM3_AT_0XC5
981 #define CCAPM4_AT_0XC6
982 #define CCAP0L_AT_0XEA
983 #define CCAP1L_AT_0XEB
984 #define CCAP2L_AT_0XEC
985 #define CCAP3L_AT_0XED
986 #define CCAP4L_AT_0XEE
987 #define CH_AT_0XF9
988 #define CL_AT_0XE9
989 #define CCAP0H_AT_0XFA
990 #define CCAP1H_AT_0XFB
991 #define CCAP2H_AT_0XFC
992 #define CCAP3H_AT_0XFD
993 #define CCAP4H_AT_0XFE
994 #endif
995 // end of definitions for the Philiüs P89C668
996
997
998 // definitions for the Infineon / Siemens SAB80515 & SAB80535
999 #ifdef MICROCONTROLLER_SAB80515
1000 #ifdef MICROCONTROLLER_DEFINED
1001 #define MCS51REG_ERROR
1002 #endif
1003 #ifndef MICROCONTROLLER_DEFINED
1004 #define MICROCONTROLLER_DEFINED
1005 #endif
1006 #ifdef MCS51REG_ENABLE_WARNINGS
1007 #warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
1008 #endif
1009 // 8051 register set without IP
1010 #define P0
1011 #define SP
1012 #define DPL
1013 #define DPH
1014 #define PCON__SMOD__x__x__x__x__x__x__x
1015 #define TCON
1016 #define TMOD
1017 #define TL0
1018 #define TL1
1019 #define TH0
1020 #define TH1
1021 #define P1
1022 #define SCON
1023 #define SBUF
1024 #define P2
1025 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1026 #define P3
1027 #define PSW
1028 #define ACC
1029 #define B
1030 // SAB80515 specific registers
1031 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1032 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1033 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1034 #define IRCON
1035 #define CCEN
1036 #define CCL1
1037 #define CCH1
1038 #define CCL2
1039 #define CCH2
1040 #define CCL3
1041 #define CCH3
1042 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1043 #define CRCL
1044 #define CRCH
1045 #define TL2
1046 #define TH2
1047 #define ADCON
1048 #define ADDAT
1049 #define DAPR__SAB80515
1050 #define P4_AT_0XE8
1051 #define P5_AT_0XF8
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__x__CF__CR__CCF4__CCF3__CCF2__CCF1__CCF0
1286 #define CMOD__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__x__CF__CR__CCF4__CCF3__CCF2__CCF1__CCF0
2019 #undef CCON__x__CF__CR__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 0xDD CR;
2028 sbit at 0xDE 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__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2219 #undef CMOD__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 ET1;
2638 sbit at 0xAB ES;
2639 sbit at 0xAC ET2;
2640 sbit at 0xAD EC;
2641 sbit at 0xAE EA;
2642 #endif
2643
2644 #ifdef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2645 #undef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2646 sfr at 0xA8 IE   ;
2647 // Bit registers
2648 sbit at 0xA8 EX0  ;
2649 sbit at 0xA9 ET0  ;
2650 sbit at 0xAA EX1  ;
2651 sbit at 0xAB ET1  ;
2652 sbit at 0xAC ES   ;
2653 sbit at 0xAC ES0  ; // Alternate name
2654 sbit at 0xAD ET2  ; // Enable timer2 interrupt
2655 sbit at 0xAE ES1  ;
2656 sbit at 0xAF EA   ;
2657 #endif // IE
2658
2659 #ifdef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2660 #undef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2661 sfr at 0xA8 IE    ;
2662 sfr at 0xA8 IEN0  ; // Alternate name
2663 // Bit registers for the SAB80515 and compatible IE
2664 sbit at 0xA8 EX0  ;
2665 sbit at 0xA9 ET0  ;
2666 sbit at 0xAA EX1  ;
2667 sbit at 0xAB ET1  ;
2668 sbit at 0xAC ES   ;
2669 sbit at 0xAC ES0  ;
2670 sbit at 0xAD ET2  ; // Enable timer 2 overflow SAB80515 specific
2671 sbit at 0xAE WDT  ; // watchdog timer reset - SAB80515 specific
2672 sbit at 0xAF EA   ;
2673 sbit at 0xAF EAL  ; // EA as called by Infineon / Siemens
2674 #endif
2675
2676 #ifdef IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
2677 #undef IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0 
2678 // P89C668 specific
2679 sfr at 0xA8 IEN0        ;
2680 // Bit registers
2681 sbit at 0xA8 EX0        ;
2682 sbit at 0xA9 ET0        ;
2683 sbit at 0xAA EX1        ;
2684 sbit at 0xAB ET1        ;
2685 sbit at 0xAC ES0        ;
2686 sbit at 0xAD ES1        ;
2687 sbit at 0xAE EC         ;
2688 sbit at 0xAF EA         ;
2689 #endif
2690
2691 #ifdef IEN1__x__x__x__x__x__x__x__ET2
2692 #undef IEN1__x__x__x__x__x__x__x__ET2
2693 // P89C668 specific bit registers
2694 sfr at 0xE8 IEN1        ;
2695 // Bit registers
2696 sbit at 0xE8 ET2        ;
2697 #endif
2698
2699 #ifdef IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
2700 #undef IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
2701 sfr at 0xE8 IEN1        ; // Interrupt enable 1, P80C552 specific
2702 // Bit registers
2703 sbit at 0xE8 ECT0       ;
2704 sbit at 0xE9 ECT1       ;
2705 sbit at 0xEA ECT2       ;
2706 sbit at 0xEB ECT3       ;
2707 sbit at 0xEC ECM0       ;
2708 sbit at 0xED ECM1       ;
2709 sbit at 0xEE ECM2       ;
2710 sbit at 0xEF ET2        ;
2711 #endif
2712
2713 #ifdef IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
2714 #undef IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
2715 sfr at 0xB8 IEN1        ; // interrupt enable register - SAB80515 specific
2716 // Bit registers
2717 sbit at 0xB8 EADC       ; // A/D converter interrupt enable
2718 sbit at 0xB9 EX2        ;
2719 sbit at 0xBA EX3        ;
2720 sbit at 0xBB EX4        ;
2721 sbit at 0xBC EX5        ;
2722 sbit at 0xBD EX6        ;
2723 sbit at 0xBE SWDT       ; // watchdog timer start/reset
2724 sbit at 0xBF EXEN2      ; // timer2 external reload interrupt enable
2725 #endif
2726
2727 #ifdef IEN2__SAB80517
2728 #undef IEN2__SAB80517
2729 sfr at 0x9A IEN2        ; // interrupt enable register 2 SAB80517
2730 #endif
2731
2732 #ifdef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2733 #undef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2734 sfr at 0xB8 IP   ;
2735 // Bit registers
2736 sbit at 0xB8 PX0  ;
2737 sbit at 0xB9 PT0  ;
2738 sbit at 0xBA PX1  ;
2739 sbit at 0xBB PT1  ;
2740 sbit at 0xBC PS   ;
2741 #endif
2742
2743 #ifdef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2744 #undef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2745 sfr at 0xB8 IP    ;
2746 // Bit registers
2747 sbit at 0xB8 PX0  ;
2748 sbit at 0xB9 PT0  ;
2749 sbit at 0xBA PX1  ;
2750 sbit at 0xBB PT1  ;
2751 sbit at 0xBC PS   ;
2752 sbit at 0xBC PS0  ;  // alternate name
2753 sbit at 0xBD PT2  ;
2754 #endif
2755
2756 #ifdef IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
2757 #undef IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
2758 sfr at 0xB8 IP          ; // Interrupt priority 0, P80C552 specific
2759 sfr at 0xB8 IP0         ; // alternate name
2760 // Bit registers
2761 sbit at 0xB8 PX0        ;
2762 sbit at 0xB9 PT0        ;
2763 sbit at 0xBA PX1        ;
2764 sbit at 0xBB PT1        ;
2765 sbit at 0xBC PS0        ;
2766 sbit at 0xBD PS1        ;
2767 sbit at 0xBE PAD        ;
2768 #endif
2769
2770 #ifdef IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
2771 #undef IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
2772 sfr at 0xB8 IP;
2773 // Bit registers
2774 sbit at 0xB8 PX0  ;
2775 sbit at 0xB9 PT0  ;
2776 sbit at 0xBA PX1  ;
2777 sbit at 0xBB PT1  ;
2778 sbit at 0xBC PS   ;
2779 sbit at 0xBD PT2  ;
2780 sbit at 0xBE PPC  ;
2781 #endif
2782
2783 #ifdef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2784 #undef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
2785 sfr at 0xB8 IP   ;
2786 // Bit registers
2787 sbit at 0xB8 PX0  ;
2788 sbit at 0xB9 PT0  ;
2789 sbit at 0xBA PX1  ;
2790 sbit at 0xBB PT1  ;
2791 sbit at 0xBC PS   ;
2792 sbit at 0xBD PT2  ;
2793 sbit at 0xBE PS1  ;
2794 #endif
2795
2796 #ifdef IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
2797 #undef IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
2798 // P89C668 specific:
2799 sfr at 0xB8 IP          ;
2800 // Bit registers
2801 sbit at 0xB8 PX0        ;
2802 sbit at 0xB9 PT0        ;
2803 sbit at 0xBA PX1        ;
2804 sbit at 0xBB PT1        ;
2805 sbit at 0xBC PS0        ;
2806 sbit at 0xBD PS1        ;
2807 sbit at 0xBE PPC        ;
2808 sbit at 0xBF PT2        ;
2809 #endif
2810
2811 #ifdef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2812 #undef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
2813 sfr at 0xB8 IP   ;
2814 // Bit registers
2815 sbit at 0xB8 PX0  ;
2816 sbit at 0xB9 PT0  ;
2817 sbit at 0xBA PX1  ;
2818 sbit at 0xBB PT1  ;
2819 sbit at 0xBC PS   ;
2820 sbit at 0xBF RWT  ;
2821 #endif
2822
2823 #ifdef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2824 #undef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
2825 sfr at 0xA9 IP0   ; // interrupt priority register SAB80515 specific
2826 // Not directly accessible IP0 bits
2827 #define IP0_0    0x01
2828 #define IP0_1    0x02
2829 #define IP0_2    0x04
2830 #define IP0_3    0x08
2831 #define IP0_4    0x10
2832 #define IP0_5    0x20
2833 #define WDTS     0x40
2834 #endif
2835
2836 #ifdef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2837 #undef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
2838 sfr at 0xB8 IP0   ; // interrupt priority register DS89C420 specific
2839 // Not directly accessible IP0 bits
2840 #define LPX0    0x01
2841 #define LPT0    0x02
2842 #define LPX1    0x04
2843 #define LPT1    0x08
2844 #define LPS0    0x10
2845 #define LPT2    0x20
2846 #define LPS1    0x40
2847 #endif
2848
2849 #ifdef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2850 #undef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
2851 sfr at 0xB9 IP1   ; // interrupt priority register SAB80515 specific
2852 // Not directly accessible IP1 bits
2853 #define IP1_0    0x01
2854 #define IP1_1    0x02
2855 #define IP1_2    0x04
2856 #define IP1_3    0x08
2857 #define IP1_4    0x10
2858 #define IP1_5    0x20
2859 #endif
2860
2861 #ifdef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2862 #undef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
2863 sfr at 0xB1 IP1   ; // interrupt priority register DS89C420 specific
2864 // Not directly accessible IP0 bits
2865 #define LPX0    0x01
2866 #define LPT0    0x02
2867 #define LPX1    0x04
2868 #define LPT1    0x08
2869 #define LPS0    0x10
2870 #define LPT2    0x20
2871 #define LPS1    0x40
2872 #endif
2873
2874 #ifdef IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
2875 #undef IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
2876 sfr at 0xF8 IP1         ; // Interrupt priority 1, P80C552 specific
2877 // Bit registers
2878 sbit at 0xF8 PCT0       ;
2879 sbit at 0xF9 PCT1       ;
2880 sbit at 0xFA PCT2       ;
2881 sbit at 0xFB PCT3       ;
2882 sbit at 0xFC PCM0       ;
2883 sbit at 0xFD PCM1       ;
2884 sbit at 0xFE PCM2       ;
2885 sbit at 0xFF PT2        ;
2886 #endif
2887
2888 #ifdef IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
2889 #undef IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
2890 sfr at 0xB7 IPH;
2891 #define PX0H      0x01
2892 #define PT0H      0x02
2893 #define PX1H      0x04
2894 #define PT1H      0x08
2895 #define PSH       0x10
2896 #define PT2H      0x20
2897 #define PPCH      0x40
2898 #endif
2899
2900 #ifdef IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
2901 #undef IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
2902 // P89C668 specific:
2903 sfr at 0xB7 IPH         ;
2904 // not bit addressable:
2905 #define PX0H 0x01
2906 #define PT0H 0x02
2907 #define PX1H 0x04
2908 #define PT1H 0x08
2909 #define PS0H 0x10
2910 #define PS1H 0x20
2911 #define PPCH 0x40
2912 #define PT2H 0x80
2913 #endif
2914
2915 #ifdef IRCON
2916 #undef IRCON
2917 sfr at 0xC0 IRCON       ; // interrupt control register - SAB80515 specific
2918 // Bit registers
2919 sbit at 0xC0 IADC       ; // A/D converter irq flag
2920 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2921 sbit at 0xC2 IEX3       ;
2922 sbit at 0xC3 IEX4       ;
2923 sbit at 0xC4 IEX5       ;
2924 sbit at 0xC5 IEX6       ;
2925 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2926 sbit at 0xC7 EXF2       ; // timer2 reload flag
2927 #endif
2928
2929 #ifdef IRCON0
2930 #undef IRCON0
2931 sfr at 0xC0 IRCON0       ; // interrupt control register - SAB80515 specific
2932 // Bit registers
2933 sbit at 0xC0 IADC       ; // A/D converter irq flag
2934 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
2935 sbit at 0xC2 IEX3       ;
2936 sbit at 0xC3 IEX4       ;
2937 sbit at 0xC4 IEX5       ;
2938 sbit at 0xC5 IEX6       ;
2939 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
2940 sbit at 0xC7 EXF2       ; // timer2 reload flag
2941 #endif
2942
2943 #ifdef IRCON1
2944 #undef IRCON1
2945 sfr at 0xD1 IRCON1      ; // interrupt control register - SAB80515 specific
2946 #endif
2947
2948 #ifdef MA
2949 #undef MA
2950 sfr at 0xD3 MA          ; // DS80C390
2951 #endif
2952
2953 #ifdef MB
2954 #undef MB
2955 sfr at 0xD4 MB          ; // DS80C390
2956 #endif
2957
2958 #ifdef MC
2959 #undef MC
2960 sfr at 0xD5 MC          ; // DS80C390
2961 #endif
2962
2963 #ifdef MCNT0
2964 #undef MCNT0
2965 sfr at 0xD1 MCNT0       ; // DS80C390
2966 #define MAS0     0x01
2967 #define MAS1     0x02
2968 #define MAS2     0x04
2969 #define MAS3     0x08
2970 #define MAS4     0x10
2971 #define SCB      0x20
2972 #define CSE      0x40
2973 #define LSHIFT   0x80
2974 #endif
2975
2976 #ifdef MCNT1
2977 #undef MCNT1
2978 sfr at 0xD2 MCNT1       ; // DS80C390
2979 #define CLM      0x10
2980 #define MOF      0x40
2981 #define MST      0x80
2982 #endif
2983
2984 #ifdef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2985 #undef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
2986 sfr at 0xC6 MCON        ; // DS80C390
2987 #define PDCE0    0x01
2988 #define PDCE1    0x02
2989 #define PDCE2    0x04
2990 #define PDCE3    0x08
2991 #define CMA      0x20
2992 #define IDM0     0x40
2993 #define IDM1     0x80
2994 #endif
2995
2996 #ifdef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2997 #undef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
2998 sfr at 0xC6 MCON        ; // DS5000
2999 #define SL       0x01
3000 #define PAA      0x02
3001 #define ECE2     0x04
3002 #define RA32_8   0x08
3003 #define PA0      0x10
3004 #define PA1      0x20
3005 #define PA2      0x40
3006 #define PA3      0x80
3007 #endif
3008
3009 #ifdef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
3010 #undef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
3011 sfr at 0xC6 MCON        ; // DS5001
3012 #define SL       0x01
3013 #define PM       0x02
3014 #define PES      0x04
3015 #define RG1      0x08
3016 #define PA0      0x10
3017 #define PA1      0x20
3018 #define PA2      0x40
3019 #define PA3      0x80
3020 #endif
3021
3022 #ifdef MD0
3023 #undef MD0
3024 sfr at 0xE9 MD0         ; // MUL / DIV register 0 SAB80517
3025 #endif
3026
3027 #ifdef MD1
3028 #undef MD1
3029 sfr at 0xEA MD1         ; // MUL / DIV register 1 SAB80517
3030 #endif
3031
3032 #ifdef MD2
3033 #undef MD2
3034 sfr at 0xEB MD2         ; // MUL / DIV register 2 SAB80517
3035 #endif
3036
3037 #ifdef MD3
3038 #undef MD3
3039 sfr at 0xEC MD3         ; // MUL / DIV register 3 SAB80517
3040 #endif
3041
3042 #ifdef MD4
3043 #undef MD4
3044 sfr at 0xED MD4         ; // MUL / DIV register 4 SAB80517
3045 #endif
3046
3047 #ifdef MD5
3048 #undef MD5
3049 sfr at 0xEE MD5         ; // MUL / DIV register 5 SAB80517
3050 #endif
3051
3052 #ifdef MXAX
3053 #undef MXAX
3054 sfr at 0xEA MXAX        ; // Dallas DS80C390
3055 #endif
3056
3057 #ifdef P0
3058 #undef P0
3059 sfr at 0x80 P0   ;
3060 //  Bit Registers
3061 sbit at 0x80 P0_0 ;
3062 sbit at 0x81 P0_1 ;
3063 sbit at 0x82 P0_2 ;
3064 sbit at 0x83 P0_3 ;
3065 sbit at 0x84 P0_4 ;
3066 sbit at 0x85 P0_5 ;
3067 sbit at 0x86 P0_6 ;
3068 sbit at 0x87 P0_7 ;
3069 #endif
3070
3071 #ifdef P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
3072 #undef P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
3073 // P89C668 alternate names for bits in P0
3074 sbit at 0x80 AD0        ;
3075 sbit at 0x81 AD1        ;
3076 sbit at 0x82 AD2        ;
3077 sbit at 0x83 AD3        ;
3078 sbit at 0x84 AD4        ;
3079 sbit at 0x85 AD5        ;
3080 sbit at 0x86 AD6        ;
3081 sbit at 0x87 AD7        ;
3082 #endif
3083
3084 #ifdef P1
3085 #undef P1
3086 sfr at 0x90 P1   ;
3087 // Bit registers
3088 sbit at 0x90 P1_0 ;
3089 sbit at 0x91 P1_1 ;
3090 sbit at 0x92 P1_2 ;
3091 sbit at 0x93 P1_3 ;
3092 sbit at 0x94 P1_4 ;
3093 sbit at 0x95 P1_5 ;
3094 sbit at 0x96 P1_6 ;
3095 sbit at 0x97 P1_7 ;
3096 #endif
3097
3098 #ifdef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
3099 #undef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
3100 // P1 alternate functions
3101 sbit at 0x90 T2   ;
3102 sbit at 0x91 T2EX ;
3103 sbit at 0x92 RXD1 ;
3104 sbit at 0x93 TXD1 ;
3105 sbit at 0x94 INT2 ;
3106 sbit at 0x95 INT3 ;
3107 sbit at 0x96 INT4 ;
3108 sbit at 0x97 INT5 ;
3109 #endif
3110
3111 #ifdef P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3112 #undef P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3113 // P89C669 alternate names for bits at P1
3114 // P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3115 sbit at 0x90 T2         ;
3116 sbit at 0x91 T2EX       ;
3117 sbit at 0x92 ECI        ;
3118 sbit at 0x93 CEX0       ;
3119 sbit at 0x94 CEX1       ;
3120 sbit at 0x95 CEX2       ;
3121 sbit at 0x96 SCL        ;
3122 sbit at 0x97 SDA        ;
3123 #endif
3124
3125 #ifdef P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
3126 sbit at 0x90 INT3_CC0   ; // P1 alternate functions - SAB80515 specific
3127 sbit at 0x91 INT4_CC1   ;
3128 sbit at 0x92 INT5_CC2   ;
3129 sbit at 0x93 INT6_CC3   ;
3130 sbit at 0x94 INT2       ;
3131 sbit at 0x95 T2EX       ;
3132 sbit at 0x96 CLKOUT     ;
3133 sbit at 0x97 T2         ;
3134 #endif
3135
3136 #ifdef P1_EXT__CT0I__CT1I__CT2I__CT3I__T2__RT2__SCL__SDA
3137 #undef P1_EXT__CT0I__CT1I__CT2I__CT3I__T2__RT2__SCL__SDA
3138 // Bit registers
3139 sbit at 0x90 CT0I       ; // Port 1 alternate functions, P80C552 specific
3140 sbit at 0x91 CT1I       ;
3141 sbit at 0x92 CT2I       ;
3142 sbit at 0x93 CT3I       ;
3143 sbit at 0x94 T2         ;
3144 sbit at 0x95 RT2        ;
3145 sbit at 0x96 SCL        ;
3146 sbit at 0x97 SDA        ;
3147 #endif
3148
3149 #ifdef P1_EXT__x__x__x__x__x__x__T2EX__T2
3150 #undef P1_EXT__x__x__x__x__x__x__T2EX__T2
3151 // P1 alternate functions
3152 sbit at 0x90 T2         ;
3153 sbit at 0x91 T2EX       ;
3154 #endif
3155
3156 #ifdef P2
3157 #undef P2
3158 sfr at 0xA0 P2   ;
3159 // Bit registers
3160 sbit at 0xA0 P2_0 ;
3161 sbit at 0xA1 P2_1 ;
3162 sbit at 0xA2 P2_2 ;
3163 sbit at 0xA3 P2_3 ;
3164 sbit at 0xA4 P2_4 ;
3165 sbit at 0xA5 P2_5 ;
3166 sbit at 0xA6 P2_6 ;
3167 sbit at 0xA7 P2_7 ;
3168 #endif
3169
3170 #ifdef P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
3171 #undef P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
3172 // P89C668 specific bit registers at P2:
3173 sbit at 0xA0 AD8        ;
3174 sbit at 0xA1 AD9        ;
3175 sbit at 0xA2 AD10       ;
3176 sbit at 0xA3 AD11       ;
3177 sbit at 0xA4 AD12       ;
3178 sbit at 0xA5 AD13       ;
3179 sbit at 0xA6 AD14       ;
3180 sbit at 0xA7 AD15       ;
3181 #endif
3182
3183 #ifdef P3
3184 #undef P3
3185 sfr at 0xB0 P3   ;
3186 // Bit registers
3187 sbit at 0xB0 P3_0 ;
3188 sbit at 0xB1 P3_1 ;
3189 sbit at 0xB2 P3_2 ;
3190 sbit at 0xB3 P3_3 ;
3191 sbit at 0xB4 P3_4 ;
3192 sbit at 0xB5 P3_5 ;
3193 #ifndef MCS51REG_EXTERNAL_RAM
3194 sbit at 0xB6 P3_6 ;
3195 sbit at 0xB7 P3_7 ;
3196 #endif
3197 // alternate names
3198 sbit at 0xB0 RXD  ;
3199 sbit at 0xB0 RXD0  ;
3200 sbit at 0xB1 TXD  ;
3201 sbit at 0xB1 TXD0  ;
3202 sbit at 0xB2 INT0 ;
3203 sbit at 0xB3 INT1 ;
3204 sbit at 0xB4 T0   ;
3205 sbit at 0xB5 T1   ;
3206 #ifndef MCS51REG_EXTERNAL_RAM
3207 sbit at 0xB6 WR   ;
3208 sbit at 0xB7 RD   ;
3209 #endif
3210 #endif
3211
3212 #ifdef P3_EXT__x__x__CEX4__CEX3__x__x__x__x
3213 #undef P3_EXT__x__x__CEX4__CEX3__x__x__x__x
3214 // P89C668 specific bit registers at P3 (alternate names)
3215 sbit at 0xB5 CEX4       ;
3216 sbit at 0xB4 CEX3       ;
3217 #endif
3218
3219 #ifdef P4_AT_0X80
3220 #undef P4_AT_0X80
3221 sfr at 0x80 P4          ; // Port 4 - DS80C390
3222 // Bit registers
3223 sbit at 0x80 P4_0       ;
3224 sbit at 0x81 P4_1       ;
3225 sbit at 0x82 P4_2       ;
3226 sbit at 0x83 P4_3       ;
3227 sbit at 0x84 P4_4       ;
3228 sbit at 0x85 P4_5       ;
3229 sbit at 0x86 P4_6       ;
3230 sbit at 0x87 P4_7       ;
3231 #endif
3232
3233 #ifdef P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
3234 #undef P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
3235 sfr at 0xC0 P4          ; // Port 4, P80C552 specific
3236 // Bit registers
3237 sbit at 0xC0 CMSR0      ;
3238 sbit at 0xC1 CMSR1      ;
3239 sbit at 0xC2 CMSR2      ;
3240 sbit at 0xC3 CMSR3      ;
3241 sbit at 0xC4 CMSR4      ;
3242 sbit at 0xC5 CMSR5      ;
3243 sbit at 0xC6 CMT0       ;
3244 sbit at 0xC7 CMT1       ;
3245 #endif
3246
3247 #ifdef P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
3248 #undef P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
3249 sfr at 0xC0 P4          ; // Port 4, T89C51 specific
3250 // Bit registers
3251 sbit at 0xC0 P4_0       ;
3252 sbit at 0xC1 P4_1       ;
3253 sbit at 0xC2 P4_2       ;
3254 sbit at 0xC3 P4_3       ;
3255 sbit at 0xC4 P4_4       ;
3256 sbit at 0xC5 P4_5       ;
3257 sbit at 0xC6 P4_6       ;
3258 sbit at 0xC7 P4_7       ;
3259 #endif
3260
3261 #ifdef P4_AT_0XE8
3262 #undef P4_AT_0XE8
3263 sfr at 0xE8 P4          ; // Port 4 - SAB80515 & compatible microcontrollers
3264 // Bit registers
3265 sbit at 0xE8 P4_0       ;
3266 sbit at 0xE9 P4_1       ;
3267 sbit at 0xEA P4_2       ;
3268 sbit at 0xEB P4_3       ;
3269 sbit at 0xEC P4_4       ;
3270 sbit at 0xED P4_5       ;
3271 sbit at 0xEE P4_6       ;
3272 sbit at 0xEF P4_7       ;
3273 #endif
3274
3275 #ifdef P4CNT
3276 #undef P4CNT
3277 sfr at 0x92 P4CNT       ; // DS80C390
3278 // Not directly accessible bits
3279 #define P4CNT_0  0x01
3280 #define P4CNT_1  0x02
3281 #define P4CNT_2  0x04
3282 #define P4CNT_3  0x08
3283 #define P4CNT_4  0x10
3284 #define P4CNT_5  0x20
3285 #define SBCAN    0x40
3286 #endif
3287
3288 #ifdef P5_AT_0XA1
3289 #undef P5_AT_0XA1
3290 sfr at 0xA1 P5          ; // Port 5 - DS80C390
3291 #endif
3292
3293 #ifdef P5_AT_0XE8
3294 #undef P5_AT_0XE8
3295 sfr at 0xE8 P5;           // Port 5 - T89C51RD2
3296 // Bit registers
3297 sbit at 0xE8 P5_0;
3298 sbit at 0xE9 P5_1;
3299 sbit at 0xEA P5_2;
3300 sbit at 0xEB P5_3;
3301 sbit at 0xEC P5_4;
3302 sbit at 0xED P5_5;
3303 sbit at 0xEE P5_6;
3304 sbit at 0xEF P5_7;
3305 #endif
3306
3307 #ifdef P5CNT
3308 #undef P5CNT
3309 sfr at 0xA2 P5CNT       ; // DS80C390
3310 // Not directly accessible bits
3311 #define P5CNT_0  0x01
3312 #define P5CNT_1  0x02
3313 #define P5CNT_2  0x04
3314 #define C0_I_O   0x08
3315 #define C1_I_O   0x10
3316 #define SP1EC    0x20
3317 #define SBCAN0BA 0x40
3318 #define SBCAN1BA 0x80
3319 #endif
3320
3321 #ifdef P5_AT_0XC4
3322 #undef P5_AT_0XC4
3323 sfr at 0xC4 P5          ; // Port 5, P80C552 specific
3324 // Not directly accessible Bits.
3325 #define ADC0    0x01
3326 #define ADC1    0x02
3327 #define ADC2    0x04
3328 #define ADC3    0x08
3329 #define ADC4    0x10
3330 #define ADC5    0x20
3331 #define ADC6    0x40
3332 #define ADC7    0x80
3333 #endif
3334
3335 #ifdef P5_AT_0XF8
3336 #undef P5_AT_0XF8
3337 sfr at 0xF8 P5          ; // Port 5 - SAB80515 & compatible microcontrollers
3338 // Bit registers
3339 sbit at 0xF8 P5_0       ;
3340 sbit at 0xF9 P5_1       ;
3341 sbit at 0xFA P5_2       ;
3342 sbit at 0xFB P5_3       ;
3343 sbit at 0xFC P5_4       ;
3344 sbit at 0xFD P5_5       ;
3345 sbit at 0xFE P5_6       ;
3346 sbit at 0xFF P5_7       ;
3347 #endif
3348
3349 #ifdef P6_AT_0XDB
3350 #undef P6_AT_0XDB
3351 sfr at 0xDB P6          ; // Port 6 - SAB80515 & compatible microcontrollers
3352 #endif
3353
3354 #ifdef P6_AT_0XFA
3355 #undef P6_AT_0XFA
3356 sfr at 0xFA P6          ; // Port 6 - SAB80517 specific
3357 #endif
3358
3359 #ifdef P7_AT_0XDB
3360 #undef P7_AT_0XDB
3361 sfr at 0xDB P7          ; // Port 7 - SAB80517 specific
3362 #endif
3363
3364 #ifdef P8_AT_0XDD
3365 #undef P8_AT_0XDD
3366 sfr at 0xDD P8          ; // Port 6 - SAB80517 specific
3367 #endif
3368
3369 #ifdef PCON__SMOD__x__x__x__x__x__x__x
3370 #undef PCON__SMOD__x__x__x__x__x__x__x
3371 sfr at 0x87 PCON ;
3372 // Not directly accessible PCON bits
3373 #define SMOD    0x80
3374 #endif
3375
3376 #ifdef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
3377 #undef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
3378 sfr at 0x87 PCON ;
3379 // Not directly accessible PCON bits
3380 #define IDL             0x01
3381 #define PD              0x02
3382 #define GF0             0x04
3383 #define GF1             0x08
3384 #define SMOD            0x80
3385 #endif
3386
3387 #ifdef PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
3388 #undef PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
3389 sfr at 0x87 PCON        ; // PCON, P80C552 specific
3390 // Not directly accessible Bits.
3391 #define IDL     0x01
3392 #define IDLE    0x01  ; same as IDL
3393 #define PD      0x02
3394 #define GF0     0x04
3395 #define GF1     0x08
3396 #define WLE     0x10
3397 #define SMOD    0x80
3398 #endif
3399
3400 #ifdef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
3401 #undef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
3402 sfr at 0x87 PCON ;
3403 // Not directly accessible PCON bits
3404 #define IDL             0x01
3405 #define IDLE            0x01  ; same as IDL
3406 #define PD              0x02  ;
3407 #define PDE             0x02  ; same as PD
3408 #define IDLS            0x20
3409 #define PDS             0x40
3410 #define SMOD            0x80
3411 // alternate names
3412 #define PCON_IDLE       0x01
3413 #define PCON_PDE        0x02
3414 #define PCON_GF0        0x04
3415 #define PCON_GF1        0x08
3416 #define PCON_IDLS       0x20
3417 #define PCON_PDS        0x40
3418 #define PCON_SMOD       0x80
3419 #endif
3420
3421 #ifdef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
3422 #undef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
3423 sfr at 0x87 PCON ;
3424 // Not directly accessible PCON bits
3425 #define IDL             0x01
3426 #define IDLE            0x01  ; same as IDL
3427 #define STOP            0x02  ;
3428 #define EWT             0x04
3429 #define EPFW            0x08
3430 #define WTR             0x10
3431 #define PFW             0x20
3432 #define POR             0x40
3433 #define SMOD            0x80
3434 #endif
3435
3436 #ifdef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
3437 #undef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
3438 sfr at 0x87 PCON ;
3439 // Not directly accessible PCON bits
3440 #define IDL             0x01
3441 #define IDLE            0x01  ; same as IDL
3442 #define STOP            0x02  ;
3443 #define GF0             0x04
3444 #define GF1             0x08
3445 #define SMOD0           0x40
3446 #define SMOD            0x80
3447 #endif
3448
3449 #ifdef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
3450 #undef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
3451 sfr at 0x87 PCON ;
3452 // Not directly accessible PCON bits
3453 #define IDL             0x01
3454 #define IDLE            0x01  ; same as IDL
3455 #define STOP            0x02  ;
3456 #define GF0             0x04
3457 #define GF1             0x08
3458 #define OFDE            0x10
3459 #define OFDF            0x20
3460 #define SMOD0           0x40
3461 #define SMOD            0x80
3462 #define SMOD_0          0x80  ; same as SMOD
3463 #endif
3464
3465 #ifdef PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
3466 #undef PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
3467 sfr at 0x87 PCON;
3468 #define IDL    0x01
3469 #define PD     0x02
3470 #define GF0    0x04
3471 #define GF1    0x08
3472 #define POF    0x10
3473 #define SMOD0  0x40
3474 #define SMOD1  0x80
3475 #endif
3476
3477 #ifdef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
3478 #undef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
3479 sfr at 0xC4 PMR  ;   // DS87C520, DS83C520
3480 // Not directly accessible bits
3481 #define DME0    0x01
3482 #define DME1    0x02
3483 #define ALEOFF  0x04
3484 #define XTOFF   0x08
3485 #define SWB     0x20
3486 #define CD0     0x40
3487 #define CD1     0x80
3488 #endif
3489
3490 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
3491 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
3492 sfr at 0xC4 PMR  ;   // DS80C390
3493 // Not directly accessible bits
3494 #define ALEOFF  0x04
3495 #define XTOFF   0x08
3496 #define _4X_2X  0x10
3497 #define SWB     0x20
3498 #define CD0     0x40
3499 #define CD1     0x80
3500 #endif
3501
3502 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
3503 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
3504 sfr at 0xC4 PMR  ;   // DS89C420
3505 // Not directly accessible bits
3506 #define DME0    0x01
3507 #define DME1    0x02
3508 #define ALEON   0x04
3509 #define _4X_2X  0x08
3510 #define CTM     0x10
3511 #define SWB     0x20
3512 #define CD0     0x40
3513 #define CD1     0x80
3514 #endif
3515
3516 #ifdef PSW
3517 #undef PSW
3518 sfr at 0xD0 PSW  ;
3519 // Bit registers
3520 sbit at 0xD0 P    ;
3521 sbit at 0xD1 F1   ;
3522 sbit at 0xD2 OV   ;
3523 sbit at 0xD3 RS0  ;
3524 sbit at 0xD4 RS1  ;
3525 sbit at 0xD5 F0   ;
3526 sbit at 0xD6 AC   ;
3527 sbit at 0xD7 CY   ;
3528 #endif
3529
3530 #ifdef PWM0_AT_0XFC
3531 #undef PWM0_AT_0XFC
3532 sfr at 0xFC PWM0        ; // PWM register 0, P80C552 specific
3533 #endif
3534
3535 #ifdef PWM1_AT_0XFD
3536 #undef PWM1_AT_0XFD
3537 sfr at 0xFD PWM1        ; // PWM register 1, P80C552 specific
3538 #endif
3539
3540 #ifdef PWMP_AT_0XFE
3541 #undef PWMP_AT_0XFE
3542 sfr at 0xFE PWMP        ; // PWM prescaler, P80C552 specific
3543 #endif
3544
3545 #ifdef RCAP2H
3546 #undef RCAP2H
3547 sfr at 0xCB RCAP2H  ;
3548 #endif
3549
3550 #ifdef RCAP2L
3551 #undef RCAP2L
3552 sfr at 0xCA RCAP2L  ;
3553 #endif
3554
3555 #ifdef RNR
3556 #undef RNR
3557 sfr at 0xCF RNR  ;
3558 #endif
3559
3560 #ifdef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
3561 #undef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
3562 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
3563 // Not directly accessible bits
3564 #define RSM0    0x01
3565 #define RSM1    0x02
3566 #define RSM2    0x04
3567 #endif
3568
3569 #ifdef ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
3570 #undef ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
3571 sfr at 0xC2 ROMSIZE  ;   // DS89C420
3572 // Not directly accessible bits
3573 #define RSM0    0x01
3574 #define RSM1    0x02
3575 #define RSM2    0x04
3576 #define PRAME   0x08
3577 #endif
3578
3579 #ifdef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
3580 #undef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
3581 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
3582 // Not directly accessible bits
3583 #define RSM0    0x01
3584 #define RSM1    0x02
3585 #define RSM2    0x04
3586 #define PRAME   0x08
3587 #define MOVCX   0x10
3588 #define TE      0x20
3589 #define BPF     0x40
3590 #define HBPF    0x80
3591 #endif
3592
3593 #ifdef RPCTL
3594 #undef RPCTL
3595 sfr at 0xD8 RPCTL     ;  // Dallas DS5001 specific
3596 sbit at 0xD8 RG0      ;
3597 sbit at 0xD9 RPCON    ;
3598 sbit at 0xDA DMA      ;
3599 sbit at 0xDB IBI      ;
3600 sbit at 0xDC AE       ;
3601 sbit at 0xDD EXBS     ;
3602 sbit at 0xDF RNR_FLAG ;
3603 #endif
3604
3605 #ifdef RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
3606 #undef RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
3607 sfr at 0xEF RTE     ; // Reset/toggle enable, P80C552 specific
3608 // Not directly accessible Bits.
3609 #define RP40    0x01
3610 #define RP41    0x02
3611 #define RP42    0x04
3612 #define RP43    0x08
3613 #define RP44    0x10
3614 #define RP45    0x20
3615 #define TP46    0x40
3616 #define TP47    0x80
3617 #endif
3618
3619 #ifdef S0BUF
3620 #undef S0BUF
3621 sfr at 0x99 S0BUF ; // serial channel 0 buffer register SAB80517 specific
3622 #endif
3623
3624 #ifdef S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
3625 #undef S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
3626 sfr at 0x98 S0CON ; // serial channel 0 control register P80C552 specific
3627 // Bit registers
3628 // Already defined in SCON
3629 //sbit at 0x98 RI0  ;
3630 //sbit at 0x99 TI0  ;
3631 //sbit at 0x9A RB8  ;
3632 //sbit at 0x9B TB8  ;
3633 //sbit at 0x9C REN  ;
3634 //sbit at 0x9D SM2  ;
3635 //sbit at 0x9E SM1  ;
3636 //sbit at 0x9F SM0  ;
3637 #endif
3638
3639 #ifdef S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
3640 #undef S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
3641 // serial channel 0 buffer register SAB80517 specific(same as stock SCON)
3642 sfr at 0x98 S0CON ;
3643 sbit at 0x98 RI0  ;
3644 sbit at 0x99 TI0  ;
3645 sbit at 0x9A RB80 ;
3646 sbit at 0x9B TB80  ;
3647 sbit at 0x9C REN0  ;
3648 sbit at 0x9D SM20  ;
3649 sbit at 0x9E SM1  ;
3650 sbit at 0x9F SM0  ;
3651 #endif
3652
3653 #ifdef S0RELL
3654 #undef S0RELL
3655 sfr at 0xAA S0RELL ; // serial channel 0 reload register low byte SAB80517 specific
3656 #endif
3657
3658 #ifdef S0RELH
3659 #undef S0RELH
3660 sfr at 0xBA S0RELH ; // serial channel 0 reload register high byte SAB80517 specific
3661 #endif
3662
3663 #ifdef S1ADR__x__x__x__x__x__x__x__GC
3664 #undef S1ADR__x__x__x__x__x__x__x__GC
3665 sfr at 0xDB S1ADR       ; // Serial 1 address, P80C552 specific
3666 // Not directly accessible Bits.
3667 #define GC      0x01
3668 #endif
3669
3670 #ifdef S1BUF
3671 #undef S1BUF
3672 sfr at 0x9C S1BUF ; // serial channel 1 buffer register SAB80517 specific
3673 #endif
3674
3675 #ifdef S1CON_AT_0X9B
3676 #undef S1CON_AT_0X9B
3677 sfr at 0x9B S1CON ; // serial channel 1 control register SAB80517 specific
3678 #endif
3679
3680 #ifdef S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
3681 #undef S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
3682 sfr at 0xD8 S1CON       ; // Serial 1 control, P80C552 specific
3683 sfr at 0xD8 SICON       ; // sometimes called SICON
3684 // Bit register
3685 sbit at 0xD8 CR0        ;
3686 sbit at 0xD9 CR1        ;
3687 sbit at 0xDA AA         ;
3688 sbit at 0xDB SI         ;
3689 sbit at 0xDC ST0        ;
3690 sbit at 0xDD STA        ;
3691 sbit at 0xDE ENS1       ;
3692 sbit at 0xDF CR2        ;
3693 #endif
3694
3695 #ifdef S1DAT_AT_0XDA
3696 #undef S1DAT_AT_0XDA
3697 sfr at 0xDA S1DAT       ; // Serial 1 data, P80C552 specific
3698 sfr at 0xDA SIDAT       ; // sometimes called SIDAT
3699 #endif
3700
3701 #ifdef S1IST_AT_0XDC
3702 #undef S1IST_AT_0XDC
3703 // P89C668 specific
3704 sfr at 0xDC S1IST       ;
3705 #endif
3706
3707 #ifdef S1RELL
3708 #undef S1RELL
3709 sfr at 0x9D S1RELL ; // serial channel 1 reload register low byte SAB80517 specific
3710 #endif
3711
3712 #ifdef S1RELH
3713 #undef S1RELH
3714 sfr at 0xBB S1RELH ; // serial channel 1 reload register high byte SAB80517 specific
3715 #endif
3716
3717 #ifdef S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
3718 #undef S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
3719 sfr at 0xD9 S1STA       ; // Serial 1 status, P80C552 specific
3720 // Not directly accessible Bits.
3721 #define SC0     0x08
3722 #define SC1     0x10
3723 #define SC2     0x20
3724 #define SC3     0x40
3725 #define SC4     0x80
3726 #endif
3727
3728 #ifdef SADR_AT_0XA9
3729 #undef SADR_AT_0XA9
3730 sfr at 0xA9 SADDR       ;
3731 #endif
3732
3733 #ifdef SADDR0
3734 #undef SADDR0
3735 // DS80C320 specific
3736 sfr at 0xA9 SADDR0  ;
3737 #endif
3738
3739 #ifdef SADDR1
3740 #undef SADDR1
3741 // DS80C320 specific
3742 sfr at 0xAA SADDR1  ;
3743 #endif
3744
3745 #ifdef SADEN_AT_0XB9
3746 #undef SADEN_AT_0XB9
3747 sfr at 0xB9 SADEN       ;
3748 #endif
3749
3750 #ifdef SADEN0
3751 #undef SADEN0
3752 // DS80C320 & DS80C390 specific
3753 sfr at 0xB9 SADEN0  ;
3754 #endif
3755
3756 #ifdef SADEN1
3757 #undef SADEN1
3758 // DS80C320 & DS80C390 specific
3759 sfr at 0xBA SADEN1  ;
3760 #endif
3761
3762 #ifdef SBUF
3763 #undef SBUF
3764 sfr at 0x99 SBUF ;
3765 sfr at 0x99 SBUF0 ;
3766 #endif
3767
3768 #ifdef SBUF1
3769 #undef SBUF1
3770 // DS80C320 & DS80C390 specific
3771 sfr at 0xC1 SBUF1 ;
3772 #endif
3773
3774 #ifdef SCON
3775 #undef SCON
3776 sfr at 0x98 SCON ;
3777 // Bit registers
3778 sbit at 0x98 RI   ;
3779 sbit at 0x99 TI   ;
3780 sbit at 0x9A RB8  ;
3781 sbit at 0x9B TB8  ;
3782 sbit at 0x9C REN  ;
3783 sbit at 0x9D SM2  ;
3784 sbit at 0x9E SM1  ;
3785 sbit at 0x9F SM0  ;
3786 #endif
3787
3788 #ifdef SCON0
3789 #undef SCON0
3790 sfr at 0x98 SCON0 ;
3791 // Bit registers
3792 sbit at 0x98 RI_0   ;
3793 sbit at 0x99 TI_0   ;
3794 sbit at 0x9A RB8_0  ;
3795 sbit at 0x9B TB8_0  ;
3796 sbit at 0x9C REN_0  ;
3797 sbit at 0x9D SM2_0  ;
3798 sbit at 0x9E SM1_0  ;
3799 sbit at 0x9F SM0_0  ;
3800 sbit at 0x9F FE_0   ;
3801 sbit at 0x9F SM0_FE_0  ;
3802 #endif
3803
3804 #ifdef SCON1
3805 #undef SCON1
3806 // DS80C320 - 80C390 specific
3807 sfr at 0xC0 SCON1  ;
3808 // Bit registers
3809 sbit at 0xC0 RI_1         ;
3810 sbit at 0xC1 TI_1         ;
3811 sbit at 0xC2 RB8_1        ;
3812 sbit at 0xC3 TB8_1        ;
3813 sbit at 0xC4 REN_1        ;
3814 sbit at 0xC5 SM2_1        ;
3815 sbit at 0xC6 SM1_1        ;
3816 sbit at 0xC7 SM0_1        ;
3817 sbit at 0xC7 FE_1         ;
3818 sbit at 0xC7 SM0_FE_1     ;
3819 #endif
3820
3821 #ifdef SP
3822 #undef SP
3823 sfr at 0x81 SP   ;
3824 #endif
3825
3826 #ifdef SPCR
3827 #undef SPCR
3828 sfr at 0xD5 SPCR   ;   // AT89S53 specific
3829 // Not directly accesible bits
3830 #define SPR0 0x01
3831 #define SPR1 0x02
3832 #define CPHA 0x04
3833 #define CPOL 0x08
3834 #define MSTR 0x10
3835 #define DORD 0x20
3836 #define SPE  0x40
3837 #define SPIE 0x80
3838 #endif
3839
3840 #ifdef SPDR
3841 #undef SPDR
3842 sfr at 0x86 SPDR   ;   // AT89S53 specific
3843 // Not directly accesible bits
3844 #define SPD_0 0x01
3845 #define SPD_1 0x02
3846 #define SPD_2 0x04
3847 #define SPD_3 0x08
3848 #define SPD_4 0x10
3849 #define SPD_5 0x20
3850 #define SPD_6 0x40
3851 #define SPD_7 0x80
3852 #endif
3853
3854 #ifdef SPSR
3855 #undef SPSR
3856 sfr at 0xAA SPSR   ;   // AT89S53 specific
3857 // Not directly accesible bits
3858 #define SPIF 0x40
3859 #define WCOL 0x80
3860 #endif
3861
3862 #ifdef SRELH
3863 #undef SRELH
3864 sfr at 0xBA SRELH       ; // Baudrate generator reload high
3865 #endif
3866
3867 #ifdef SRELL
3868 #undef SRELL
3869 sfr at 0xAA SRELL       ; // Baudrate generator reload low
3870 #endif
3871
3872 #ifdef STATUS__PIP__HIP__LIP__x__x__x__x__x
3873 #undef STATUS__PIP__HIP__LIP__x__x__x__x__x
3874 // DS80C320 specific
3875 sfr at 0xC5 STATUS ;
3876 // Not directly accessible Bits. DS80C320 specific
3877 #define LIP  0x20
3878 #define HIP  0x40
3879 #define PIP  0x80
3880 #endif
3881
3882 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3883 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3884 sfr at 0xC5 STATUS ; // DS80C390 specific
3885 // Not directly accessible Bits.
3886 #define SPRA0  0x01
3887 #define SPTA0  0x02
3888 #define SPRA1  0x04
3889 #define SPTA1  0x08
3890 #define LIP    0x20
3891 #define HIP    0x40
3892 #define PIP    0x80
3893 #endif
3894
3895 #ifdef STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
3896 #undef STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
3897 sfr at 0xC5 STATUS ; // DS89C420 specific
3898 // Not directly accessible Bits.
3899 #define SPRA0  0x01
3900 #define SPTA0  0x02
3901 #define SPRA1  0x04
3902 #define SPTA1  0x08
3903 #define PIS0   0x20
3904 #define PIS1   0x40
3905 #define PIS2   0x80
3906 #endif
3907
3908 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3909 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
3910 sfr at 0xC5 STATUS ; // DS80C390 specific
3911 // Not directly accessible Bits.
3912 #define SPRA0  0x01
3913 #define SPTA0  0x02
3914 #define SPRA1  0x04
3915 #define SPTA1  0x08
3916 #define LIP    0x20
3917 #define HIP    0x40
3918 #define PIP    0x80
3919 #endif
3920
3921 #ifdef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
3922 #undef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
3923 sfr at 0xC5 STATUS ; // DS87C520 & DS83520specific
3924 // Not directly accessible Bits.
3925 #define SPRA0  0x01
3926 #define SPTA0  0x02
3927 #define SPTA1  0x04
3928 #define SPTA2  0x08
3929 #define XTUP   0x10
3930 #define LIP    0x20
3931 #define HIP    0x40
3932 #define PIP    0x80
3933 #endif
3934
3935 #ifdef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
3936 #undef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
3937 sfr at 0xDA STATUS ; // DS5001specific
3938 // Not directly accessible Bits.
3939 #define OBF    0x01
3940 #define IBF    0x02
3941 #define F0     0x04
3942 #define IA0    0x08
3943 #define ST4    0x10
3944 #define ST5    0x20
3945 #define ST6    0x40
3946 #define ST7    0x80
3947 #endif
3948
3949 #ifdef STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
3950 #undef STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
3951 sfr at 0xEE STE         ; // Set enable, P80C552 specific
3952 // Not directly accessible Bits.
3953 #define SP40    0x01
3954 #define SP41    0x02
3955 #define SP42    0x04
3956 #define SP43    0x08
3957 #define SP44    0x10
3958 #define SP45    0x20
3959 #define TG46    0x40
3960 #define TG47    0x80
3961 #endif
3962
3963 #ifdef SYSCON
3964 #undef SYSCON
3965 sfr at 0xB1 SYSCON      ; // XRAM Controller Access Control
3966 // SYSCON bits
3967 #define SYSCON_XMAP0    0x01
3968 #define SYSCON_XMAP1    0x02
3969 #define SYSCON_RMAP             0x10
3970 #define SYSCON_EALE             0x20
3971 #endif
3972
3973 #ifdef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
3974 #undef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
3975 sfr at 0xC8 T2CON ;
3976 // Definitions for the 8052 compatible microcontrollers.
3977 // Bit registers
3978 sbit at 0xC8 CP_RL2  ;
3979 sbit at 0xC9 C_T2    ;
3980 sbit at 0xCA TR2     ;
3981 sbit at 0xCB EXEN2   ;
3982 sbit at 0xCC TCLK    ;
3983 sbit at 0xCD RCLK    ;
3984 sbit at 0xCE EXF2    ;
3985 sbit at 0xCF TF2     ;
3986 // alternate names
3987 sbit at 0xC8 T2CON_0 ;
3988 sbit at 0xC9 T2CON_1 ;
3989 sbit at 0xCA T2CON_2 ;
3990 sbit at 0xCB T2CON_3 ;
3991 sbit at 0xCC T2CON_4 ;
3992 sbit at 0xCD T2CON_5 ;
3993 sbit at 0xCE T2CON_6 ;
3994 sbit at 0xCF T2CON_7 ;
3995 #endif
3996
3997 #ifdef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
3998 #undef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
3999 sfr at 0xC8 T2CON ;
4000 // Definitions for the Infineon / Siemens SAB80515, SAB80515A, SAB80517
4001 // Bit registers
4002 sbit at 0xC8 T2I0 ;
4003 sbit at 0xC9 T2I1 ;
4004 sbit at 0xCA T2CM ;
4005 sbit at 0xCB T2R0 ;
4006 sbit at 0xCC T2R1 ;
4007 sbit at 0xCD I2FR ;
4008 sbit at 0xCE I3FR ;
4009 sbit at 0xCF T2PS ;
4010 // alternate names
4011 sbit at 0xC8 T2CON_0 ;
4012 sbit at 0xC9 T2CON_1 ;
4013 sbit at 0xCA T2CON_2 ;
4014 sbit at 0xCB T2CON_3 ;
4015 sbit at 0xCC T2CON_4 ;
4016 sbit at 0xCD T2CON_5 ;
4017 sbit at 0xCE T2CON_6 ;
4018 sbit at 0xCF T2CON_7 ;
4019 #endif
4020
4021 #ifdef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
4022 #undef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
4023 // Definitions for the timer/counter 2 of the Atmel & Dallas microcontrollers
4024 sfr at 0xC9 T2MOD  ;
4025 // Not not directly accessible T2MOD bits
4026 #define DCEN            0x01
4027 #define T2OE            0x02
4028 #define D13T2           0x08
4029 #define D13T1           0x10
4030 #endif
4031
4032 #ifdef T2MOD__x__x__x__x__x__x__T2OE__DCEN
4033 #undef T2MOD__x__x__x__x__x__x__T2OE__DCEN
4034 // Definitions for the timer/counter 2 of the Atmel 89x52 microcontroller
4035 sfr at 0xC9 T2MOD  ;
4036 // Not not directly accessible T2MOD bits
4037 #define DCEN            0x01
4038 #define T2OE            0x02
4039 // Alternate names
4040 #define DCEN_           0x01
4041 #define T2OE_           0x02
4042 #endif
4043
4044 #ifdef T3_AT_0XFF
4045 #undef T3_AT_0XFF
4046 sfr at 0xFF T3          ; // Timer 3, P80C552 specific
4047 #endif
4048
4049 #ifdef TA
4050 #undef TA
4051 // DS500x, DS80C320 & DS80C390 specific
4052 sfr at 0xC7 TA ;
4053 #endif
4054
4055 #ifdef TCON
4056 #undef TCON
4057 sfr at 0x88 TCON ;
4058 //  Bit registers
4059 sbit at 0x88 IT0  ;
4060 sbit at 0x89 IE0  ;
4061 sbit at 0x8A IT1  ;
4062 sbit at 0x8B IE1  ;
4063 sbit at 0x8C TR0  ;
4064 sbit at 0x8D TF0  ;
4065 sbit at 0x8E TR1  ;
4066 sbit at 0x8F TF1  ;
4067 #endif
4068
4069 #ifdef TH0
4070 #undef TH0
4071 sfr at 0x8C TH0  ;
4072 #endif
4073
4074 #ifdef TH1
4075 #undef TH1
4076 sfr at 0x8D TH1  ;
4077 #endif
4078
4079 #ifdef TH2
4080 #undef TH2
4081 sfr at 0xCD TH2     ;
4082 #endif
4083
4084 #ifdef TL0
4085 #undef TL0
4086 sfr at 0x8A TL0  ;
4087 #endif
4088
4089 #ifdef TL1
4090 #undef TL1
4091 sfr at 0x8B TL1  ;
4092 #endif
4093
4094 #ifdef TL2
4095 #undef TL2
4096 sfr at 0xCC TL2     ;
4097 #endif
4098
4099 #ifdef TMOD
4100 #undef TMOD
4101 sfr at 0x89 TMOD ;
4102 // Not directly accessible TMOD bits
4103 #define T0_M0           0x01
4104 #define T0_M1           0x02
4105 #define T0_CT           0x04
4106 #define T0_GATE         0x08
4107 #define T1_M0           0x10
4108 #define T1_M1           0x20
4109 #define T1_CT           0x40
4110 #define T1_GATE         0x80
4111
4112 #define T0_MASK         0x0F
4113 #define T1_MASK         0xF0
4114 #endif
4115
4116 #ifdef TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
4117 #undef TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
4118 sfr at 0xEA TM2CON      ; // Timer 2 control, P80C552 specific
4119 // Not directly accessible Bits.
4120 #define T2MS0   0x01
4121 #define T2MS1   0x02
4122 #define T2P0    0x04
4123 #define T2P1    0x08
4124 #define T2B0    0x10
4125 #define T2ER    0x20
4126 #define T2IS0   0x40
4127 #define T2IS1   0x80
4128 #endif
4129
4130 #ifdef TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
4131 #undef TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
4132 sfr at 0xC8 TM2IR       ; // Timer 2 int flag reg, P80C552 specific
4133 // Bit register
4134 sbit at 0xC8 CTI0       ;
4135 sbit at 0xC9 CTI1       ;
4136 sbit at 0xCA CTI2       ;
4137 sbit at 0xCB CTI3       ;
4138 sbit at 0xCC CMI0       ;
4139 sbit at 0xCD CMI1       ;
4140 sbit at 0xCE CMI2       ;
4141 sbit at 0xCF T20V       ;
4142 #endif
4143
4144 #ifdef TMH2_AT_0XED
4145 #undef TMH2_AT_0XED
4146 sfr at 0xED TMH2        ; // Timer high 2, P80C552 specific
4147 #endif
4148
4149 #ifdef TML2_AT_0XEC
4150 #undef TML2_AT_0XEC
4151 sfr at 0xEC TML2        ; // Timer low 2, P80C552 specific
4152 #endif
4153
4154 #ifdef WCON
4155 #undef WCON
4156 sfr at 0x96 WCON   ;   // AT89S53 specific
4157 // Not directly accesible bits
4158 #define WDTEN  0x01
4159 #define WDTRST 0x02
4160 #define DPS    0x04
4161 #define PS0    0x20
4162 #define PS1    0x40
4163 #define PS2    0x80
4164 #endif
4165
4166 #ifdef WDCON
4167 #undef WDCON
4168 // DS80C320 - 390, DS89C420, etc. specific
4169 sfr at 0xD8 WDCON ;
4170 //  Bit registers
4171 sbit at 0xD8 RWT    ;
4172 sbit at 0xD9 EWT    ;
4173 sbit at 0xDA WTRF   ;
4174 sbit at 0xDB WDIF   ;
4175 sbit at 0xDC PFI    ;
4176 sbit at 0xDD EPFI   ;
4177 sbit at 0xDE POR    ;
4178 sbit at 0xDF SMOD_1 ;
4179 #endif
4180
4181 #ifdef WDTPRG_AT_0XA7
4182 #undef WDTPRG_AT_0XA7
4183 sfr at 0xA7 WDTPRG;
4184 #define WDTRPRG_S0 0x01
4185 #define WDTRPRG_S1 0x02
4186 #define WDTRPRG_S2 0x04
4187 #endif
4188
4189 #ifdef WDTREL
4190 #undef WDTREL
4191 sfr at 0x86 WDTREL    ; // Watchdof Timer reload register
4192 #endif
4193
4194 #ifdef WDTRST_AT_0XA6
4195 #undef WDTRST_AT_0XA6
4196 sfr at 0xA6 WDTRST;
4197 #endif
4198
4199 #ifdef XPAGE
4200 #undef XPAGE
4201 sfr at 0x91 XPAGE     ; // Page Address Register for Extended On-Chip Ram - Infineon / Siemens SAB80515A specific
4202 #endif
4203
4204 /////////////////////////
4205 /// Interrupt vectors ///
4206 /////////////////////////
4207
4208 // Interrupt numbers: address = (number * 8) + 3
4209 #define IE0_VECTOR      0       // 0x03 external interrupt 0
4210 #define TF0_VECTOR      1       // 0x0b timer 0
4211 #define IE1_VECTOR      2       // 0x13 external interrupt 1
4212 #define TF1_VECTOR      3       // 0x1b timer 1
4213 #define SI0_VECTOR      4       // 0x23 serial port 0
4214
4215 #ifdef MICROCONTROLLER_AT89S53
4216 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4217 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
4218 #endif
4219
4220 #ifdef MICROCONTROLLER_AT89X52
4221 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4222 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
4223 #endif
4224
4225 #ifdef MICROCONTROLLER_AT89X55
4226 #define TF2_VECTOR      5       /* 0x2B timer 2 */
4227 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
4228 #endif
4229
4230 #ifdef MICROCONTROLLER_DS5000
4231 #define PFW_VECTOR      5       /* 0x2B */
4232 #endif
4233
4234 #ifdef MICROCONTROLLER_DS5001
4235 #define PFW_VECTOR      5       /* 0x2B */
4236 #endif
4237
4238 #ifdef MICROCONTROLLER_DS80C32X
4239 #define TF2_VECTOR      5  /* 0x2B */
4240 #define PFI_VECTOR      6  /* 0x33 */
4241 #define SIO1_VECTOR     7  /* 0x3B */
4242 #define IE2_VECTOR      8  /* 0x43 */
4243 #define IE3_VECTOR      9  /* 0x4B */
4244 #define IE4_VECTOR      10 /* 0x53 */
4245 #define IE5_VECTOR      11 /* 0x5B */
4246 #define WDI_VECTOR      12 /* 0x63 */
4247 #endif
4248
4249 #ifdef MICROCONTROLLER_DS8XC520
4250 #define TF2_VECTOR      5  /* 0x2B */
4251 #define PFI_VECTOR      6  /* 0x33 */
4252 #define SIO1_VECTOR     7  /* 0x3B */
4253 #define IE2_VECTOR      8  /* 0x43 */
4254 #define IE3_VECTOR      9  /* 0x4B */
4255 #define IE4_VECTOR      10 /* 0x53 */
4256 #define IE5_VECTOR      11 /* 0x5B */
4257 #define WDI_VECTOR      12 /* 0x63 */
4258 #endif
4259
4260 #ifdef MICROCONTROLLER_P80C552
4261 #define SIO1_VECTOR     5       // 0x2B SIO1 (I2C)
4262 #define CT0_VECTOR      6       // 0x33 T2 capture 0
4263 #define CT1_VECTOR      7   // 0x3B T2 capture 1
4264 #define CT2_VECTOR      8       // 0x43 T2 capture 2
4265 #define CT3_VECTOR      9       // 0x4B T2 capture 3
4266 #define ADC_VECTOR     10       // 0x53 ADC completion
4267 #define CM0_VECTOR     11       // 0x5B T2 compare 0
4268 #define CM1_VECTOR     12       // 0x63 T2 compare 1
4269 #define CM2_VECTOR     13       // 0x6B T2 compare 2
4270 #define TF2_VECTOR     14       // 0x73 T2 overflow
4271 #endif
4272
4273 #ifdef MICROCONTROLLER_P89C668
4274 #define SIO1_VECTOR 5   // 0x2b SIO1 (i2c)
4275 #define PCA_VECTOR  6   // 0x33 (Programmable Counter Array)
4276 #define TF2_VECTOR  7   // 0x3B (Timer 2)
4277 #endif
4278
4279 #ifdef MICROCONTROLLER_SAB80515
4280 #define TF2_VECTOR      5       // 0x2B timer 2
4281 #define EX2_VECTOR      5       // 0x2B external interrupt 2
4282 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
4283 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
4284 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
4285 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
4286 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
4287 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
4288 #endif
4289
4290 #ifdef MICROCONTROLLER_SAB80515A
4291 #define TF2_VECTOR      5       // 0x2B timer 2
4292 #define EX2_VECTOR      5       // 0x2B external interrupt 2
4293 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
4294 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
4295 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
4296 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
4297 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
4298 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
4299 #endif
4300
4301 #ifdef MICROCONTROLLER_SAB80517
4302 #define TF2_VECTOR      5       // 0x2B timer 2
4303 #define EX2_VECTOR      5       // 0x2B external interrupt 2
4304 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
4305 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
4306 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
4307 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
4308 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
4309 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
4310                                 // 0x73 not used
4311                                 // 0x7B not used
4312 #define SI1_VECTOR     16       // 0x83 serial port 1
4313                                 // 0x8B not used
4314                                 // 0x93 not used
4315 #define COMPARE_VECTOR 19       // 0x9B compare
4316 #endif
4317
4318 #ifdef MICROCONTORLLER_T89C51RD2
4319 #define TF2_VECTOR     5     /* 0x2B timer 2 */
4320 #define PCA_VECTOR     6     /* 0x33 Programmable Counter Array interrupt */
4321 #endif /* MICROCONTORLLER_T89C51RD2 */
4322
4323 #endif  // End of the header -> #ifndef MCS51REG_H
4324
4325
4326
4327