* sdcc.spec: updated
[fw/sdcc] / device / include / mcs51reg.h
1 /*-------------------------------------------------------------------------
2    Register Declarations for the mcs51 compatible microcontrollers
3
4    Written By -  Bela Torok / bela.torok@kssg.ch (November 2000)
5
6    This program is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published by the
8    Free Software Foundation; either version 2, or (at your option) any
9    later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20    In other words, you are welcome to use, share and improve this program.
21    You are forbidden to forbid anyone else to use, share and improve
22    what you give them.   Help stamp out software-hoarding!
23
24
25    History:
26    --------
27    Version 1.0 Nov 2, 2000 - B. Torok  / bela.torok@kssg.ch
28    Initial release, supported microcontrollers:
29    8051, 8052, Atmel AT89C1051, AT89C2051, AT89C4051,
30    Infineon / Siemens SAB80515, SAB80535, SAB80515A
31
32    Version 1.0.1 (Nov 3, 2000)
33    SAB80515A definitions revised by Michael Schmitt / michael.schmitt@t-online.de
34
35    Version 1.0.2 (Nov 6, 2000)
36    T2CON bug corrected 8052 and SABX microcontrollers have different T2CONs
37    Support for the Atmel AT89C52, AT80LV52, AT89C55, AT80LV55
38    Support for the Dallas DS80C320 and DS80C323
39    B. Torok / bela.torok@kssg.ch
40
41    Version 1.0.3 (Nov 7, 2000)
42    SAB80517 definitions added by Michael Schmitt / michael.schmitt@t-online.de
43    Dallas AT89S53 definitions added by B. Torok / bela.torok@kssg.ch
44    Dallas DS87C520 and DS83C520 definitions added by B. Torok / bela.torok@kssg.ch
45
46    Version 1.0.4 (Nov 9, 2000)
47    To simplify the identication of registers, a large number of definitios
48    were renamed. Long register names now (hopefully) clearly define the
49    function of the registers.
50    Dallas DS89C420 definitions added by B. Torok / bela.torok@kssg.ch
51
52    Version 1.0.5 (Dec 15, 2000)
53    Definitions added: #ifdef MCS51REG_EXTERNAL_ROM
54                       #ifdef MCS51REG_EXTERNAL_RAM
55                       #ifndef MCS51REG_DISABLE_WARNINGS
56
57
58    Version 1.0.6 (March 10, 2001)
59    Support for the Dallas DS5000 & DS2250
60    Support for the Dallas DS5001 & DS2251
61    Support for the Dallas DS80C390
62    microcontrollers - B. Torok / bela.torok@kssg.ch
63
64    Version 1.0.7 (June 7, 2001)
65    #ifndef MCS51REG_DISABLE_WARNINGS removed
66    #ifdef MCS51REG_DISABLE_WARNINGS added - B. Torok / bela.torok@kssg.ch
67    Support for the Philips P80C552 added - Bernhard Held / Bernhard.Held@otelo-online.de
68
69    Version 1.0.8 (Feb 28, 2002)
70    Dallas DS89C420 definitions corrected by B. Torok / bela.torok@kssg.ch
71    Revised by lanius@ewetel.net
72
73    Version 1.0.9 (Sept 9, 2002)
74    Register declarations for the Atmel T89C51RD2 added by Johannes Hoelzl / johannes.hoelzl@gmx.de
75
76    Version 1.0.10 (Sept 19, 2002)
77    Register declarations for the Philips P89C668 added by Eric Limpens / Eric@limpens.net
78
79    Adding support for additional microcontrollers:
80    -----------------------------------------------
81
82    1. Don't modify this file!!!
83
84    2. Insert your code in a separate file e.g.: mcs51reg_update.h and include
85       this after the #define HEADER_MCS51REG statement in this file
86
87    3. The mcs51reg_update.h file should contain following definitions:
88
89           a. An entry with the inventory of the register set of the
90              microcontroller in the  "Describe microcontrollers" section.
91
92           b. If necessary add entry(s) for registers not defined in this file
93
94           c. Define interrupt vectors
95
96    4. Compile a program for the microcontroller using the Preprocessor only, e.g.:, 
97       sdcc -E test.c > t.txt
98       and check definitions for validity in the t.txt file.
99
100    5. If everithing seems to be OK send me the mcs51reg_update.h file. --> bela.torok@kssg.ch
101       I'm going to resolve conflicts & verify/merge new definitions to this file.
102
103
104    Microcontroller support:
105
106    Use one of the following options:
107
108    1. use #include <mcs51reg.h> in your program & define MICROCONTROLLER_XXXX in your makefile.
109
110    2. use following definitions prior the
111       #include <mcs51reg.h> line in your program:
112       e.g.:
113       #define MICROCONTROLLER_8052       -> 8052 type microcontroller
114       or
115       #define MICROCONTROLLER_AT89CX051  -> Atmel AT89C1051, AT89C2051 and AT89C4051 microcontrollers
116
117
118    Use only one of the following definitions!!!
119
120    Supported Microcontrollers:
121
122    No definition                8051
123    MICROCONTROLLER_8051         8051
124    MICROCONTROLLER_8052         8052
125    MICROCONTROLLER_AT89CX051    Atmel AT89C1051, AT89C2051 and AT89C4051
126    MICROCONTROLLER_AT89S53      Atmel AT89S53 microcontroller
127    MICROCONTROLLER_AT89X52      Atmel AT89C52 and AT80LV52 microcontrollers
128    MICROCONTROLLER_AT89X55      Atmel AT89C55 and AT80LV55 microcontrollers
129    MICROCONTROLLER_DS5000       Dallas DS5000 & DS2250 microcontroller
130    MICROCONTROLLER_DS5001       Dallas DS5001 & DS2251 microcontroller
131    MICROCONTROLLER_DS80C32X     Dallas DS80C320 and DS80C323 microcontrollers
132    MICROCONTROLLER_DS80C390     Dallas DS80C390 microcontroller
133    MICROCONTROLLER_DS89C420     Dallas DS89C420 microcontroller
134    MICROCONTROLLER_DS8XC520     Dallas DS87C520 and DS83C520 microcontrollers
135    MICROCONTROLLER_P80C552      Philips P80C552
136    MICROCONTROLLER_P89C668      Philips P89C668
137    MICROCONTROLLER_SAB80515     Infineon / Siemens SAB80515 & SAB80535
138    MICROCONTROLLER_SAB80515A    Infineon / Siemens SAB80515A
139    MICROCONTROLLER_SAB80517     Infineon / Siemens SAB80517
140    MICROCONTROLLER_T89C51RD2    Atmel T89C51RD2
141
142    Additional definitions (use them prior the #include mcs51reg.h statement):
143
144    Ports P0 & P2 are not available if external ROM used.
145    Use statement "#define MCS51REG_EXTERNAL_ROM" to undefine P0 & P2.
146
147    Ports P0, P2, P3_6, WR, P3_7 & RD are not available if external RAM is used.
148    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
149    P3_6, WR, P3_7 & RD.
150
151    #define MCS51REG_ENABLE_WARNINGS -> enable warnings
152
153 -----------------------------------------------------------------------*/
154
155
156 #ifndef HEADER_MCS51REG
157 #define HEADER_MCS51REG
158
159 ///////////////////////////////////////////////////////
160 ///  Insert header here (for developers only)       ///
161 ///  remove "//" from the begining of the next line ///
162 //#include "mcs51reg_update.h"                      ///
163 ///////////////////////////////////////////////////////
164
165 //////////////////////////////////
166 ///  Describe microcontrollers ///
167 ///  (inventory of registers)  ///
168 //////////////////////////////////
169
170 // definitions for the 8051
171 #ifdef MICROCONTROLLER_8051
172 #ifdef MICROCONTROLLER_DEFINED
173 #define MCS51REG_ERROR
174 #endif
175 #ifndef MICROCONTROLLER_DEFINED
176 #define MICROCONTROLLER_DEFINED
177 #endif
178 #ifdef MCS51REG_ENABLE_WARNINGS
179 #warning Selected HW: 8051
180 #endif
181 #define P0
182 #define SP
183 #define DPL
184 #define DPH
185 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
186 #define TCON
187 #define TMOD
188 #define TL0
189 #define TL1
190 #define TH0
191 #define TH1
192 #define P1
193 #define SCON
194 #define SBUF
195 #define P2
196 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
197 #define P3
198 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
199 #define PSW
200 #define ACC
201 #define B
202 #endif
203 // end of definitions for the 8051
204
205
206 // definitions for the 8052 microcontroller
207 #ifdef MICROCONTROLLER_8052
208 #ifdef MICROCONTROLLER_DEFINED
209 #define MCS51REG_ERROR
210 #endif
211 #ifndef MICROCONTROLLER_DEFINED
212 #define MICROCONTROLLER_DEFINED
213 #endif
214 #ifdef MCS51REG_ENABLE_WARNINGS
215 #warning Selected HW: 8052
216 #endif
217 // 8051 register set
218 #define P0
219 #define SP
220 #define DPL
221 #define DPH
222 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
223 #define TCON
224 #define TMOD
225 #define TL0
226 #define TL1
227 #define TH0
228 #define TH1
229 #define P1
230 #define SCON
231 #define SBUF
232 #define P2
233 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
234 #define P3
235 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
236 #define PSW
237 #define ACC
238 #define B
239 // 8052 specific registers
240 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
241 #define RCAP2L
242 #define RCAP2H
243 #define TL2
244 #define TH2
245 #endif
246 // end of definitions for the 8052 microcontroller
247
248
249 // definitionsons for the Atmel
250 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
251 #ifdef MICROCONTROLLER_AT89CX051
252 #ifdef MICROCONTROLLER_DEFINED
253 #define MCS51REG_ERROR
254 #endif
255 #ifndef MICROCONTROLLER_DEFINED
256 #define MICROCONTROLLER_DEFINED
257 #endif
258 #ifdef MCS51REG_ENABLE_WARNINGS
259 #warning Selected HW: Atmel AT89Cx051
260 #endif
261 // 8051 register set without P0 & P2
262 #define SP
263 #define DPL
264 #define DPH
265 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
266 #define TCON
267 #define TMOD
268 #define TL0
269 #define TL1
270 #define TH0
271 #define TH1
272 #define P1
273 #define SCON
274 #define SBUF
275 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
276 #define P3
277 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
278 #define PSW
279 #define ACC
280 #define B
281 #endif
282 // end of definitionsons for the Atmel
283 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
284
285
286 // definitions for the Atmel AT89S53
287 #ifdef MICROCONTROLLER_AT89S53
288 #ifdef MICROCONTROLLER_DEFINED
289 #define MCS51REG_ERROR
290 #endif
291 #ifndef MICROCONTROLLER_DEFINED
292 #define MICROCONTROLLER_DEFINED
293 #endif
294 #ifdef MCS51REG_ENABLE_WARNINGS
295 #warning Selected HW: AT89S53
296 #endif
297 // 8051 register set
298 #define P0
299 #define SP
300 #define DPL
301 #define DPH
302 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
303 #define TCON
304 #define TMOD
305 #define TL0
306 #define TL1
307 #define TH0
308 #define TH1
309 #define P1
310 #define SCON
311 #define SBUF
312 #define P2
313 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
314 #define P3
315 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
316 #define PSW
317 #define ACC
318 #define B
319 // 8052 specific registers
320 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
321 #define RCAP2L
322 #define RCAP2H
323 #define TL2
324 #define TH2
325 // AT89S53 specific register
326 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
327 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
328 #define SPCR
329 #define SPDR
330 #define SPSR
331 #define WCOM
332 #define DPL1
333 #define DPH1
334 #endif
335 // end of definitions for the Atmel AT89S53 microcontroller
336
337
338 // definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
339 #ifdef MICROCONTROLLER_AT89X52
340 #ifdef MICROCONTROLLER_DEFINED
341 #define MCS51REG_ERROR
342 #endif
343 #ifndef MICROCONTROLLER_DEFINED
344 #define MICROCONTROLLER_DEFINED
345 #endif
346 #ifdef MCS51REG_ENABLE_WARNINGS
347 #warning Selected HW: AT89C52 or AT89LV52
348 #endif
349 // 8051 register set
350 #define P0
351 #define SP
352 #define DPL
353 #define DPH
354 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
355 #define TCON
356 #define TMOD
357 #define TL0
358 #define TL1
359 #define TH0
360 #define TH1
361 #define P1
362 #define SCON
363 #define SBUF
364 #define P2
365 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
366 #define P3
367 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
368 #define PSW
369 #define ACC
370 #define B
371 // 8052 specific registers
372 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
373 #define RCAP2L
374 #define RCAP2H
375 #define TL2
376 #define TH2
377 // AT89X55 specific register
378 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
379 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
380 #endif
381 // end of definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
382
383
384 // definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
385 #ifdef MICROCONTROLLER_AT89X55
386 #ifdef MICROCONTROLLER_DEFINED
387 #define MCS51REG_ERROR
388 #endif
389 #ifndef MICROCONTROLLER_DEFINED
390 #define MICROCONTROLLER_DEFINED
391 #endif
392 #ifdef MCS51REG_ENABLE_WARNINGS
393 #warning Selected HW: AT89C55 or AT89LV55
394 #endif
395 // 8051 register set
396 #define P0
397 #define SP
398 #define DPL
399 #define DPH
400 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
401 #define TCON
402 #define TMOD
403 #define TL0
404 #define TL1
405 #define TH0
406 #define TH1
407 #define P1
408 #define SCON
409 #define SBUF
410 #define P2
411 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
412 #define P3
413 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
414 #define PSW
415 #define ACC
416 #define B
417 // 8052 specific registers
418 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
419 #define RCAP2L
420 #define RCAP2H
421 #define TL2
422 #define TH2
423 // AT89X55 specific register
424 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
425 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
426 #endif
427 // end of definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
428
429
430 // definitions for the Dallas DS5000
431 #ifdef MICROCONTROLLER_DS5000
432 #ifdef MICROCONTROLLER_DEFINED
433 #define MCS51REG_ERROR
434 #endif
435 #ifndef MICROCONTROLLER_DEFINED
436 #define MICROCONTROLLER_DEFINED
437 #endif
438 #ifdef MCS51REG_ENABLE_WARNINGS
439 #warning Selected HW: DS5000
440 #endif
441 #define P0
442 #define SP
443 #define DPL
444 #define DPH
445 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
446 #define TCON
447 #define TMOD
448 #define TL0
449 #define TL1
450 #define TH0
451 #define TH1
452 #define P1
453 #define SCON
454 #define SBUF
455 #define P2
456 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
457 #define P3
458 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
459 #define MCON__SL__PAA__ECE2__RA32_8__PA0__PA1__PA2__PA3
460 #define TA
461 #define PSW
462 #define ACC
463 #define B
464 #endif
465 // end of definitions for the Dallas DS5000
466
467
468 // definitions for the Dallas DS5001
469 #ifdef MICROCONTROLLER_DS5001
470 #ifdef MICROCONTROLLER_DEFINED
471 #define MCS51REG_ERROR
472 #endif
473 #ifndef MICROCONTROLLER_DEFINED
474 #define MICROCONTROLLER_DEFINED
475 #endif
476 #ifdef MCS51REG_ENABLE_WARNINGS
477 #warning Selected HW: DS5001
478 #endif
479 #define P0
480 #define SP
481 #define DPL
482 #define DPH
483 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
484 #define TCON
485 #define TMOD
486 #define TL0
487 #define TL1
488 #define TH0
489 #define TH1
490 #define P1
491 #define SCON
492 #define SBUF
493 #define P2
494 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
495 #define P3
496 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
497 #define CRC
498 #define CRCLOW
499 #define CRCHIGH
500 #define MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
501 #define TA
502 #define RNR
503 #define PSW
504 #define RPCTL
505 #define STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
506 #define ACC
507 #define B
508 #endif
509 // end of definitions for the Dallas DS5001
510
511
512 // definitions for the Dallas DS80C320 and DS80C323 microcontrollers
513 #ifdef MICROCONTROLLER_DS80C32X
514 #ifdef MICROCONTROLLER_DEFINED
515 #define MCS51REG_ERROR
516 #endif
517 #ifndef MICROCONTROLLER_DEFINED
518 #define MICROCONTROLLER_DEFINED
519 #endif
520 #ifdef MCS51REG_ENABLE_WARNINGS
521 #warning Selected HW: Dallas DS80C320 or DS80C323
522 #endif
523 // 8051 register set
524 #define P0
525 #define SP
526 #define DPL
527 #define DPH
528 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
529 #define TCON
530 #define TMOD
531 #define TL0
532 #define TL1
533 #define TH0
534 #define TH1
535 #define P1
536 #define SCON
537 #define SCON0
538 #define SBUF
539 #define P2
540 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
541 #define P3
542 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
543 #define PSW
544 #define ACC
545 #define B
546 // 8052 specific registers
547 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
548 #define RCAP2L
549 #define RCAP2H
550 #define TL2
551 #define TH2
552 // DS80C320 specific register
553 #define DPL1
554 #define DPH1
555 #define DPS__x__x__x__x__x__x__x__SEL
556 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
557 #define EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
558 #define SADDR0
559 #define SADDR1
560 #define SADEN0
561 #define SADEN1
562 #define SCON1
563 #define SBUF1
564 #define STATUS__PIP__HIP__LIP__x__x__x__x__x
565 #define TA
566 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
567 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
568 #define WDCON
569 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
570 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
571 #endif
572 // end of definitions for the Dallas DS80C320 and DS80C323 microcontrollers
573
574
575 // definitions for the Dallas DS80C390
576 #ifdef MICROCONTROLLER_DS80C390
577 #ifdef MICROCONTROLLER_DEFINED
578 #define MCS51REG_ERROR
579 #endif
580 #ifndef MICROCONTROLLER_DEFINED
581 #define MICROCONTROLLER_DEFINED
582 #endif
583 #ifdef MCS51REG_ENABLE_WARNINGS
584 #warning Selected HW: Dallas DS80C390
585 #endif
586 // 8051 register set
587 #define P0
588 #define SP
589 #define DPL
590 #define DPH
591 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
592 #define TCON
593 #define TMOD
594 #define TL0
595 #define TL1
596 #define TH0
597 #define TH1
598 #define P1
599 #define SCON
600 #define SCON0
601 #define SBUF
602 #define P2
603 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
604 #define P3
605 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
606 #define PSW
607 #define ACC
608 #define B
609 // 8052 specific registers
610 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
611 #define RCAP2L
612 #define RCAP2H
613 #define TL2
614 #define TH2
615 // DS80C390 specific register
616 #define P4_AT_0X80
617 #define DPL1
618 #define DPH1
619 #define DPS__ID1__ID0__TSL__x__x__x__x__SEL
620 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
621 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
622 #define P4CNT
623 #define DPX
624 #define DPX1
625 #define C0RMS0
626 #define C0RMS1
627 #define ESP
628 #define AP
629 #define ACON__x__x__x__x__x__SA__AM1__AM0
630 #define C0TMA0
631 #define C0TMA1
632 #define P5_AT_0XA1
633 #define P5CNT
634 #define C0C
635 #define C0S
636 #define C0IR
637 #define C0TE
638 #define C0RE
639 #define SADDR0
640 #define SADDR1
641 #define C0M1C
642 #define C0M2C
643 #define C0M3C
644 #define C0M4C
645 #define C0M5C
646 #define C0M6C
647 #define C0M7C
648 #define C0M8C
649 #define C0M9C
650 #define C0M10C
651 #define SADEN0
652 #define SADEN1
653 #define C0M11C
654 #define C0M12C
655 #define C0M13C
656 #define C0M14C
657 #define C0M15C
658 #define SCON1
659 #define SBUF1
660 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
661 #define STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
662 #define MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
663 #define TA
664 #define T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
665 #define COR
666 #define MCNT0
667 #define MCNT1
668 #define MA
669 #define MB
670 #define MC
671 #define C1RSM0
672 #define C1RSM1
673 #define WDCON
674 #define C1TMA0
675 #define C1TMA1
676 #define C1C
677 #define C1S
678 #define C1IR
679 #define C1TE
680 #define C1RE
681 #define EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
682 #define MXMAX
683 #define C1M1C
684 #define C1M2C
685 #define C1M3C
686 #define C1M4C
687 #define C1M5C
688 #define C1M6C
689 #define C1M7C
690 #define C1M8C
691 #define C1M9C
692 #define EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
693 #define C1M10C
694 #define C1M11C
695 #define C1M12C
696 #define C1M13C
697 #define C1M14C
698 #define C1M15C
699 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
700 #endif
701 // end of definitions for the Dallas DS80C390
702
703 // definitions for the Dallas DS89C420 microcontroller
704 #ifdef MICROCONTROLLER_DS89C420
705 #ifdef MICROCONTROLLER_DEFINED
706 #define MCS51REG_ERROR
707 #endif
708 #ifndef MICROCONTROLLER_DEFINED
709 #define MICROCONTROLLER_DEFINED
710 #endif
711 #ifdef MCS51REG_ENABLE_WARNINGS
712 #warning Selected HW: Dallas DS89C420
713 #endif
714 // 8051 register set
715 #define P0
716 #define SP
717 #define DPL
718 #define DPH
719 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
720 #define TCON
721 #define TMOD
722 #define TL0
723 #define TL1
724 #define TH0
725 #define TH1
726 #define P1
727 #define SCON
728 #define SCON0
729 #define SBUF
730 #define P2
731 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
732 #define P3
733 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
734 #define PSW
735 #define ACC
736 #define B
737 // 8052 specific registers
738 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
739 #define RCAP2L
740 #define RCAP2H
741 #define TL2
742 #define TH2
743 // DS8XC420 specific registers
744 #define ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
745 #define DPL1
746 #define DPH1
747 #define DPS__ID1__ID0__TSL__AID__x__x__x__SEL
748 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
749 #define CKMOD
750 #define IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
751 #define IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
752 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
753 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
754 #define SADDR0
755 #define SADDR1
756 #define SADEN0
757 #define SADEN1
758 #define SCON1
759 #define SBUF1
760 #define STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
761 #define TA
762 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
763 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
764 #define ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
765 #define WDCON
766 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
767 #define EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
768 #define EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
769 #define FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
770 #endif
771 // end of definitions for the Dallas DS89C420 microcontroller
772
773 // definitions for the Dallas DS87C520 and DS83C520 microcontrollers
774 #ifdef MICROCONTROLLER_DS8XC520
775 #ifdef MICROCONTROLLER_DEFINED
776 #define MCS51REG_ERROR
777 #endif
778 #ifndef MICROCONTROLLER_DEFINED
779 #define MICROCONTROLLER_DEFINED
780 #endif
781 #ifdef MCS51REG_ENABLE_WARNINGS
782 #warning Selected HW: Dallas DS87C520 or DS85C520
783 #endif
784 // 8051 register set
785 #define P0
786 #define SP
787 #define DPL
788 #define DPH
789 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
790 #define TCON
791 #define TMOD
792 #define TL0
793 #define TL1
794 #define TH0
795 #define TH1
796 #define P1
797 #define SCON
798 #define SCON0
799 #define SBUF
800 #define P2
801 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
802 #define P3
803 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
804 #define PSW
805 #define ACC
806 #define B
807 // 8052 specific registers
808 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
809 #define RCAP2L
810 #define RCAP2H
811 #define TL2
812 #define TH2
813 // DS8XC520 specific registers
814 #define DPL1
815 #define DPH1
816 #define DPS__x__x__x__x__x__x__x__SEL
817 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
818 #define EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
819 #define PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
820 #define SADDR0
821 #define SADDR1
822 #define SADEN0
823 #define SADEN1
824 #define SCON1
825 #define SBUF1
826 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
827 #define TA
828 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
829 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
830 #define WDCON
831 #define ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
832 #define BP2
833 #define WDCON
834 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
835 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
836 #endif
837 // end of definitions for the Dallas DS87C520 and DS83C520 microcontrollers
838
839
840 // definitions for the Philips P80C552 microcontroller
841 #ifdef MICROCONTROLLER_P80C552
842 #ifdef MICROCONTROLLER_DEFINED
843 #define MCS51REG_ERROR
844 #endif
845 #ifndef MICROCONTROLLER_DEFINED
846 #define MICROCONTROLLER_DEFINED
847 #endif
848 #ifdef MCS51REG_ENABLE_WARNINGS
849 #warning Selected HW: Philips P80C552
850 #endif
851 // 8051 register set
852 #define P0
853 #define SP
854 #define DPL
855 #define DPH
856 #define PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
857 #define TCON
858 #define TMOD
859 #define TL0
860 #define TL1
861 #define TH0
862 #define TH1
863 #define P1
864 #define SCON
865 #define SBUF
866 #define P2
867 #define IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
868 #define P3
869 #define IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
870 #define PSW
871 #define ACC
872 #define B
873 // P80C552 specific register-names
874 #define S0BUF           // same as SBUF, set in mcs51reg.h
875 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
876 // P80C552 specific registers
877 #define ADCH_AT_0XC6
878 #define ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
879 #define CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
880 #define CTH0_AT_0XCC
881 #define CTH1_AT_0XCD
882 #define CTH2_AT_0XCE
883 #define CTH3_AT_0XCF
884 #define CMH0_AT_0XC9
885 #define CMH1_AT_0XCA
886 #define CMH2_AT_0XCB
887 #define CTL0_AT_0XAC
888 #define CTL1_AT_0XAD
889 #define CTL2_AT_0XAE
890 #define CTL3_AT_0XAF
891 #define CML0_AT_0XA9
892 #define CML1_AT_0XAA
893 #define CML2_AT_0XAB
894 #define IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
895 #define IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
896 #define PWM0_AT_0XFC
897 #define PWM1_AT_0XFD
898 #define PWMP_AT_0XFE
899 #define P1_EXT__SDA__SCL__RT2__T2__CT3I__CT2I__CT1I__CT0I
900 #define P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
901 #define P5_AT_0XC4
902 #define RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
903 #define S1ADR__x__x__x__x__x__x__x__GC
904 #define S1DAT_AT_0XDA
905 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
906 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
907 #define STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
908 #define TMH2_AT_0XED
909 #define TML2_AT_0XEC
910 #define TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
911 #define TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
912 #define T3_AT_0XFF
913 #endif
914 // end of definitions for the Philips P80C552 microcontroller
915
916
917 // definitions for the Philips P89C668
918 #ifdef MICROCONTROLLER_P89C668
919 #ifdef MICROCONTROLLER_DEFINED
920 #define MCS51REG_ERROR
921 #endif
922 #ifndef MICROCONTROLLER_DEFINED
923 #define MICROCONTROLLER_DEFINED
924 #endif
925 #ifdef MCS51REG_ENABLE_WARNINGS
926 #warning Selected HW: P89C668
927 #endif
928 #define P0
929 #define P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
930 #define P1
931 #define P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
932 #define P2
933 #define P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
934 #define P3
935 #define P3_EXT__x__x__CEX4__CEX3__x__x__x__x
936 #define SP
937 #define DPL
938 #define DPH
939 #define TCON
940 #define TMOD
941 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
942 #define TL0
943 #define TL1
944 #define TH0
945 #define TH1
946 #define SCON
947 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
948 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
949 #define SBUF
950 #define S0BUF SBUF
951 #define PSW
952 #define ACC
953 #define B
954 #define SADR_AT_0XA9
955 #define SADEN_AT_0XB9
956 #define S1IST_AT_0XDC
957 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
958 #define S1DAT_AT_0XDA
959 #define S1ADR__x__x__x__x__x__x__x__GC
960 #define SBUF
961 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
962 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
963 #define RCAP2L
964 #define RCAP2H
965 #define TL2
966 #define TH2
967 #define IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
968 #define IEN1__x__x__x__x__x__x__x__ET2
969 #define IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
970 #define IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
971 #define CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
972 #define CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
973 #define AUXR__x__x__x__x__x__x__EXTRAM__A0
974 #define AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
975 #define WDTRST_AT_0XA6
976 #define CCAPM0_AT_0XC2
977 #define CCAPM1_AT_0XC3
978 #define CCAPM2_AT_0XC4
979 #define CCAPM3_AT_0XC5
980 #define CCAPM4_AT_0XC6
981 #define CCAP0L_AT_0XEA
982 #define CCAP1L_AT_0XEB
983 #define CCAP2L_AT_0XEC
984 #define CCAP3L_AT_0XED
985 #define CCAP4L_AT_0XEE
986 #define CH_AT_0XF9
987 #define CL_AT_0XE9
988 #define CCAP0H_AT_0XFA
989 #define CCAP1H_AT_0XFB
990 #define CCAP2H_AT_0XFC
991 #define CCAP3H_AT_0XFD
992 #define CCAP4H_AT_0XFE
993 #endif
994 // end of definitions for the Philiüs P89C668
995
996
997 // definitions for the Infineon / Siemens SAB80515 & SAB80535
998 #ifdef MICROCONTROLLER_SAB80515
999 #ifdef MICROCONTROLLER_DEFINED
1000 #define MCS51REG_ERROR
1001 #endif
1002 #ifndef MICROCONTROLLER_DEFINED
1003 #define MICROCONTROLLER_DEFINED
1004 #endif
1005 #ifdef MCS51REG_ENABLE_WARNINGS
1006 #warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
1007 #endif
1008 // 8051 register set without IP
1009 #define P0
1010 #define SP
1011 #define DPL
1012 #define DPH
1013 #define PCON__SMOD__x__x__x__x__x__x__x
1014 #define TCON
1015 #define TMOD
1016 #define TL0
1017 #define TL1
1018 #define TH0
1019 #define TH1
1020 #define P1
1021 #define SCON
1022 #define SBUF
1023 #define P2
1024 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1025 #define P3
1026 #define PSW
1027 #define ACC
1028 #define B
1029 // SAB80515 specific registers
1030 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1031 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1032 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1033 #define IRCON
1034 #define CCEN
1035 #define CCL1
1036 #define CCH1
1037 #define CCL2
1038 #define CCH2
1039 #define CCL3
1040 #define CCH3
1041 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1042 #define CRCL
1043 #define CRCH
1044 #define TL2
1045 #define TH2
1046 #define ADCON
1047 #define ADDAT
1048 #define DAPR__SAB80515
1049 #define P4_AT_0XE8
1050 #define P5_AT_0XF8
1051 #endif
1052 // end of definitions for the Infineon / Siemens SAB80515
1053
1054
1055 // definitions for the Infineon / Siemens SAB80515A
1056 #ifdef MICROCONTROLLER_SAB80515A
1057 #ifdef MICROCONTROLLER_DEFINED
1058 #define MCS51REG_ERROR
1059 #endif
1060 #ifndef MICROCONTROLLER_DEFINED
1061 #define MICROCONTROLLER_DEFINED
1062 #endif
1063 #ifdef MCS51REG_ENABLE_WARNINGS
1064 #warning Selected HW: Infineon / Siemens SAB80515A
1065 #endif
1066 // 8051 register set without IP
1067 #define P0
1068 #define SP
1069 #define DPL
1070 #define DPH
1071 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1072 #define TCON
1073 #define TMOD
1074 #define TL0
1075 #define TL1
1076 #define TH0
1077 #define TH1
1078 #define P1
1079 #define SCON
1080 #define SBUF
1081 #define P2
1082 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1083 #define P3
1084 #define PSW
1085 #define ACC
1086 #define B
1087 // SAB80515A specific registers
1088 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1089 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1090 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1091 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1092 #define IRCON
1093 #define CCEN
1094 #define CCL1
1095 #define CCH1
1096 #define CCL2
1097 #define CCH2
1098 #define CCL3
1099 #define CCH3
1100 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1101 #define CRCL
1102 #define CRCH
1103 #define TL2
1104 #define TH2
1105 #define ADCON0
1106 #define ADDATH
1107 #define ADDATL
1108 #define ADCON1
1109 #define SRELL
1110 #define SYSCON
1111 #define SRELH
1112 #define P4_AT_0XE8
1113 #define P5_AT_0XF8
1114 #define P6_AT_0XDB
1115 #define XPAGE
1116 #endif
1117 // end of definitions for the Infineon / Siemens SAB80515A
1118
1119
1120 // definitions for the Infineon / Siemens SAB80517
1121 #ifdef MICROCONTROLLER_SAB80517
1122 #ifdef MICROCONTROLLER_DEFINED
1123 #define MCS51REG_ERROR
1124 #endif
1125 #ifndef MICROCONTROLLER_DEFINED
1126 #define MICROCONTROLLER_DEFINED
1127 #endif
1128 #ifdef MCS51REG_ENABLE_WARNINGS
1129 #warning Selected HW: Infineon / Siemens SAB80517
1130 #endif
1131 // 8051 register set without IP, SCON & SBUF
1132 #define P0
1133 #define SP
1134 #define DPL
1135 #define DPH
1136 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1137 #define TCON
1138 #define TMOD
1139 #define TL0
1140 #define TL1
1141 #define TH0
1142 #define TH1
1143 #define P1
1144 // #define SCON
1145 // #define SBUF
1146 #define P2
1147 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1148 #define P3
1149 #define PSW
1150 #define ACC
1151 #define B
1152 // SAB80517 specific registers
1153 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1154 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1155 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1156 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1157 #define IEN2__SAB80517
1158 #define IRCON
1159 #define CCEN
1160 #define CCL1
1161 #define CCH1
1162 #define CCL2
1163 #define CCH2
1164 #define CCL3
1165 #define CCH3
1166 #define CCL4
1167 #define CCH4
1168 #define CC4EN
1169 #define CMEN
1170 #define CMH0
1171 #define CML0
1172 #define CMH1
1173 #define CML1
1174 #define CMH2
1175 #define CML2
1176 #define CMH3
1177 #define CML3
1178 #define CMH4
1179 #define CML4
1180 #define CMH5
1181 #define CML5
1182 #define CMH6
1183 #define CML6
1184 #define CMH7
1185 #define CML7
1186 #define CMSEL
1187 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1188 #define CRCL
1189 #define CRCH
1190 #define CTCOM_AT_0XE1
1191 #define CTRELH
1192 #define CTRELL
1193 #define TL2
1194 #define TH2
1195 #define ADCON0
1196 #define ADCON1
1197 #define ADDAT
1198 #define DAPR__SAB80517
1199 #define P4_AT_0XE8
1200 #define P5_AT_0XF8
1201 #define P6_AT_0XFA
1202 #define P7_AT_0XDB
1203 #define P8_AT_0XDD
1204 #define DPSEL
1205 #define ARCON
1206 #define MD0
1207 #define MD1
1208 #define MD2
1209 #define MD3
1210 #define MD4
1211 #define MD5
1212 #define S0BUF
1213 #define S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
1214 #define S0RELH
1215 #define S0RELL
1216 #define S1BUF
1217 #define S1CON_AT_0X9B
1218 #define S1RELH
1219 #define S1RELL
1220 #define WDTH
1221 #define WDTL
1222 #define WDTREL
1223 #endif
1224 // end of definitions for the Infineon / Siemens SAB80517
1225
1226
1227 // definitions for the Atmel T89C51RD2
1228 #ifdef MICROCONTROLLER_T89C51RD2
1229 #ifdef MICROCONTROLLER_DEFINED
1230 #define MCS51REG_ERROR
1231 #endif
1232 #ifndef MICROCONTROLLER_DEFINED
1233 #define MICROCONTROLLER_DEFINED
1234 #endif
1235 #ifdef MCS51REG_ENABLE_WARNINGS
1236 #warning Selected HW: T89C51RD2
1237 #endif
1238
1239 // 8051 register set
1240 #define P0
1241 #define SP
1242 #define DPL
1243 #define DPH
1244 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
1245 #define TCON
1246 #define TMOD
1247 #define TL0
1248 #define TL1
1249 #define TH0
1250 #define TH1
1251 #define P1
1252 #define SCON
1253 #define SBUF
1254 #define P2
1255 #define IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
1256 #define SADDR
1257 #define P3
1258 #define IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
1259 #define PSW
1260 #define ACC
1261 #define B
1262
1263 // 8052 register set
1264 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
1265 #define RCAP2L
1266 #define RCAP2H
1267 #define TL2
1268 #define TH2
1269
1270 // T89C51RD2 register set
1271 #define P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
1272 #define P5_AT_0XE8
1273 #define SADEN0
1274
1275 #define AUXR1__x__x__x__x__GF3__x__x__DPS
1276 #define WDTRST_AT_0XA6
1277 #define WDTPRG_AT_0XA7
1278 #define AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1279 #define IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
1280 #define FCON
1281 #define EECON
1282 #define EETIM
1283 #define CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
1284 #define CCON__x__CF__CR__CCF4__CCF3__CCF2__CCF1__CCF0
1285 #define CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
1286 #define CCAPM0_AT_0XDA
1287 #define CCAPM1_AT_0XDB
1288 #define CCAPM2_AT_0XDC
1289 #define CCAPM3_AT_0XDD
1290 #define CCAPM4_AT_0XDE
1291 #define CL_AT_0XE9
1292 #define CCAP0L_AT_0XEA
1293 #define CCAP1L_AT_0XEB
1294 #define CCAP2L_AT_0XEC
1295 #define CCAP3L_AT_0XED
1296 #define CCAP4L_AT_0XEE
1297 #define CH_AT_0XF9
1298 #define CCAP0H_AT_0XFA
1299 #define CCAP1H_AT_0XFB
1300 #define CCAP2H_AT_0XFC
1301 #define CCAP3H_AT_0XFD
1302 #define CCAP4H_AT_0XFE
1303 #endif /* MICROCONTROLLER_T89C51RD2 */
1304 /* end of definition for the Atmel T89C51RD2 */
1305
1306
1307 /////////////////////////////////////////////////////////
1308 ///  don't specify microcontrollers below this line!  ///
1309 /////////////////////////////////////////////////////////
1310
1311
1312 // default microcontroller -> 8051
1313 // use default if no microcontroller specified
1314 #ifndef MICROCONTROLLER_DEFINED
1315 #define MICROCONTROLLER_DEFINED
1316 #ifdef MCS51REG_ENABLE_WARNINGS
1317 #warning No microcontroller defined!
1318 #warning Code generated for the 8051
1319 #endif
1320 // 8051 register set
1321 #define P0
1322 #define SP
1323 #define DPL
1324 #define DPH
1325 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
1326 #define TCON
1327 #define TMOD
1328 #define TL0
1329 #define TL1
1330 #define TH0
1331 #define TH1
1332 #define P1
1333 #define SCON
1334 #define SBUF
1335 #define P2
1336 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1337 #define P3
1338 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
1339 #define PSW
1340 #define ACC
1341 #define B
1342 #endif
1343 // end of definitions for the default microcontroller
1344
1345
1346 #ifdef MCS51REG_ERROR
1347 #error Two or more microcontrollers defined!
1348 #endif
1349
1350 #ifdef MCS51REG_EXTERNAL_ROM
1351 #ifndef MCS51REG_UNDEFINE_P0
1352 #define MCS51REG_UNDEFINE_P0
1353 #endif
1354 #ifndef MCS51REG_UNDEFINE_P2
1355 #define MCS51REG_UNDEFINE_P2
1356 #endif
1357 #endif
1358
1359 #ifdef MCS51REG_EXTERNAL_RAM
1360 #ifndef MCS51REG_UNDEFINE_P0
1361 #define MCS51REG_UNDEFINE_P0
1362 #endif
1363 #ifndef MCS51REG_UNDEFINE_P2
1364 #define MCS51REG_UNDEFINE_P2
1365 #endif
1366 #endif
1367
1368 #ifdef MCS51REG_UNDEFINE_P0
1369 #undef P0
1370 #endif
1371
1372 #ifdef MCS51REG_UNDEFINE_P2
1373 #undef P2
1374 #endif
1375
1376 ////////////////////////////////
1377 ///  Register definitions    ///
1378 ///  (In alphabetical order) ///
1379 ////////////////////////////////
1380
1381 #ifdef ACC
1382 #undef ACC
1383 sfr at 0xE0 ACC  ;
1384 #endif
1385
1386 #ifdef ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
1387 #undef ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
1388 sfr at 0x9D ACON   ; // DS89C420 specific
1389 // Not directly accessible bits
1390 #define PAGES0   0x20
1391 #define PAGES1   0x40
1392 #define PAGEE    0x80
1393 #endif
1394
1395 #ifdef ACON__x__x__x__x__x__SA__AM1__AM0
1396 #undef ACON__x__x__x__x__x__SA__AM1__AM0
1397 sfr at 0x9D ACON   ; // DS89C390 specific
1398 // Not directly accessible bits
1399 #define AM0   0x01
1400 #define AM1   0x02
1401 #define SA    0x04
1402 #endif
1403
1404 #ifdef ADCH_AT_0XC6
1405 #undef ADCH_AT_0XC6
1406 sfr at 0xC6 ADCH        ; // A/D converter high
1407 #endif
1408
1409 #ifdef ADCON
1410 #undef ADCON
1411 sfr at 0xD8 ADCON   ; // A/D-converter control register SAB80515 specific
1412 // Bit registers
1413 sbit at 0xD8 MX0        ;
1414 sbit at 0xD9 MX1        ;
1415 sbit at 0xDA MX2        ;
1416 sbit at 0xDB ADM        ;
1417 sbit at 0xDC BSY        ;
1418 sbit at 0xDE CLK        ;
1419 sbit at 0xDF BD         ;
1420 #endif
1421
1422 // ADCON0 ... Infineon / Siemens also called this register ADCON in the User Manual
1423 #ifdef ADCON0
1424 #undef ADCON0
1425 sfr at 0xD8 ADCON0      ; // A/D-converter control register 0 SAB80515A &
1426 // Bit registers          // SAB80517 specific
1427 sbit at 0xD8 MX0        ;
1428 sbit at 0xD9 MX1        ;
1429 sbit at 0xDA MX2        ;
1430 sbit at 0xDB ADM        ;
1431 sbit at 0xDC BSY        ;
1432 sbit at 0xDD ADEX       ;
1433 sbit at 0xDE CLK        ;
1434 sbit at 0xDF BD         ;
1435 // Not directly accessible ADCON0
1436 #define ADCON0_MX0              0x01
1437 #define ADCON0_MX1              0x02
1438 #define ADCON0_MX2              0x04
1439 #define ADCON0_ADM              0x08
1440 #define ADCON0_BSY              0x10
1441 #define ADCON0_ADEX             0x20
1442 #define ADCON0_CLK              0x40
1443 #define ADCON0_BD               0x80
1444 #endif
1445
1446 #ifdef ADCON1
1447 #undef ADCON1
1448 sfr at 0xDC ADCON1      ; // A/D-converter control register 1 SAB80515A & SAB80517 specific
1449 // Not directly accessible ADCON1
1450 #define ADCON1_MX0              0x01
1451 #define ADCON1_MX1              0x02
1452 #define ADCON1_MX2              0x04
1453 #define ADCON1_ADCL             0x80
1454 #endif
1455
1456 #ifdef ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
1457 #undef ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
1458 sfr at 0xC5 ADCON       ; // A/D control, P80C552 specific
1459 // Not directly accessible Bits.
1460 #define AADR0   0x01
1461 #define AADR1   0x02
1462 #define AADR2   0x04
1463 #define ADCS    0x08
1464 #define ADCI    0x10
1465 #define ADEX    0x20
1466 #define ADC_0   0x40    // different name as ADC0 in P5
1467 #define ADC_1   0x80    // different name as ADC1 in P5
1468 #endif
1469
1470 #ifdef ADDAT
1471 #undef ADDAT
1472 sfr at 0xD9 ADDAT   ; // A/D-converter data register SAB80515 specific
1473 #endif
1474
1475 #ifdef ADDATH
1476 #undef ADDATH
1477 sfr at 0xD9 ADDATH      ; // A/D data high byte SAB80515A specific
1478 #endif
1479
1480 #ifdef ADDATL
1481 #undef ADDATL
1482 sfr at 0xDA ADDATL      ; // A/D data low byte SAB80515A specific
1483 #endif
1484
1485 #ifdef ARCON
1486 #undef ARCON
1487 sfr at 0xEF ARCON       ; // arithmetic control register SAB80517
1488 #endif
1489
1490 #ifdef AP
1491 #undef AP
1492 sfr at 0x9C AP          ; // DS80C390
1493 #endif
1494
1495 #ifdef AUXR__x__x__x__x__x__x__EXTRAM__A0
1496 #undef AUXR__x__x__x__x__x__x__EXTRAM__A0
1497 // P89C668 specific, Auxilary
1498 sfr at 0x8E AUXR        ;
1499 // not bit addressable:
1500 #define EXTRAM 0x02
1501 #define A0     0x01
1502 #endif
1503
1504 #ifdef AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1505 #undef AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1506 sfr at 0x8E AUXR;
1507 #define AO     0x01
1508 #define EXTRAM 0x02
1509 #define XRS0   0x04
1510 #define XRS1   0x08
1511 #define M0     0x20
1512 #endif
1513 #ifdef B
1514 #undef B
1515 sfr at 0xF0 B    ;
1516 // Bit registers
1517 sbit at 0xF0 BREG_F0        ;
1518 sbit at 0xF1 BREG_F1        ;
1519 sbit at 0xF2 BREG_F2        ;
1520 sbit at 0xF3 BREG_F3        ;
1521 sbit at 0xF4 BREG_F4        ;
1522 sbit at 0xF5 BREG_F5        ;
1523 sbit at 0xF6 BREG_F6        ;
1524 sbit at 0xF7 BREG_F7        ;
1525 #endif
1526
1527 #ifdef AUXR1__x__x__x__x__GF3__x__x__DPS
1528 #undef AUXR1__x__x__x__x__GF3__x__x__DPS
1529 sfr at 0xA2 AUXR1;
1530 #define DPS       0x01
1531 #define GF3       0x08
1532 #endif
1533
1534 #ifdef AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
1535 #undef AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
1536 // P89C668 specific, Auxilary 1
1537 sfr at 0xA2 AUXR1       ;
1538 #define ENBOOT      0x20
1539 #define GF2         0x08
1540 #define ALWAYS_ZERO 0x04
1541 #define DPS         0x01
1542 #endif
1543
1544 #ifdef BP2
1545 #undef BP2
1546 sfr at 0xC3 BP2    ;
1547 // Not directly accessible bits
1548 #define MS0   0x01
1549 #define MS1   0x02
1550 #define MS2   0x04
1551 #define LB1   0x08
1552 #define LB2   0x10
1553 #define LB3   0x20
1554 #endif
1555
1556 #ifdef C0C
1557 #undef C0C
1558 sfr at 0xA3 C0C         ; // DS80C390 specific
1559 // Not directly accessible bits
1560 #define SWINT   0x01
1561 #define ERCS    0x02
1562 #define AUTOB   0x04
1563 #define CRST    0x08
1564 #define SIESTA  0x10
1565 #define PDE     0x20
1566 #define STIE    0x40
1567 #define ERIE    0x80
1568 #endif
1569
1570 #ifdef C0IR
1571 #undef C0IR
1572 sfr at 0xA5 C0IR        ; // DS80C390 specific
1573 // Not directly accessible bits
1574 #define INTIN0     0x01
1575 #define INTIN1     0x02
1576 #define INTIN2     0x04
1577 #define INTIN3     0x08
1578 #define INTIN4     0x10
1579 #define INTIN5     0x20
1580 #define INTIN6     0x40
1581 #define INTIN7     0x80
1582 #endif
1583
1584 #ifdef C0M1C
1585 #undef C0M1C
1586 sfr at 0xAB C0M1C       ; // DS80C390 specific
1587 // Not directly accessible bits
1588 #define DTUP     0x01
1589 #define ROW_TIH  0x02
1590 #define MTRQ     0x04
1591 #define EXTRQ    0x08
1592 #define INTRQ    0x10
1593 #define ERI      0x20
1594 #define ETI      0x40
1595 #define MSRDY    0x80
1596 #endif
1597
1598 #ifdef C0M2C
1599 #undef C0M2C
1600 sfr at 0xAC C0M2C       ; // DS80C390 specific
1601 #endif
1602
1603 #ifdef C0M3C
1604 #undef C0M3C
1605 sfr at 0xAD C0M3C       ; // DS80C390 specific
1606 #endif
1607
1608 #ifdef C0M4C
1609 #undef C0M4C
1610 sfr at 0xAE C0M4C       ; // DS80C390 specific
1611 #endif
1612
1613 #ifdef C0M5C
1614 #undef C0M5C
1615 sfr at 0xAF C0M5C       ; // DS80C390 specific
1616 #endif
1617
1618 #ifdef C0M6C
1619 #undef C0M6C
1620 sfr at 0xB3 C0M6C       ; // DS80C390 specific
1621 #endif
1622
1623 #ifdef C0M7C
1624 #undef C0M7C
1625 sfr at 0xB4 C0M7C       ; // DS80C390 specific
1626 #endif
1627
1628 #ifdef C0M8C
1629 #undef C0M8C
1630 sfr at 0xB5 C0M8C       ; // DS80C390 specific
1631 #endif
1632
1633 #ifdef C0M9C
1634 #undef C0M9C
1635 sfr at 0xB6 C0M9C       ; // DS80C390 specific
1636 #endif
1637
1638 #ifdef C0M10C
1639 #undef C0M10C
1640 sfr at 0xB7 C0M10C       ; // DS80C390 specific
1641 #endif
1642
1643 #ifdef C0M11C
1644 #undef C0M11C
1645 sfr at 0xBB C0M11C       ; // DS80C390 specific
1646 #endif
1647
1648 #ifdef C0M12C
1649 #undef C0M12C
1650 sfr at 0xBC C0M12C       ; // DS80C390 specific
1651 #endif
1652
1653 #ifdef C0M13C
1654 #undef C0M13C
1655 sfr at 0xBD C0M13C       ; // DS80C390 specific
1656 #endif
1657
1658 #ifdef C0M14C
1659 #undef C0M14C
1660 sfr at 0xBE C0M14C       ; // DS80C390 specific
1661 #endif
1662
1663 #ifdef C0M15C
1664 #undef C0M15C
1665 sfr at 0xBF C0M15C       ; // DS80C390 specific
1666 #endif
1667
1668 #ifdef C0RE
1669 #undef C0RE
1670 sfr at 0xA7 C0RE        ; // DS80C390 specific
1671 #endif
1672
1673 #ifdef C0RMS0
1674 #undef C0RMS0
1675 sfr at 0x96 C0RMS0      ; // DS80C390 specific
1676 #endif
1677
1678 #ifdef C0RMS1
1679 #undef C0RMS1
1680 sfr at 0x97 C0RMS1      ; // DS80C390 specific
1681 #endif
1682
1683 #ifdef C0S
1684 #undef C0S
1685 sfr at 0xA4 C0S         ; // DS80C390 specific
1686 // Not directly accessible bits
1687 #define ER0     0x01
1688 #define ER1     0x02
1689 #define ER2     0x04
1690 #define TXS     0x08
1691 #define RXS     0x10
1692 #define WKS     0x20
1693 #define EC96_128    0x40
1694 #define BSS     0x80
1695 #endif
1696
1697 #ifdef C0TE
1698 #undef C0TE
1699 sfr at 0xA6 C0TE        ; // DS80C390 specific
1700 #endif
1701
1702 #ifdef C0TMA0
1703 #undef C0TMA0
1704 sfr at 0x9E C0TMA0      ; // DS80C390 specific
1705 #endif
1706
1707 #ifdef C0TMA1
1708 #undef C0TMA1
1709 sfr at 0x9F C0TMA1      ; // DS80C390 specific
1710 #endif
1711
1712 #ifdef C1C
1713 #undef C1C
1714 sfr at 0xE3 C1C         ; // DS80C390 specific
1715 // Not directly accessible bits
1716 #define SWINT   0x01
1717 #define ERCS    0x02
1718 #define AUTOB   0x04
1719 #define CRST    0x08
1720 #define SIESTA  0x10
1721 #define PDE     0x20
1722 #define STIE    0x40
1723 #define ERIE    0x80
1724 #endif
1725
1726 #ifdef C1IR
1727 #undef C1IR
1728 sfr at 0xE5 C1IR         ; // DS80C390 specific
1729 // Not directly accessible bits
1730 #define INTIN0  0x01
1731 #define INTIN1  0x02
1732 #define INTIN2  0x04
1733 #define INTIN3  0x08
1734 #define INTIN4  0x10
1735 #define INTIN5  0x20
1736 #define INTIN6  0x40
1737 #define INTIN7  0x80
1738 #endif
1739
1740 #ifdef C1IRE
1741 #undef C1IRE
1742 sfr at 0xE7 C1RE         ; // DS80C390 specific
1743 #endif
1744
1745 #ifdef C1M1C
1746 #undef C1M1C
1747 sfr at 0xEB C1M1C        ; // DS80C390 specific
1748 #endif
1749
1750 #ifdef C1M2C
1751 #undef C1M2C
1752 sfr at 0xEC C1M2C        ; // DS80C390 specific
1753 #endif
1754
1755 #ifdef C1M3C
1756 #undef C1M3C
1757 sfr at 0xED C1M3C        ; // DS80C390 specific
1758 #endif
1759
1760 #ifdef C1M4C
1761 #undef C1M4C
1762 sfr at 0xEE C1M4C        ; // DS80C390 specific
1763 #endif
1764
1765 #ifdef C1M5C
1766 #undef C1M5C
1767 sfr at 0xEF C1M5C        ; // DS80C390 specific
1768 #endif
1769
1770 #ifdef C1M6C
1771 #undef C1M6C
1772 sfr at 0xF3 C1M6C        ; // DS80C390 specific
1773 #endif
1774
1775 #ifdef C1M7C
1776 #undef C1M7C
1777 sfr at 0xF4 C1M7C        ; // DS80C390 specific
1778 #endif
1779
1780 #ifdef C1M8C
1781 #undef C1M8C
1782 sfr at 0xF5 C1M8C        ; // DS80C390 specific
1783 #endif
1784
1785 #ifdef C1M9C
1786 #undef C1M9C
1787 sfr at 0xF6 C1M9C        ; // DS80C390 specific
1788 #endif
1789
1790 #ifdef C1M10C
1791 #undef C1M10C
1792 sfr at 0xF7 C1M10C       ; // DS80C390 specific
1793 #endif
1794
1795 #ifdef C1M11C
1796 #undef C1M11C
1797 sfr at 0xFB C1M11C       ; // DS80C390 specific
1798 #endif
1799
1800 #ifdef C1M12C
1801 #undef C1M12C
1802 sfr at 0xFC C1M12C       ; // DS80C390 specific
1803 #endif
1804
1805 #ifdef C1M13C
1806 #undef C1M13C
1807 sfr at 0xFD C1M13C        ; // DS80C390 specific
1808 #endif
1809
1810 #ifdef C1M14C
1811 #undef C1M14C
1812 sfr at 0xFE C1M14C        ; // DS80C390 specific
1813 #endif
1814
1815 #ifdef C1M15C
1816 #undef C1M15C
1817 sfr at 0xFF C1M15C        ; // DS80C390 specific
1818 #endif
1819
1820 #ifdef C1S
1821 #undef C1S
1822 sfr at 0xE4 C1S          ; // DS80C390 specific
1823 // Not directly accessible bits
1824 #define ER0     0x01
1825 #define ER1     0x02
1826 #define ER2     0x04
1827 #define TXS     0x08
1828 #define RXS     0x10
1829 #define WKS     0x20
1830 #define CECE    0x40
1831 #define BSS     0x80
1832 #endif
1833
1834 #ifdef C1ITE
1835 #undef C1ITE
1836 sfr at 0xE6 C1TE         ; // DS80C390 specific
1837 #endif
1838
1839 #ifdef C1RSM0
1840 #undef C1RSM0
1841 sfr at 0xD6 C1RSM0      ; // DS80C390 specific
1842 #endif
1843
1844 #ifdef C1RSM1
1845 #undef C1RSM1
1846 sfr at 0xD7 C1RSM1      ; // DS80C390 specific
1847 #endif
1848
1849 #ifdef C1TMA0
1850 #undef C1TMA0
1851 sfr at 0xDE C1TMA0      ; // DS80C390 specific
1852 #endif
1853
1854 #ifdef C1TMA1
1855 #undef C1TMA1
1856 sfr at 0xDF C1TMA1      ; // DS80C390 specific
1857 #endif
1858
1859 #ifdef CC4EN
1860 #undef CC4EN
1861 sfr at 0xC9 CC4EN       ; // compare/capture 4 enable register SAB80517 specific
1862 #endif
1863
1864 #ifdef CCAP0H_AT_0XFA 
1865 #undef CCAP0H_AT_0XFA 
1866 sfr at 0xFA CCAP0H;
1867 #endif
1868
1869 #ifdef CCAP1H_AT_0XFB 
1870 #undef CCAP1H_AT_0XFB 
1871 sfr at 0xFB CCAP1H;
1872 #endif
1873
1874 #ifdef CCAP2H_AT_0XFC 
1875 #undef CCAP2H_AT_0XFC 
1876 sfr at 0xFC CCAP2H;
1877 #endif
1878
1879 #ifdef CCAP3H_AT_0XFD 
1880 #undef CCAP3H_AT_0XFD 
1881 sfr at 0xFD CCAP3H;
1882 #endif
1883
1884 #ifdef CCAP4H_AT_0XFE 
1885 #undef CCAP4H_AT_0XFE 
1886 sfr at 0xFE CCAP4H;
1887 #endif
1888
1889 #ifdef CCAP0L_AT_0XEA 
1890 #undef CCAP0L_AT_0XEA 
1891 sfr at 0xEA CCAP0L;
1892 #endif
1893
1894 #ifdef CCAP1L_AT_0XEB 
1895 #undef CCAP1L_AT_0XEB 
1896 sfr at 0xEB CCAP1L;
1897 #endif
1898
1899 #ifdef CCAP2L_AT_0XEC 
1900 #undef CCAP2L_AT_0XEC 
1901 sfr at 0xEC CCAP2L;
1902 #endif
1903
1904 #ifdef CCAP3L_AT_0XED 
1905 #undef CCAP3L_AT_0XED 
1906 sfr at 0xED CCAP3L;
1907 #endif
1908
1909 #ifdef CCAP4L_AT_0XEE 
1910 #undef CCAP4L_AT_0XEE 
1911 sfr at 0xEE CCAP4L;
1912 #endif
1913
1914 #ifdef CCAPM0_AT_0XC2
1915 #undef CCAPM0_AT_0XC2
1916 // P89C668 specific, Capture module:
1917 sfr at 0xC2 CCAPM0      ;
1918 #endif
1919
1920 #ifdef CCAPM0_AT_0XDA
1921 #undef CCAPM0_AT_0XDA
1922 sfr at 0xDA CCAPM0;
1923 #define ECCF       0x01
1924 #define PWM        0x02
1925 #define TOG        0x04
1926 #define MAT        0x08
1927 #define CAPN       0x10
1928 #define CAPP       0x20
1929 #define ECOM       0x40
1930 #endif
1931
1932 #ifdef CCAPM1_AT_0XC3
1933 #undef CCAPM1_AT_0XC3
1934 sfr at 0xC3 CCAPM1      ;
1935 #endif
1936
1937 #ifdef CCAPM1_AT_0XDB
1938 #undef CCAPM1_AT_0XDB
1939 sfr at 0xDB CCAPM1;
1940 #endif
1941
1942 #ifdef CCAPM2_AT_0XC4
1943 #undef CCAPM2_AT_0XC4
1944 sfr at 0xC4 CCAPM2      ;
1945 #endif
1946
1947 #ifdef CCAPM2_AT_0XDC
1948 #undef CCAPM2_AT_0XDC
1949 sfr at 0x0DC CCAPM2;
1950 #endif
1951
1952 #ifdef CCAPM3_AT_0XC5
1953 #undef CCAPM3_AT_0XC5
1954 sfr at 0xC5 CCAPM3      ;
1955 #endif
1956
1957 #ifdef CCAPM3_AT_0XDD 
1958 #undef CCAPM3_AT_0XDD 
1959 sfr at 0x0DD CCAPM3;
1960 #endif
1961
1962 #ifdef CCAPM4_AT_0XDE
1963 #undef CCAPM4_AT_0XDE 
1964 sfr at 0x0DE CCAPM4;
1965 #endif
1966
1967 #ifdef CCAPM4_AT_0XC6
1968 #undef CCAPM4_AT_0XC6
1969 sfr at 0xC6 CCAPM4      ;
1970 #endif
1971
1972 #ifdef CCEN
1973 #undef CCEN
1974 sfr at 0xC1 CCEN        ; // compare/capture enable register SAB80515 specific
1975 #endif
1976
1977 #ifdef CCH1
1978 #undef CCH1
1979 sfr at 0xC3 CCH1        ; // compare/capture register 1, high byte SAB80515 specific
1980 #endif
1981
1982 #ifdef CCH2
1983 #undef CCH2
1984 sfr at 0xC5 CCH2        ; // compare/capture register 2, high byte SAB80515 specific
1985 #endif
1986
1987 #ifdef CCH3
1988 #undef CCH3
1989 sfr at 0xC7 CCH3        ; // compare/capture register 3, high byte SAB80515 specific
1990 #endif
1991
1992 #ifdef CCH4
1993 #undef CCH4
1994 sfr at 0xCF CCH4        ; // compare/capture register 4, high byte SAB80515 specific
1995 #endif
1996
1997 #ifdef CCL1
1998 #undef CCL1
1999 sfr at 0xC2 CCL1        ; // compare/capture register 1, low byte SAB80515 specific
2000 #endif
2001
2002 #ifdef CCL2
2003 #undef CCL2
2004 sfr at 0xC4 CCL2        ; // compare/capture register 2, low byte SAB80515 specific
2005 #endif
2006
2007 #ifdef CCL3
2008 #undef CCL3
2009 sfr at 0xC6 CCL3        ; // compare/capture register 3, low byte SAB80515 specific
2010 #endif
2011
2012 #ifdef CCL4
2013 #undef CCL4
2014 sfr at 0xCE CCL4        ; // compare/capture register 4, low byte SAB80515 specific
2015 #endif
2016
2017 #ifdef CCON__x__CF__CR__CCF4__CCF3__CCF2__CCF1__CCF0
2018 #undef CCON__x__CF__CR__CCF4__CCF3__CCF2__CCF1__CCF0
2019 sfr at 0xD8 CCON;         // T89C51RD2 specific register
2020 // Bit registers
2021 sbit at 0xD8 CCF0;
2022 sbit at 0xD9 CCF1;
2023 sbit at 0xDA CCF2;
2024 sbit at 0xDB CCF3;
2025 sbit at 0xDC CCF4;
2026 sbit at 0xDD CR;
2027 sbit at 0xDE CF;
2028 #endif
2029
2030 #ifdef CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2031 #undef CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2032 // P89C668 specific, PCA Counter control:
2033 sfr at 0xC0 CCON        ;
2034 // Bit registers
2035 sbit at 0xC0 CCF0       ;
2036 sbit at 0xC1 CCF1       ;
2037 sbit at 0xC2 CCF2       ;
2038 sbit at 0xC3 CCF3       ;
2039 sbit at 0xC4 CCF4       ;
2040 //sbit at 0xC5 -
2041 sbit at 0xC6 CR         ;
2042 sbit at 0xC7 CF         ;
2043 #endif
2044
2045 #ifdef CH_AT_0XF9
2046 #undef CH_AT_0XF9
2047 sfr at 0xF9 CH;
2048 #endif
2049
2050 #ifdef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2051 #undef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2052 // P89C668 specific, PCA Counter mode:
2053 sfr at 0xC1 CMOD        ;
2054 // not bit addressable:
2055 #define CIDL 0x80
2056 #define WDTE 0x40
2057 #define CPS1 0x04
2058 #define CPS0 0x02
2059 #define ECF  0x01
2060 #endif
2061
2062 #ifdef CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
2063 #undef CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
2064 sfr at 0x8E CKCON       ; // DS80C320 & DS80C390 specific
2065 // Not directly accessible Bits.
2066 #define MD0    0x01
2067 #define MD1    0x02
2068 #define MD2    0x04
2069 #define T0M    0x08
2070 #define T1M    0x10
2071 #define T2M    0x20
2072 #define WD0    0x40
2073 #define WD1    0x80
2074 #endif
2075
2076 #ifdef CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
2077 #undef CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
2078 sfr at 0x8F CKCON;
2079 #define X2        0x01
2080 #define T0X2      0x02
2081 #define T1X2      0x04
2082 #define T2X2      0x08
2083 #define SiX2      0x10
2084 #define PcaX2     0x20
2085 #define WdX2      0x40
2086 #endif
2087
2088 #ifdef CKMOD
2089 #undef CKMOD
2090 sfr at 0x96 CKMOD       ; // DS89C420 specific
2091 // Not directly accessible Bits.
2092 #define T0MH   0x08
2093 #define T1MH   0x10
2094 #define T2MH   0x20
2095 #endif
2096
2097 #ifdef CL_AT_0XE9 
2098 #undef CL_AT_0XE9 
2099 sfr at 0xE9 CL;
2100 #endif
2101
2102 #ifdef CMEN
2103 #undef CMEN
2104 sfr at 0xF6 CMEN    ; // compare enable register SAB80517 specific
2105 #endif
2106
2107 #ifdef CMH0
2108 #undef CMH0
2109 sfr at 0xD3 CMH0    ; // compare register 0 high byte SAB80517 specific
2110 #endif
2111
2112 #ifdef CMH1
2113 #undef CMH1
2114 sfr at 0xD5 CMH1    ; // compare register 1 high byte SAB80517 specific
2115 #endif
2116
2117 #ifdef CMH2
2118 #undef CMH2
2119 sfr at 0xD7 CMH2    ; // compare register 2 high byte SAB80517 specific
2120 #endif
2121
2122 #ifdef CMH3
2123 #undef CMH3
2124 sfr at 0xE3 CMH3    ; // compare register 3 high byte SAB80517 specific
2125 #endif
2126
2127 #ifdef CMH4
2128 #undef CMH4
2129 sfr at 0xE5 CMH4    ; // compare register 4 high byte SAB80517 specific
2130 #endif
2131
2132 #ifdef CMH5
2133 #undef CMH5
2134 sfr at 0xE7 CMH5    ; // compare register 5 high byte SAB80517 specific
2135 #endif
2136
2137 #ifdef CMH6
2138 #undef CMH6
2139 sfr at 0xF3 CMH6    ; // compare register 6 high byte SAB80517 specific
2140 #endif
2141
2142 #ifdef CMH7
2143 #undef CMH7
2144 sfr at 0xF5 CMH7    ; // compare register 7 high byte SAB80517 specific
2145 #endif
2146
2147 #ifdef CMH0_AT_0XC9
2148 #undef CMH0_AT_0XC9
2149 sfr at 0xC9 CMH0        ; // Compare high 0, P80C552 specific
2150 #endif
2151
2152 #ifdef CMH1_AT_0XCA
2153 #undef CMH1_AT_0XCA
2154 sfr at 0xCA CMH1        ; // Compare high 1, P80C552 specific
2155 #endif
2156
2157 #ifdef CMH2_AT_0XCB
2158 #undef CMH2_AT_0XCB
2159 sfr at 0xCB CMH2        ; // Compare high 2, P80C552 specific
2160 #endif
2161
2162 #ifdef CML0
2163 #undef CML0
2164 sfr at 0xD2 CML0    ; // compare register 0 low byte SAB80517 specific
2165 #endif
2166
2167 #ifdef CML1
2168 #undef CML1
2169 sfr at 0xD4 CML1    ; // compare register 1 low byte SAB80517 specific
2170 #endif
2171
2172 #ifdef CML2
2173 #undef CML2
2174 sfr at 0xD6 CML2    ; // compare register 2 low byte SAB80517 specific
2175 #endif
2176
2177 #ifdef CML3
2178 #undef CML3
2179 sfr at 0xE2 CML3    ; // compare register 3 low byte SAB80517 specific
2180 #endif
2181
2182 #ifdef CML4
2183 #undef CML4
2184 sfr at 0xE4 CML4    ; // compare register 4 low byte SAB80517 specific
2185 #endif
2186
2187 #ifdef CML5
2188 #undef CML5
2189 sfr at 0xE6 CML5    ; // compare register 5 low byte SAB80517 specific
2190 #endif
2191
2192 #ifdef CML6
2193 #undef CML6
2194 sfr at 0xF2 CML6    ; // compare register 6 low byte SAB80517 specific
2195 #endif
2196
2197 #ifdef CML7
2198 #undef CML7
2199 sfr at 0xF4 CML7    ; // compare register 7 low byte SAB80517 specific
2200 #endif
2201
2202 #ifdef CML0_AT_0XA9
2203 #undef CML0_AT_0XA9
2204 sfr at 0xA9 CML0        ; // Compare low 0, P80C552 specific
2205 #endif
2206
2207 #ifdef CML1_AT_0XAA
2208 #undef CML1_AT_0XAA
2209 sfr at 0xAA CML1        ; // Compare low 1, P80C552 specific
2210 #endif
2211
2212 #ifdef CML2_AT_0XAB
2213 #undef CML2_AT_0XAB
2214 sfr at 0xAB CML2        ; // Compare low 2, P80C552 specific
2215 #endif
2216
2217 #ifdef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2218 #undef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2219 sfr at 0xD9 CMOD;
2220 #define ECF        0x01
2221 #define CPS0       0x02
2222 #define CPS1       0x04
2223 #define WDTE       0x40
2224 #define CIDL       0x80
2225 #endif
2226
2227 #ifdef CMSEL
2228 #undef CMSEL
2229 sfr at 0xF7 CMSEL   ; // compare input select SAB80517
2230 #endif
2231
2232 #ifdef COR
2233 #undef COR
2234 sfr at 0xCE COR     ; // Dallas DS80C390 specific
2235 #define CLKOE       0x01
2236 #define COD0        0x02
2237 #define COD1        0x04
2238 #define C0BPR6      0x08
2239 #define C0BPR7      0x10
2240 #define C1BPR6      0x20
2241 #define C1BPR7      0x40
2242 #define IRDACK      0x80
2243 #endif
2244
2245 #ifdef CRC
2246 #undef CRC
2247 sfr at 0xC1 CRC     ; // Dallas DS5001 specific
2248 #define CRC_        0x01
2249 #define MDM         0x02
2250 #define RNGE0       0x10
2251 #define RNGE1       0x20
2252 #define RNGE2       0x40
2253 #define RNGE3       0x80
2254 #endif
2255
2256 #ifdef CRCH
2257 #undef CRCH
2258 sfr at 0xCB CRCH    ; // compare/reload/capture register, high byte SAB80515 specific
2259 #endif
2260
2261 #ifdef CRCHIGH
2262 #undef CRCHIGH
2263 sfr at 0xC3 CRCHIGH ; // DS5001 specific
2264 #endif
2265
2266 #ifdef CRCL
2267 #undef CRCL
2268 sfr at 0xCA CRCL    ; // compare/reload/capture register, low byte SAB80515 specific
2269 #endif
2270
2271 #ifdef CRCLOW
2272 #undef CRCLOW
2273 sfr at 0xC2 CRCLOW  ; // DS5001 specific
2274 #endif
2275
2276 #ifdef CTCOM_AT_0XE1
2277 #undef CTCOM_AT_0XE1
2278 sfr at 0xE1 CTCON    ; // com.timer control register SAB80517
2279 #endif
2280
2281 #ifdef CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
2282 #undef CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
2283 sfr at 0xEB CTCON       ; // Capture control, P80C552 specific
2284 // Not directly accessible Bits.
2285 #define CTP0    0x01
2286 #define CTN0    0x02
2287 #define CTP1    0x04
2288 #define CTN1    0x08
2289 #define CTP2    0x10
2290 #define CTN2    0x20
2291 #define CTP3    0x40
2292 #define CTN3    0x80
2293 #endif
2294
2295 #ifdef CTH0_AT_0XCC
2296 #undef CTH0_AT_0XCC
2297 sfr at 0xCC CTH0        ; // Capture high 0, P80C552 specific
2298 #endif
2299
2300 #ifdef CTH1_AT_0XCD
2301 #undef CTH1_AT_0XCD
2302 sfr at 0xCD CTH1        ; // Capture high 1, P80C552 specific
2303 #endif
2304
2305 #ifdef CTH2_AT_0XCE
2306 #undef CTH2_AT_0XCE
2307 sfr at 0xCE CTH2        ; // Capture high 2, P80C552 specific
2308 #endif
2309
2310 #ifdef CTH3_AT_0XCF
2311 #undef CTH3_AT_0XCF
2312 sfr at 0xCF CTH3        ; // Capture high 3, P80C552 specific
2313 #endif
2314
2315 #ifdef CTL0_AT_0XAC
2316 #undef CTL0_AT_0XAC
2317 sfr at 0xAC CTL0        ; // Capture low 0, P80C552 specific
2318 #endif
2319
2320 #ifdef CTL1_AT_0XAD
2321 #undef CTL1_AT_0XAD
2322 sfr at 0xAD CTL1        ; // Capture low 1, P80C552 specific
2323 #endif
2324
2325 #ifdef CTL2_AT_0XAE
2326 #undef CTL2_AT_0XAE
2327 sfr at 0xAE CTL2        ; // Capture low 2, P80C552 specific
2328 #endif
2329
2330 #ifdef CTL3_AT_0XAF
2331 #undef CTL3_AT_0XAF
2332 sfr at 0xAF CTL3        ; // Capture low 3, P80C552 specific
2333 #endif
2334
2335 #ifdef CTRELH
2336 #undef CTRELH
2337 sfr at 0xDF CTRELH  ; // com.timer rel register high byte SAB80517
2338 #endif
2339
2340 #ifdef CTRELL
2341 #undef CTRELL
2342 sfr at 0xDE CTRELL  ; // com.timer rel register low byte SAB80517
2343 #endif
2344
2345 #ifdef DAPR__SAB80515
2346 #undef DAPR__SAB80515
2347 sfr at 0xD8 DAPR    ; // D/A-converter program register SAB80515 specific
2348 #endif
2349
2350 #ifdef DAPR__SAB80517
2351 #undef DAPR__SAB80517
2352 sfr at 0xDA DAPR    ; // D/A-converter program register SAB80517 specific
2353 #endif
2354
2355 #ifdef DPH
2356 #undef DPH
2357 sfr at 0x83 DPH  ;
2358 sfr at 0x83 DP0H ;  // Alternate name for AT89S53
2359 #endif
2360
2361 #ifdef DPH1
2362 #undef DPH1
2363 sfr at 0x85 DPH1  ; // DS80C320 specific
2364 sfr at 0x85 DP1H  ; // Alternate name for AT89S53
2365 #endif
2366
2367 #ifdef DPL
2368 #undef DPL
2369 sfr at 0x82 DPL  ;  // Alternate name for AT89S53
2370 sfr at 0x82 DP0L ;
2371 #endif
2372
2373 #ifdef DPL1
2374 #undef DPL1
2375 sfr at 0x84 DPL1  ; // DS80C320 specific
2376 sfr at 0x84 DP1L  ; // Alternate name for AT89S53
2377 #endif
2378
2379 #ifdef DPS__x__x__x__x__x__x__x__SEL
2380 #undef DPS__x__x__x__x__x__x__x__SEL
2381 sfr at 0x86 DPS  ;
2382 // Not directly accessible DPS Bit. DS80C320 & DPS8XC520 specific
2383 #define SEL    0x01
2384 #endif
2385
2386 #ifdef DPS__ID1__ID0__TSL__x__x__x__x__SEL
2387 #undef DPS__ID1__ID0__TSL__x__x__x__x__SEL
2388 sfr at 0x86 DPS  ;
2389 // Not directly accessible DPS Bit. DS89C390 specific
2390 #define SEL    0x01
2391 #define TSL    0x20
2392 #define ID0    0x40
2393 #define ID1    0x80
2394 #endif
2395
2396 #ifdef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
2397 #undef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
2398 sfr at 0x86 DPS  ;
2399 // Not directly accessible DPS Bit. DS89C420 specific
2400 #define SEL    0x01
2401 #define AID    0x10
2402 #define TSL    0x20
2403 #define ID0    0x40
2404 #define ID1    0x80
2405 #endif
2406
2407 #ifdef DPSEL
2408 #undef DPSEL
2409 sfr at 0x92 DPSEL   ; // data pointer select register SAB80517
2410 #endif
2411
2412 #ifdef DPX
2413 #undef DPX
2414 sfr at 0x93 DPX1  ; // DS80C390 specific
2415 #endif
2416
2417 #ifdef DPX1
2418 #undef DPX1
2419 sfr at 0x95 DPX1  ; // DS80C390 specific
2420 #endif
2421
2422 #ifdef EECON
2423 #undef EECON
2424 sfr at 0xD2 EECON;
2425 #define EEBUSY    0x01
2426 #define EEE       0x02
2427 #define EEPL0     0x10
2428 #define EEPL1     0x20
2429 #define EEPL2     0x40
2430 #define EEPL3     0x80
2431 #define EEPL      0xF0
2432 #endif
2433
2434 #ifdef EETIM
2435 #undef EETIM
2436 sfr at 0xD3 EETIM;
2437 #endif
2438
2439 #ifdef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
2440 #undef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
2441 sfr at 0xE8 EIE  ;
2442 // Bit registers DS80C320 specific
2443 sbit at 0xE8 EX2    ;
2444 sbit at 0xE9 EX3    ;
2445 sbit at 0xEA EX4    ;
2446 sbit at 0xEB EX5    ;
2447 sbit at 0xEC EWDI   ;
2448 #endif
2449
2450 #ifdef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
2451 #undef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
2452 sfr at 0xE8 EIE  ;
2453 // Bit registers DS80C390 specific
2454 sbit at 0xE8 EX2    ;
2455 sbit at 0xE9 EX3    ;
2456 sbit at 0xEA EX4    ;
2457 sbit at 0xEB EX5    ;
2458 sbit at 0xEC EWDI   ;
2459 sbit at 0xED C1IE   ;
2460 sbit at 0xEE C0IE   ;
2461 sbit at 0xEF CANBIE ;
2462 #endif
2463
2464 #ifdef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
2465 #undef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
2466 sfr at 0xF8 EIP  ;
2467 // Bit registers DS80C320 specific
2468 sbit at 0xF8 PX2    ;
2469 sbit at 0xF9 PX3    ;
2470 sbit at 0xFA PX4    ;
2471 sbit at 0xFB PX5    ;
2472 sbit at 0xFC PWDI   ;
2473 #endif
2474
2475 #ifdef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
2476 #undef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
2477 sfr at 0xF8 EIP  ;
2478 // Bit registers DS80C320 specific
2479 sbit at 0xF8 PX2    ;
2480 sbit at 0xF9 PX3    ;
2481 sbit at 0xFA PX4    ;
2482 sbit at 0xFB PX5    ;
2483 sbit at 0xFC PWDI   ;
2484 sbit at 0xFD C1IP   ;
2485 sbit at 0xFE C0IP   ;
2486 sbit at 0xFF CANBIP ;
2487 #endif
2488
2489 #ifdef EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
2490 #undef EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
2491 sfr at 0xF8 EIP0  ;
2492 // Bit registers DS89C420 specific
2493 sbit at 0xF8 LPX2    ;
2494 sbit at 0xF9 LPX3    ;
2495 sbit at 0xFA LPX4    ;
2496 sbit at 0xFB LPX5    ;
2497 sbit at 0xFC LPWDI   ;
2498 #endif
2499
2500 #ifdef EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
2501 #undef EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
2502 sfr at 0xF1 EIP1  ;
2503 // Not directly accessible Bits DS89C420 specific
2504 #define MPX2   0x01
2505 #define MPX3   0x02
2506 #define MPX4   0x04
2507 #define MPX5   0x08
2508 #define MPWDI  0x10
2509 #endif
2510
2511 #ifdef ESP
2512 #undef ESP
2513 sfr at 0x9B ESP  ;
2514 // Not directly accessible Bits DS80C390 specific
2515 #define ESP_0   0x01
2516 #define ESP_1   0x02
2517 #endif
2518
2519 #ifdef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
2520 #undef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
2521 sfr at 0x91 EXIF  ;
2522 // Not directly accessible EXIF Bits DS80C320 specific
2523 #define BGS    0x01
2524 #define RGSL   0x02
2525 #define RGMD   0x04
2526 #define IE2    0x10
2527 #define IE3    0x20
2528 #define IE4    0x40
2529 #define IE5    0x80
2530 #endif
2531
2532 #ifdef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
2533 #undef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
2534 sfr at 0x91 EXIF  ;
2535 // Not directly accessible EXIF Bits DS87C520 specific
2536 #define BGS    0x01
2537 #define RGSL   0x02
2538 #define RGMD   0x04
2539 #define XT_RG  0x08
2540 #define IE2    0x10
2541 #define IE3    0x20
2542 #define IE4    0x40
2543 #define IE5    0x80
2544 #endif
2545
2546 #ifdef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
2547 #undef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
2548 sfr at 0x91 EXIF  ;
2549 // Not directly accessible EXIF Bits DS80C390 & DS89C420 specific
2550 #define BGS    0x01
2551 #define RGSL   0x02
2552 #define RGMD   0x04
2553 #define CKRY   0x08
2554 #define IE2    0x10
2555 #define IE3    0x20
2556 #define IE4    0x40
2557 #define IE5    0x80
2558 #endif
2559
2560 #ifdef FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
2561 #undef FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
2562 sfr at 0xD5 FCNTL  ;
2563 // Not directly accessible DS89C420 specific
2564 #define FC0    0x01
2565 #define FC1    0x02
2566 #define FC2    0x04
2567 #define FC3    0x08
2568 #define FERR   0x40
2569 #define FBUSY  0x80
2570 #endif
2571
2572 #ifdef FCON
2573 #undef FCON
2574 sfr at 0xD1 FCON;
2575 #define FBUSY     0x01
2576 #define FMOD0     0x02
2577 #define FMOD1     0x04
2578 #define FPS       0x08
2579 #define FPL0      0x10
2580 #define FPL1      0x20
2581 #define FPL2      0x40
2582 #define FPL3      0x80
2583 #define FPL       0xF0
2584 #endif
2585
2586 #ifdef FDATA
2587 #undef FDATA
2588 sfr at 0xD6 FDATA  ;
2589 #endif
2590
2591 #ifdef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
2592 #undef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
2593 sfr at 0xA8 IE   ;
2594 // Bit registers
2595 sbit at 0xA8 EX0  ;
2596 sbit at 0xA9 ET0  ;
2597 sbit at 0xAA EX1  ;
2598 sbit at 0xAB ET1  ;
2599 sbit at 0xAC ES   ;
2600 sbit at 0xAF EA   ;
2601 #endif
2602
2603 #ifdef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
2604 #undef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
2605 sfr at 0xA8 IE   ;
2606 // Bit registers
2607 sbit at 0xA8 EX0  ;
2608 sbit at 0xA9 ET0  ;
2609 sbit at 0xAA EX1  ;
2610 sbit at 0xAB ET1  ;
2611 sbit at 0xAC ES   ;
2612 sbit at 0xAD ET2  ; // Enable timer2 interrupt
2613 sbit at 0xAF EA   ;
2614 #endif // IE
2615
2616 #ifdef IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
2617 #undef IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
2618 sfr at 0xA8 IE          ; // same as IEN0 - Interrupt enable 0, P80C552 specific
2619 sfr at 0xA8 IEN0        ; // alternate name
2620 // Bit registers
2621 sbit at 0xA8 EX0        ;
2622 sbit at 0xA9 ET0        ;
2623 sbit at 0xAA EX1        ;
2624 sbit at 0xAB ET1        ;
2625 sbit at 0xAC ES0        ;
2626 sbit at 0xAD ES1        ;
2627 sbit at 0xAE EAD        ;
2628 sbit at 0xAF EEA        ;
2629 #endif
2630
2631 #ifdef IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
2632 #undef IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
2633 sfr at 0xA8 IE;
2634 sbit at 0xA8 EX0;
2635 sbit at 0xA9 ET0;
2636 sbit at 0xAA EX1;
2637 sbit at 0xAB ET1;
2638 sbit at 0xAC ES;
2639 sbit at 0xAD ET2;
2640 sbit at 0xAE EC;
2641 sbit at 0xAF 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