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