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