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