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