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