]> git.gag.com Git - fw/sdcc/blob - device/include/mcs51reg.h
Version 1.0.6 - DS500X added
[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                       #ifdef 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    microcontrollers - B. Torok / bela.torok@kssg.ch
62
63    Adding support for additional microcontrollers:
64    -----------------------------------------------
65
66    1. Don't modify this file!!!
67
68    2. Insert your code in a separate file e.g.: mcs51reg_update.h and include
69       this after the #define HEADER_MCS51REG statement in this file
70
71    3. The mcs51reg_update.h file should contain following definitions:
72
73           a. An entry with the inventory of the register set of the
74              microcontroller in the  "Describe microcontrollers" section.
75
76           b. If necessary add entry(s) in for registers not defined in this file
77
78           c. Define interrupt vectors
79
80    4. Send me the file mcs51reg_update.h ( bela.torok@kssg.ch ).
81       I'm going to verify/merge new definitions to this file.
82
83
84    Microcontroller support:
85
86    Use one of the following options:
87
88    1. use #include <mcs51reg.h> in your program & define MICROCONTROLLER_XXXX in your makefile.
89
90    2. use following definitions prior the
91       #include <mcs51reg.h> line in your program:
92       e.g.:
93       #define MICROCONTROLLER_8052       -> 8052 type microcontroller
94       or
95       #define MICROCONTROLLER_AT89CX051  -> Atmel AT89C1051, AT89C2051 and AT89C4051 microcontrollers
96
97
98    Use only one of the following definitions!!!
99
100    Supported Microcontrollers:
101
102    No definition                8051
103    MICROCONTROLLER_8051         8051
104    MICROCONTROLLER_8052         8052
105    MICROCONTROLLER_AT89CX051    Atmel AT89C1051, AT89C2051 and AT89C4051
106    MICROCONTROLLER_AT89S53      Atmel AT89S53 microcontroller
107    MICROCONTROLLER_AT89X52      Atmel AT89C52 and AT80LV52 microcontrollers
108    MICROCONTROLLER_AT89X55      Atmel AT89C55 and AT80LV55 microcontrollers
109    MICROCONTROLLER_DS5000       Dallas DS5000 & DS2250 microcontroller
110    MICROCONTROLLER_DS5001       Dallas DS5001 & DS2251 microcontroller
111    MICROCONTROLLER_DS80C32X     Dallas DS80C320 and DS80C323 microcontrollers
112    MICROCONTROLLER_DS89C420     Dallas DS89C420 microcontroller
113    MICROCONTROLLER_DS8XC520     Dallas DS87C520 and DS83C520 microcontrollers
114    MICROCONTROLLER_SAB80515     Infineon / Siemens SAB80515 & SAB80535
115    MICROCONTROLLER_SAB80515A    Infineon / Siemens SAB80515A
116    MICROCONTROLLER_SAB80517     Infineon / Siemens SAB80517
117
118    Additional definitions (use them prior the #include mcs51reg.h statement):
119
120    Ports P0 & P2 are not available for the programmer if external ROM used.
121    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0 & P2.
122
123    Ports P0, P2, P3_6, WR, P3_7 & RD are not available for the programmer if
124    external RAM is used.
125    Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
126    P3_6, WR, P3_7 & RD.
127
128    #define MCS51REG_DISABLE_WARNINGS -> disables warnings
129
130 -----------------------------------------------------------------------*/
131
132
133 #ifndef HEADER_MCS51REG
134 #define HEADER_MCS51REG
135
136 ///////////////////////////////////////////////////////
137 ///  Insert header here (for developers only)       ///
138 ///  remove "//" from the begining of the next line ///
139 //#include "mcs51reg_update.h"                      ///
140 ///////////////////////////////////////////////////////
141
142 //////////////////////////////////
143 ///  Describe microcontrollers ///
144 ///  (inventory of registers)  ///
145 //////////////////////////////////
146
147 // definitions for the 8051
148 #ifdef MICROCONTROLLER_8051
149 #ifdef MICROCONTROLLER_DEFINED
150 #define MCS51REG_ERROR
151 #endif
152 #ifndef MICROCONTROLLER_DEFINED
153 #define MICROCONTROLLER_DEFINED
154 #endif
155 #ifndef MCS51REG_DISABLE_WARNINGS
156 #warning Selected HW: 8051
157 #endif
158 #define P0
159 #define SP
160 #define DPL
161 #define DPH
162 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
163 #define TCON
164 #define TMOD
165 #define TL0
166 #define TL1
167 #define TH0
168 #define TH1
169 #define P1
170 #define SCON
171 #define SBUF
172 #define P2
173 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
174 #define P3
175 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
176 #define PSW
177 #define ACC
178 #define B
179 #endif
180 // end of definitions for the 8051
181
182
183 // definitions for the 8052 microcontroller
184 #ifdef MICROCONTROLLER_8052
185 #ifdef MICROCONTROLLER_DEFINED
186 #define MCS51REG_ERROR
187 #endif
188 #ifndef MICROCONTROLLER_DEFINED
189 #define MICROCONTROLLER_DEFINED
190 #endif
191 #ifndef MCS51REG_DISABLE_WARNINGS
192 #warning Selected HW: 8052
193 #endif
194 // 8051 register set
195 #define P0
196 #define SP
197 #define DPL
198 #define DPH
199 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
200 #define TCON
201 #define TMOD
202 #define TL0
203 #define TL1
204 #define TH0
205 #define TH1
206 #define P1
207 #define SCON
208 #define SBUF
209 #define P2
210 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
211 #define P3
212 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
213 #define PSW
214 #define ACC
215 #define B
216 // 8052 specific registers
217 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
218 #define RCAP2L
219 #define RCAP2H
220 #define TL2
221 #define TH2
222 #endif
223 // end of definitions for the 8052 microcontroller
224
225
226 // definitionsons for the Atmel
227 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
228 #ifdef MICROCONTROLLER_AT89CX051
229 #ifdef MICROCONTROLLER_DEFINED
230 #define MCS51REG_ERROR
231 #endif
232 #ifndef MICROCONTROLLER_DEFINED
233 #define MICROCONTROLLER_DEFINED
234 #endif
235 #ifndef MCS51REG_DISABLE_WARNINGS
236 #warning Selected HW: Atmel AT89Cx051
237 #endif
238 // 8051 register set without P0 & P2
239 #define SP
240 #define DPL
241 #define DPH
242 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
243 #define TCON
244 #define TMOD
245 #define TL0
246 #define TL1
247 #define TH0
248 #define TH1
249 #define P1
250 #define SCON
251 #define SBUF
252 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
253 #define P3
254 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
255 #define PSW
256 #define ACC
257 #define B
258 #endif
259 // end of definitionsons for the Atmel
260 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
261
262
263 // definitions for the Atmel AT89S53
264 #ifdef MICROCONTROLLER_AT89S53
265 #ifdef MICROCONTROLLER_DEFINED
266 #define MCS51REG_ERROR
267 #endif
268 #ifndef MICROCONTROLLER_DEFINED
269 #define MICROCONTROLLER_DEFINED
270 #endif
271 #ifndef MCS51REG_DISABLE_WARNINGS
272 #warning Selected HW: AT89S53
273 #endif
274 // 8051 register set
275 #define P0
276 #define SP
277 #define DPL
278 #define DPH
279 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
280 #define TCON
281 #define TMOD
282 #define TL0
283 #define TL1
284 #define TH0
285 #define TH1
286 #define P1
287 #define SCON
288 #define SBUF
289 #define P2
290 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
291 #define P3
292 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
293 #define PSW
294 #define ACC
295 #define B
296 // 8052 specific registers
297 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
298 #define RCAP2L
299 #define RCAP2H
300 #define TL2
301 #define TH2
302 // AT89S53 specific register
303 #define T2MOD
304 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
305 #define SPCR
306 #define SPDR
307 #define SPSR
308 #define WCOM
309 #define DPL1
310 #define DPH1
311 #endif
312 // end of definitions for the Atmel AT89S53 microcontroller
313
314
315 // definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
316 #ifdef MICROCONTROLLER_AT89X52
317 #ifdef MICROCONTROLLER_DEFINED
318 #define MCS51REG_ERROR
319 #endif
320 #ifndef MICROCONTROLLER_DEFINED
321 #define MICROCONTROLLER_DEFINED
322 #endif
323 #ifndef MCS51REG_DISABLE_WARNINGS
324 #warning Selected HW: AT89C52 or AT89LV52
325 #endif
326 // 8051 register set
327 #define P0
328 #define SP
329 #define DPL
330 #define DPH
331 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
332 #define TCON
333 #define TMOD
334 #define TL0
335 #define TL1
336 #define TH0
337 #define TH1
338 #define P1
339 #define SCON
340 #define SBUF
341 #define P2
342 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
343 #define P3
344 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
345 #define PSW
346 #define ACC
347 #define B
348 // 8052 specific registers
349 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
350 #define RCAP2L
351 #define RCAP2H
352 #define TL2
353 #define TH2
354 // AT89X55 specific register
355 #define T2MOD
356 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
357 #endif
358 // end of definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
359
360
361 // definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
362 #ifdef MICROCONTROLLER_AT89X55
363 #ifdef MICROCONTROLLER_DEFINED
364 #define MCS51REG_ERROR
365 #endif
366 #ifndef MICROCONTROLLER_DEFINED
367 #define MICROCONTROLLER_DEFINED
368 #endif
369 #ifndef MCS51REG_DISABLE_WARNINGS
370 #warning Selected HW: AT89C55 or AT89LV55
371 #endif
372 // 8051 register set
373 #define P0
374 #define SP
375 #define DPL
376 #define DPH
377 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
378 #define TCON
379 #define TMOD
380 #define TL0
381 #define TL1
382 #define TH0
383 #define TH1
384 #define P1
385 #define SCON
386 #define SBUF
387 #define P2
388 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
389 #define P3
390 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
391 #define PSW
392 #define ACC
393 #define B
394 // 8052 specific registers
395 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
396 #define RCAP2L
397 #define RCAP2H
398 #define TL2
399 #define TH2
400 // AT89X55 specific register
401 #define T2MOD
402 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
403 #endif
404 // end of definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
405
406
407 // definitions for the Dallas DS5000
408 #ifdef MICROCONTROLLER_DS5000
409 #ifdef MICROCONTROLLER_DEFINED
410 #define MCS51REG_ERROR
411 #endif
412 #ifndef MICROCONTROLLER_DEFINED
413 #define MICROCONTROLLER_DEFINED
414 #endif
415 #ifndef MCS51REG_DISABLE_WARNINGS
416 #warning Selected HW: 8051
417 #endif
418 #define P0
419 #define SP
420 #define DPL
421 #define DPH
422 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
423 #define TCON
424 #define TMOD
425 #define TL0
426 #define TL1
427 #define TH0
428 #define TH1
429 #define P1
430 #define SCON
431 #define SBUF
432 #define P2
433 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
434 #define P3
435 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
436 #define MCON__SL__PAA__ECE2__RA32_8__PA0__PA1__PA2__PA3
437 #define TA
438 #define PSW
439 #define ACC
440 #define B
441 #endif
442 // end of definitions for the Dallas DS5000
443
444
445 // definitions for the Dallas DS5001
446 #ifdef MICROCONTROLLER_DS5001
447 #ifdef MICROCONTROLLER_DEFINED
448 #define MCS51REG_ERROR
449 #endif
450 #ifndef MICROCONTROLLER_DEFINED
451 #define MICROCONTROLLER_DEFINED
452 #endif
453 #ifndef MCS51REG_DISABLE_WARNINGS
454 #warning Selected HW: 8051
455 #endif
456 #define P0
457 #define SP
458 #define DPL
459 #define DPH
460 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
461 #define TCON
462 #define TMOD
463 #define TL0
464 #define TL1
465 #define TH0
466 #define TH1
467 #define P1
468 #define SCON
469 #define SBUF
470 #define P2
471 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
472 #define P3
473 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
474 #define CRC
475 #define CRCLOW
476 #define CRCHIGH
477 #define MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
478 #define TA
479 #define RNR
480 #define PSW
481 #define RPCTL
482 #define STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
483 #define ACC
484 #define B
485 #endif
486 // end of definitions for the Dallas DS5001
487
488
489 // definitions for the Dallas DS80C320 and DS80C323 microcontrollers
490 #ifdef MICROCONTROLLER_DS80C32X
491 #ifdef MICROCONTROLLER_DEFINED
492 #define MCS51REG_ERROR
493 #endif
494 #ifndef MICROCONTROLLER_DEFINED
495 #define MICROCONTROLLER_DEFINED
496 #endif
497 #ifndef MCS51REG_DISABLE_WARNINGS
498 #warning Selected HW: Dallas DS80C320 or DS80C323
499 #endif
500 // 8051 register set
501 #define P0
502 #define SP
503 #define DPL
504 #define DPH
505 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
506 #define TCON
507 #define TMOD
508 #define TL0
509 #define TL1
510 #define TH0
511 #define TH1
512 #define P1
513 #define SCON
514 #define SBUF
515 #define P2
516 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
517 #define P3
518 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
519 #define PSW
520 #define ACC
521 #define B
522 // 8052 specific registers
523 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
524 #define RCAP2L
525 #define RCAP2H
526 #define TL2
527 #define TH2
528 // DS80C320 specific register
529 #define DPL1
530 #define DPH1
531 #define DPS__x__x__x__x__x__x__x__SEL
532 #define CKCON
533 #define EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
534 #define SADDR0
535 #define SADDR1
536 #define SADEN0
537 #define SADEN1
538 #define SCON1
539 #define SBUF1
540 #define STATUS__PIP__HIP__LIP__x__x__x__x__x
541 #define TA
542 #define T2MOD
543 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
544 #define WDCON
545 #define EIE
546 #define EIP
547 #endif
548 // end of definitions for the Dallas DS80C320 and DS80C323 microcontrollers
549
550
551 // definitions for the Dallas DS89C420 microcontroller
552 #ifdef MICROCONTROLLER_DS89C420
553 #ifdef MICROCONTROLLER_DEFINED
554 #define MCS51REG_ERROR
555 #endif
556 #ifndef MICROCONTROLLER_DEFINED
557 #define MICROCONTROLLER_DEFINED
558 #endif
559 #ifndef MCS51REG_DISABLE_WARNINGS
560 #warning Selected HW: Dallas DS89C420
561 #endif
562 // 8051 register set
563 #define P0
564 #define SP
565 #define DPL
566 #define DPH
567 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
568 #define TCON
569 #define TMOD
570 #define TL0
571 #define TL1
572 #define TH0
573 #define TH1
574 #define P1
575 #define SCON
576 #define SBUF
577 #define P2
578 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
579 #define P3
580 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
581 #define PSW
582 #define ACC
583 #define B
584 // 8052 specific registers
585 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
586 #define RCAP2L
587 #define RCAP2H
588 #define TL2
589 #define TH2
590 // DS8XC520 specific registers
591 #define ACON
592 #define DPL1
593 #define DPH1
594 #define DPS__ID1__ID0__TSL__AID__x__x__x__SEL
595 #define CKCON
596 #define CKMOD
597 #define IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
598 #define IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
599 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
600 #define PMR
601 #define SADDR0
602 #define SADDR1
603 #define SADEN0
604 #define SADEN1
605 #define SCON1
606 #define SBUF1
607 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
608 #define TA
609 #define T2MOD
610 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
611 #define WDCON
612 #define ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
613 #define WDCON
614 #define EIE
615 #define EIP
616 #endif
617 // end of definitions for the Dallas DS89C420 microcontroller
618
619
620 // definitions for the Dallas DS87C520 and DS83C520 microcontrollers
621 #ifdef MICROCONTROLLER_DS8XC520
622 #ifdef MICROCONTROLLER_DEFINED
623 #define MCS51REG_ERROR
624 #endif
625 #ifndef MICROCONTROLLER_DEFINED
626 #define MICROCONTROLLER_DEFINED
627 #endif
628 #ifndef MCS51REG_DISABLE_WARNINGS
629 #warning Selected HW: Dallas DS87C520 or DS85C520
630 #endif
631 // 8051 register set
632 #define P0
633 #define SP
634 #define DPL
635 #define DPH
636 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
637 #define TCON
638 #define TMOD
639 #define TL0
640 #define TL1
641 #define TH0
642 #define TH1
643 #define P1
644 #define SCON
645 #define SBUF
646 #define P2
647 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
648 #define P3
649 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
650 #define PSW
651 #define ACC
652 #define B
653 // 8052 specific registers
654 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
655 #define RCAP2L
656 #define RCAP2H
657 #define TL2
658 #define TH2
659 // DS8XC520 specific registers
660 #define DPL1
661 #define DPH1
662 #define DPS__x__x__x__x__x__x__x__SEL
663 #define CKCON
664 #define EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
665 #define PMR
666 #define SADDR0
667 #define SADDR1
668 #define SADEN0
669 #define SADEN1
670 #define SCON1
671 #define SBUF1
672 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
673 #define TA
674 #define T2MOD
675 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
676 #define WDCON
677 #define ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
678 #define BP2
679 #define WDCON
680 #define EIE
681 #define EIP
682 #endif
683 // end of definitions for the Dallas DS87C520 and DS83C520 microcontrollers
684
685
686 // definitions for the Infineon / Siemens SAB80515 & SAB80535
687 #ifdef MICROCONTROLLER_SAB80515
688 #ifdef MICROCONTROLLER_DEFINED
689 #define MCS51REG_ERROR
690 #endif
691 #ifndef MICROCONTROLLER_DEFINED
692 #define MICROCONTROLLER_DEFINED
693 #endif
694 #ifndef MCS51REG_DISABLE_WARNINGS
695 #warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
696 #endif
697 // 8051 register set without IP
698 #define P0
699 #define SP
700 #define DPL
701 #define DPH
702 #define PCON__SMOD__x__x__x__x__x__x__x
703 #define TCON
704 #define TMOD
705 #define TL0
706 #define TL1
707 #define TH0
708 #define TH1
709 #define P1
710 #define SCON
711 #define SBUF
712 #define P2
713 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
714 #define P3
715 #define PSW
716 #define ACC
717 #define B
718 // SAB80515 specific registers
719 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
720 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
721 #define IEN1
722 #define IRCON
723 #define CCEN
724 #define CCL1
725 #define CCH1
726 #define CCL2
727 #define CCH2
728 #define CCL3
729 #define CCH3
730 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
731 #define CRCL
732 #define CRCH
733 #define TL2
734 #define TH2
735 #define ADCON
736 #define ADDAT
737 #define DAPR__SAB80515
738 #define P4_AT_0XE8
739 #define P5_AT_0XF8
740 #endif
741 // end of definitions for the Infineon / Siemens SAB80515
742
743
744 // definitions for the Infineon / Siemens SAB80515A
745 #ifdef MICROCONTROLLER_SAB80515A
746 #ifdef MICROCONTROLLER_DEFINED
747 #define MCS51REG_ERROR
748 #endif
749 #ifndef MICROCONTROLLER_DEFINED
750 #define MICROCONTROLLER_DEFINED
751 #endif
752 #ifndef MCS51REG_DISABLE_WARNINGS
753 #warning Selected HW: Infineon / Siemens SAB80515A
754 #endif
755 // 8051 register set without IP
756 #define P0
757 #define SP
758 #define DPL
759 #define DPH
760 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
761 #define TCON
762 #define TMOD
763 #define TL0
764 #define TL1
765 #define TH0
766 #define TH1
767 #define P1
768 #define SCON
769 #define SBUF
770 #define P2
771 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
772 #define P3
773 #define PSW
774 #define ACC
775 #define B
776 // SAB80515A specific registers
777 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
778 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
779 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
780 #define IEN1
781 #define IRCON
782 #define CCEN
783 #define CCL1
784 #define CCH1
785 #define CCL2
786 #define CCH2
787 #define CCL3
788 #define CCH3
789 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
790 #define CRCL
791 #define CRCH
792 #define TL2
793 #define TH2
794 #define ADCON0
795 #define ADDATH
796 #define ADDATL
797 #define ADCON1
798 #define SRELL
799 #define SYSCON
800 #define SRELH
801 #define P4_AT_0XE8
802 #define P5_AT_0XF8
803 #define P6_AT_0XDB
804 #define XPAGE
805 #endif
806 // end of definitions for the Infineon / Siemens SAB80515A
807
808
809 // definitions for the Infineon / Siemens SAB80517
810 #ifdef MICROCONTROLLER_SAB80517
811 #ifdef MICROCONTROLLER_DEFINED
812 #define MCS51REG_ERROR
813 #endif
814 #ifndef MICROCONTROLLER_DEFINED
815 #define MICROCONTROLLER_DEFINED
816 #endif
817 #ifndef MCS51REG_DISABLE_WARNINGS
818 #warning Selected HW: Infineon / Siemens SAB80517
819 #endif
820 // 8051 register set without IP, SCON & SBUF
821 #define P0
822 #define SP
823 #define DPL
824 #define DPH
825 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
826 #define TCON
827 #define TMOD
828 #define TL0
829 #define TL1
830 #define TH0
831 #define TH1
832 #define P1
833 // #define SCON
834 // #define SBUF
835 #define P2
836 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
837 #define P3
838 #define PSW
839 #define ACC
840 #define B
841 // SAB80517 specific registers
842 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
843 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
844 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
845 #define IEN1
846 #define IEN2__SAB80517
847 #define IRCON
848 #define CCEN
849 #define CCL1
850 #define CCH1
851 #define CCL2
852 #define CCH2
853 #define CCL3
854 #define CCH3
855 #define CCL4
856 #define CCH4
857 #define CC4EN
858 #define CMEN
859 #define CMH0
860 #define CML0
861 #define CMH1
862 #define CML1
863 #define CMH2
864 #define CML2
865 #define CMH3
866 #define CML3
867 #define CMH4
868 #define CML4
869 #define CMH5
870 #define CML5
871 #define CMH6
872 #define CML6
873 #define CMH7
874 #define CML7
875 #define CMSEL
876 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
877 #define CRCL
878 #define CRCH
879 #define CTCON
880 #define CTRELH
881 #define CTRELL
882 #define TL2
883 #define TH2
884 #define ADCON0
885 #define ADCON1
886 #define ADDAT
887 #define DAPR__SAB80517
888 #define P4_AT_0XE8
889 #define P5_AT_0XF8
890 #define P6_AT_0XFA
891 #define P7_AT_0XDB
892 #define P8_AT_0XDD
893 #define DPSEL
894 #define ARCON
895 #define MD0
896 #define MD1
897 #define MD2
898 #define MD3
899 #define MD4
900 #define MD5
901 #define S0BUF
902 #define S0CON
903 #define S0RELH
904 #define S0RELL
905 #define S1BUF
906 #define S1CON
907 #define S1RELH
908 #define S1RELL
909 #define WDTH
910 #define WDTL
911 #define WDTREL
912 #endif
913 // end of definitions for the Infineon / Siemens SAB80517
914
915
916 /////////////////////////////////////////////////////////
917 ///  don't specify microcontrollers below this line!  ///
918 /////////////////////////////////////////////////////////
919
920
921 // default microcontroller -> 8051
922 // use default if no microcontroller specified
923 #ifndef MICROCONTROLLER_DEFINED
924 #define MICROCONTROLLER_DEFINED
925 #ifndef MCS51REG_DISABLE_WARNINGS
926 #warning //////////////////////////////////
927 #warning // No microcontroller defined!  //
928 #warning //////////////////////////////////
929 #warning Code will be generated for the
930 #warning 8051 (default) microcontroller.
931 #warning If you have another microcontroller
932 #warning define it in the makefile, or in the
933 #warning "C" source prior
934 #warning the #include <mcs51reg.h> statement.
935 #warning If you use a non supported
936 #warning microcontroller, mcs51reg.h can be
937 #warning easily extended to support your HW.
938 #endif
939 // 8051 register set
940 #define P0
941 #define SP
942 #define DPL
943 #define DPH
944 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
945 #define TCON
946 #define TMOD
947 #define TL0
948 #define TL1
949 #define TH0
950 #define TH1
951 #define P1
952 #define SCON
953 #define SBUF
954 #define P2
955 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
956 #define P3
957 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
958 #define PSW
959 #define ACC
960 #define B
961 #endif
962 // end of definitions for the default microcontroller
963
964
965 #ifdef MCS51REG_ERROR
966 #error Two or more microcontrollers defined!
967 #endif
968
969 #ifdef MCS51REG_EXTERNAL_ROM
970 #ifndef MCS51REG_UNDEFINE_P0
971 #define MCS51REG_UNDEFINE_P0
972 #endif
973 #ifndef MCS51REG_UNDEFINE_P2
974 #define MCS51REG_UNDEFINE_P2
975 #endif
976 #endif
977
978 #ifdef MCS51REG_EXTERNAL_RAM
979 #ifndef MCS51REG_UNDEFINE_P0
980 #define MCS51REG_UNDEFINE_P0
981 #endif
982 #ifndef MCS51REG_UNDEFINE_P2
983 #define MCS51REG_UNDEFINE_P2
984 #endif
985 #endif
986
987 #ifdef MCS51REG_UNDEFINE_P0
988 #undef P0
989 #endif
990
991 #ifdef MCS51REG_UNDEFINE_P2
992 #undef P2
993 #endif
994
995 ////////////////////////////////
996 ///  Register definitions    ///
997 ///  (In alphabetical order) ///
998 ////////////////////////////////
999
1000 #ifdef ACC
1001 #undef ACC
1002 sfr at 0xE0 ACC  ;
1003 #endif
1004
1005 #ifdef ACON
1006 #undef ACON
1007 sfr at 0x9D ACON   ; // DS89C420 specific
1008 // Bit registers
1009 #define PAGE0   0x20
1010 #define PAGES   0x40
1011 #define PAGEE   0x80
1012 #endif
1013
1014 #ifdef ADCON
1015 #undef ADCON
1016 sfr at 0xD8 ADCON   ; // A/D-converter control register SAB80515 specific
1017 // Bit registers
1018 sbit at 0xD8 MX0        ;
1019 sbit at 0xD9 MX1        ;
1020 sbit at 0xDA MX2        ;
1021 sbit at 0xDB ADM        ;
1022 sbit at 0xDC BSY        ;
1023 sbit at 0xDE CLK        ;
1024 sbit at 0xDF BD         ;
1025 #endif
1026
1027 // ADCON0 ... Infineon / Siemens also called this register ADCON in the User Manual
1028 #ifdef ADCON0
1029 #undef ADCON0
1030 sfr at 0xD8 ADCON0      ; // A/D-converter control register 0 SAB80515A &
1031 // Bit registers          // SAB80517 specific
1032 sbit at 0xD8 MX0        ;
1033 sbit at 0xD9 MX1        ;
1034 sbit at 0xDA MX2        ;
1035 sbit at 0xDB ADM        ;
1036 sbit at 0xDC BSY        ;
1037 sbit at 0xDD ADEX       ;
1038 sbit at 0xDE CLK        ;
1039 sbit at 0xDF BD         ;
1040 // Not directly accessible ADCON0
1041 #define ADCON0_MX0              0x01
1042 #define ADCON0_MX1              0x02
1043 #define ADCON0_MX2              0x04
1044 #define ADCON0_ADM              0x08
1045 #define ADCON0_BSY              0x10
1046 #define ADCON0_ADEX             0x20
1047 #define ADCON0_CLK              0x40
1048 #define ADCON0_BD               0x80
1049 #endif
1050
1051 #ifdef ADCON1
1052 #undef ADCON1
1053 sfr at 0xDC ADCON1      ; // A/D-converter control register 1 SAB80515A & SAB80517 specific
1054 // Not directly accessible ADCON1
1055 #define ADCON1_MX0              0x01
1056 #define ADCON1_MX1              0x02
1057 #define ADCON1_MX2              0x04
1058 #define ADCON1_ADCL             0x80
1059 #endif
1060
1061 #ifdef ADDAT
1062 #undef ADDAT
1063 sfr at 0xD9 ADDAT   ; // A/D-converter data register SAB80515 specific
1064 #endif
1065
1066 #ifdef ADDATH
1067 #undef ADDATH
1068 sfr at 0xD9 ADDATH      ; // A/D data high byte SAB80515A specific
1069 #endif
1070
1071 #ifdef ADDATL
1072 #undef ADDATL
1073 sfr at 0xDA ADDATL      ; // A/D data low byte SAB80515A specific
1074 #endif
1075
1076 #ifdef ARCON
1077 #undef ARCON
1078 sfr at 0xEF ARCON       ; // arithmetic control register SAB80517
1079 #endif
1080
1081 #ifdef B
1082 #undef B
1083 sfr at 0xF0 B    ;
1084 // Bit registers
1085 sbit at 0xF0 BREG_F0        ;
1086 sbit at 0xF1 BREG_F1        ;
1087 sbit at 0xF2 BREG_F2        ;
1088 sbit at 0xF3 BREG_F3        ;
1089 sbit at 0xF4 BREG_F4        ;
1090 sbit at 0xF5 BREG_F5        ;
1091 sbit at 0xF6 BREG_F6        ;
1092 sbit at 0xF7 BREG_F7        ;
1093 #endif
1094
1095 #ifdef BP2
1096 #undef BP2
1097 sfr at 0xC3 BP2    ;
1098 // Not directly accessible bits
1099 #define MS0   0x01
1100 #define MS1   0x02
1101 #define MS2   0x04
1102 #define LB1   0x08
1103 #define LB2   0x10
1104 #define LB3   0x20
1105 #endif
1106
1107 #ifdef CC4EN
1108 #undef CC4EN
1109 sfr at 0xC9 CC4EN       ; // compare/capture 4 enable register SAB80517 specific
1110 #endif
1111
1112 #ifdef CCEN
1113 #undef CCEN
1114 sfr at 0xC1 CCEN        ; // compare/capture enable register SAB80515 specific
1115 #endif
1116
1117 #ifdef CCH1
1118 #undef CCH1
1119 sfr at 0xC3 CCH1        ; // compare/capture register 1, high byte SAB80515 specific
1120 #endif
1121
1122 #ifdef CCH2
1123 #undef CCH2
1124 sfr at 0xC5 CCH2        ; // compare/capture register 2, high byte SAB80515 specific
1125 #endif
1126
1127 #ifdef CCH3
1128 #undef CCH3
1129 sfr at 0xC7 CCH3        ; // compare/capture register 3, high byte SAB80515 specific
1130 #endif
1131
1132 #ifdef CCH4
1133 #undef CCH4
1134 sfr at 0xCF CCH4        ; // compare/capture register 4, high byte SAB80515 specific
1135 #endif
1136
1137 #ifdef CCL1
1138 #undef CCL1
1139 sfr at 0xC2 CCL1        ; // compare/capture register 1, low byte SAB80515 specific
1140 #endif
1141
1142 #ifdef CCL2
1143 #undef CCL2
1144 sfr at 0xC4 CCL2        ; // compare/capture register 2, low byte SAB80515 specific
1145 #endif
1146
1147 #ifdef CCL3
1148 #undef CCL3
1149 sfr at 0xC6 CCL3        ; // compare/capture register 3, low byte SAB80515 specific
1150 #endif
1151
1152 #ifdef CCL4
1153 #undef CCL4
1154 sfr at 0xCE CCL4        ; // compare/capture register 4, low byte SAB80515 specific
1155 #endif
1156
1157 #ifdef CKCON
1158 #undef CKCON
1159 sfr at 0x8E CKCON       ; // DS80C320 specific
1160 // Not directly accessible Bits. DS80C320 specific
1161 #define MD0    0x01
1162 #define MD1    0x02
1163 #define MD2    0x04
1164 #define T0M    0x08
1165 #define T1M    0x10
1166 #define T2M    0x20
1167 #define WD0    0x40
1168 #define WD1    0x80
1169 #endif
1170
1171 #ifdef CKMOD
1172 #undef CKMOD
1173 sfr at 0x96 CKMOD       ; // DS89C420 specific
1174 // Not directly accessible Bits.
1175 #define T0MH   0x08
1176 #define T1MH   0x10
1177 #define T2MH   0x20
1178 #endif
1179
1180 #ifdef CMEN
1181 #undef CMEN
1182 sfr at 0xF6 CMEN    ; // compare enable register SAB80517 specific
1183 #endif
1184
1185 #ifdef CMH0
1186 #undef CMH0
1187 sfr at 0xD3 CMH0    ; // compare register 0 high byte SAB80517 specific
1188 #endif
1189
1190 #ifdef CMH1
1191 #undef CMH1
1192 sfr at 0xD5 CMH1    ; // compare register 1 high byte SAB80517 specific
1193 #endif
1194
1195 #ifdef CMH2
1196 #undef CMH2
1197 sfr at 0xD7 CMH2    ; // compare register 2 high byte SAB80517 specific
1198 #endif
1199
1200 #ifdef CMH3
1201 #undef CMH3
1202 sfr at 0xE3 CMH3    ; // compare register 3 high byte SAB80517 specific
1203 #endif
1204
1205 #ifdef CMH4
1206 #undef CMH4
1207 sfr at 0xE5 CMH4    ; // compare register 4 high byte SAB80517 specific
1208 #endif
1209
1210 #ifdef CMH5
1211 #undef CMH5
1212 sfr at 0xE7 CMH5    ; // compare register 5 high byte SAB80517 specific
1213 #endif
1214
1215 #ifdef CMH6
1216 #undef CMH6
1217 sfr at 0xF3 CMH6    ; // compare register 6 high byte SAB80517 specific
1218 #endif
1219
1220 #ifdef CMH7
1221 #undef CMH7
1222 sfr at 0xF5 CMH7    ; // compare register 7 high byte SAB80517 specific
1223 #endif
1224
1225 #ifdef CML0
1226 #undef CML0
1227 sfr at 0xD2 CML0    ; // compare register 0 low byte SAB80517 specific
1228 #endif
1229
1230 #ifdef CML1
1231 #undef CML1
1232 sfr at 0xD4 CML1    ; // compare register 1 low byte SAB80517 specific
1233 #endif
1234
1235 #ifdef CML2
1236 #undef CML2
1237 sfr at 0xD6 CML2    ; // compare register 2 low byte SAB80517 specific
1238 #endif
1239
1240 #ifdef CML3
1241 #undef CML3
1242 sfr at 0xE2 CML3    ; // compare register 3 low byte SAB80517 specific
1243 #endif
1244
1245 #ifdef CML4
1246 #undef CML4
1247 sfr at 0xE4 CML4    ; // compare register 4 low byte SAB80517 specific
1248 #endif
1249
1250 #ifdef CML5
1251 #undef CML5
1252 sfr at 0xE6 CML5    ; // compare register 5 low byte SAB80517 specific
1253 #endif
1254
1255 #ifdef CML6
1256 #undef CML6
1257 sfr at 0xF2 CML6    ; // compare register 6 low byte SAB80517 specific
1258 #endif
1259
1260 #ifdef CML7
1261 #undef CML7
1262 sfr at 0xF4 CML7    ; // compare register 7 low byte SAB80517 specific
1263 #endif
1264
1265 #ifdef CMSEL
1266 #undef CMSEL
1267 sfr at 0xF7 CMSEL   ; // compare input select SAB80517
1268 #endif
1269
1270 #ifdef CRC
1271 #undef CRC
1272 sfr at 0xC1 CRC     ; // Dallas DS5001 specific
1273 #define CRC_        0x01
1274 #define MDM         0x02
1275 #define RNGE0       0x10
1276 #define RNGE1       0x20
1277 #define RNGE2       0x40
1278 #define RNGE3       0x80
1279 #endif
1280
1281 #ifdef CRCH
1282 #undef CRCH
1283 sfr at 0xCB CRCH    ; // compare/reload/capture register, high byte SAB80515 specific
1284 #endif
1285
1286 #ifdef CRCHIGH
1287 #undef CRCHIGH
1288 sfr at 0xC3 CRCHIGH ; // DS5001 specific
1289 #endif
1290
1291 #ifdef CRCL
1292 #undef CRCL
1293 sfr at 0xCA CRCL    ; // compare/reload/capture register, low byte SAB80515 specific
1294 #endif
1295
1296 #ifdef CRCLOW
1297 #undef CRCLOW
1298 sfr at 0xC2 CRCLOW  ; // DS5001 specific
1299 #endif
1300
1301 #ifdef CTCON
1302 #undef CTCON
1303 sfr at 0xE1 CTCON    ; // com.timer control register SAB80517
1304 #endif
1305
1306 #ifdef CTRELH
1307 #undef CTRELH
1308 sfr at 0xDF CTRELH  ; // com.timer rel register high byte SAB80517
1309 #endif
1310
1311 #ifdef CTRELL
1312 #undef CTRELL
1313 sfr at 0xDE CTRELL  ; // com.timer rel register low byte SAB80517
1314 #endif
1315
1316 #ifdef DAPR__SAB80515
1317 #undef DAPR__SAB80515
1318 sfr at 0xD8 DAPR    ; // D/A-converter program register SAB80515 specific
1319 #endif
1320
1321 #ifdef DAPR__SAB80517
1322 #undef DAPR__SAB80517
1323 sfr at 0xDA DAPR    ; // D/A-converter program register SAB80517 specific
1324 #endif
1325
1326 #ifdef DPH
1327 #undef DPH
1328 sfr at 0x83 DPH  ;
1329 sfr at 0x83 DP0H ;  // Alternate name for AT89S53
1330 #endif
1331
1332 #ifdef DPH1
1333 #undef DPH1
1334 sfr at 0x85 DPH1  ; // DS80C320 specific
1335 sfr at 0x85 DP1H  ; // Alternate name for AT89S53
1336 #endif
1337
1338 #ifdef DPL
1339 #undef DPL
1340 sfr at 0x82 DPL  ;  // Alternate name for AT89S53
1341 sfr at 0x82 DP0L ;
1342 #endif
1343
1344 #ifdef DPL1
1345 #undef DPL1
1346 sfr at 0x84 DPL1  ; // DS80C320 specific
1347 sfr at 0x84 DP1L  ; // Alternate name for AT89S53
1348 #endif
1349
1350 #ifdef DPS__x__x__x__x__x__x__x__SEL
1351 #undef DPS__x__x__x__x__x__x__x__SEL
1352 sfr at 0x86 DPS  ;
1353 // Not directly accessible DPS Bit. DS80C320 & DPS8XC520 specific
1354 #define SEL    0x01
1355 #endif
1356
1357 #ifdef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
1358 #undef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
1359 sfr at 0x86 DPS  ;
1360 // Not directly accessible DPS Bit. DS89C420 specific
1361 #define SEL    0x01
1362 #define AID    0x10
1363 #define TSL    0x20
1364 #define ID0    0x40
1365 #define ID1    0x80
1366 #endif
1367
1368 #ifdef DPSEL
1369 #undef DPSEL
1370 sfr at 0x92 DPSEL   ; // data pointer select register SAB80517
1371 #endif
1372
1373 #ifdef EIE
1374 #undef EIE
1375 sfr at 0xE8 EIE  ;
1376 // Bit registers DS80C320 specific
1377 sbit at 0xE8 EX2    ;
1378 sbit at 0xE9 EX3    ;
1379 sbit at 0xEA EX4    ;
1380 sbit at 0xEB EX5    ;
1381 sbit at 0xEC EWDI   ;
1382 #endif
1383
1384 #ifdef EIP
1385 #undef EIP
1386 sfr at 0xE8 EIP  ;
1387 // Bit registers DS80C320 specific
1388 sbit at 0xF8 PX2    ;
1389 sbit at 0xF9 PX3    ;
1390 sbit at 0xFA PX4    ;
1391 sbit at 0xFB PX5    ;
1392 sbit at 0xFC PWDI   ;
1393 #endif
1394
1395 #ifdef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
1396 #undef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
1397 sfr at 0x91 EXIF  ;
1398 // Not directly accessible EXIF Bits DS80C320 specific
1399 #define BGS    0x01
1400 #define RGSL   0x02
1401 #define RGMD   0x04
1402 #define IE2    0x10
1403 #define IE3    0x20
1404 #define IE4    0x40
1405 #define IE5    0x80
1406 #endif
1407
1408 #ifdef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
1409 #undef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
1410 sfr at 0x91 EXIF  ;
1411 // Not directly accessible EXIF Bits DS87C520 specific
1412 #define BGS    0x01
1413 #define RGSL   0x02
1414 #define RGMD   0x04
1415 #define XT_RG  0x08
1416 #define IE2    0x10
1417 #define IE3    0x20
1418 #define IE4    0x40
1419 #define IE5    0x80
1420 #endif
1421
1422 #ifdef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
1423 #undef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
1424 sfr at 0x91 EXIF  ;
1425 // Not directly accessible EXIF Bits DS89C420 specific
1426 #define BGS    0x01
1427 #define RGSL   0x02
1428 #define RGMD   0x04
1429 #define CKRY   0x08
1430 #define IE2    0x10
1431 #define IE3    0x20
1432 #define IE4    0x40
1433 #define IE5    0x80
1434 #endif
1435
1436 #ifdef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1437 #undef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1438 sfr at 0xA8 IE   ;
1439 // Bit registers
1440 sbit at 0xA8 EX0  ;
1441 sbit at 0xA9 ET0  ;
1442 sbit at 0xAA EX1  ;
1443 sbit at 0xAB ET1  ;
1444 sbit at 0xAC ES   ;
1445 sbit at 0xAF EA   ;
1446 #endif
1447
1448 #ifdef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
1449 #undef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
1450 sfr at 0xA8 IE   ;
1451 // Bit registers
1452 sbit at 0xA8 EX0  ;
1453 sbit at 0xA9 ET0  ;
1454 sbit at 0xAA EX1  ;
1455 sbit at 0xAB ET1  ;
1456 sbit at 0xAC ES   ;
1457 sbit at 0xAD ET2  ; // Enable timer2 interrupt
1458 sbit at 0xAF EA   ;
1459 #endif // IE
1460
1461 #ifdef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
1462 #undef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
1463 sfr at 0xA8 IE   ;
1464 // Bit registers
1465 sbit at 0xA8 EX0  ;
1466 sbit at 0xA9 ET0  ;
1467 sbit at 0xAA EX1  ;
1468 sbit at 0xAB ET1  ;
1469 sbit at 0xAC ES   ;
1470 sbit at 0xAC ES0  ; // Alternate name
1471 sbit at 0xAD ET2  ; // Enable timer2 interrupt
1472 sbit at 0xAE ES1  ;
1473 sbit at 0xAF EA   ;
1474 #endif // IE
1475
1476 #ifdef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1477 #undef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1478 sfr at 0xA8 IE    ;
1479 sfr at 0xA8 IEN0  ; // Alternate name
1480 // Bit registers for the SAB80515 and compatible IE
1481 sbit at 0xA8 EX0  ;
1482 sbit at 0xA9 ET0  ;
1483 sbit at 0xAA EX1  ;
1484 sbit at 0xAB ET1  ;
1485 sbit at 0xAC ES   ;
1486 sbit at 0xAC ES0  ;
1487 sbit at 0xAD ET2  ; // Enable timer 2 overflow SAB80515 specific
1488 sbit at 0xAE WDT  ; // watchdog timer reset - SAB80515 specific
1489 sbit at 0xAF EA   ;
1490 sbit at 0xAF EAL  ; // EA as called by Infineon / Siemens
1491 #endif
1492
1493 #ifdef IEN1
1494 #undef IEN1
1495 sfr at 0xB8 IEN1        ; // interrupt enable register - SAB80515 specific
1496 // Bit registers
1497 sbit at 0xB8 EADC       ; // A/D converter interrupt enable
1498 sbit at 0xB9 EX2        ;
1499 sbit at 0xBA EX3        ;
1500 sbit at 0xBB EX4        ;
1501 sbit at 0xBC EX5        ;
1502 sbit at 0xBD EX6        ;
1503 sbit at 0xBE SWDT       ; // watchdog timer start/reset
1504 sbit at 0xBF EXEN2      ; // timer2 external reload interrupt enable
1505 #endif
1506
1507 #ifdef IEN2__SAB80517
1508 #undef IEN2__SAB80517
1509 sfr at 0x9A IEN2        ; // interrupt enable register 2 SAB80517
1510 #endif
1511
1512 #ifdef IP__x__x__x__PS__PT1__PX1__PT0__PX0
1513 #undef IP__x__x__x__PS__PT1__PX1__PT0__PX0
1514 sfr at 0xB8 IP   ;
1515 // Bit registers
1516 sbit at 0xB8 PX0  ;
1517 sbit at 0xB9 PT0  ;
1518 sbit at 0xBA PX1  ;
1519 sbit at 0xBB PT1  ;
1520 sbit at 0xBC PS   ;
1521 #endif
1522
1523 #ifdef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
1524 #undef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
1525 sfr at 0xB8 IP    ;
1526 // Bit registers
1527 sbit at 0xB8 PX0  ;
1528 sbit at 0xB9 PT0  ;
1529 sbit at 0xBA PX1  ;
1530 sbit at 0xBB PT1  ;
1531 sbit at 0xBC PS   ;
1532 sbit at 0xBD PT2  ;
1533 #endif
1534
1535 #ifdef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
1536 #undef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
1537 sfr at 0xB8 IP   ;
1538 // Bit registers
1539 sbit at 0xB8 PX0  ;
1540 sbit at 0xB9 PT0  ;
1541 sbit at 0xBA PX1  ;
1542 sbit at 0xBB PT1  ;
1543 sbit at 0xBC PS   ;
1544 sbit at 0xBD PT2  ;
1545 sbit at 0xBE PS1  ;
1546 #endif
1547
1548 #ifdef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
1549 #undef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
1550 sfr at 0xB8 IP   ;
1551 // Bit registers
1552 sbit at 0xB8 PX0  ;
1553 sbit at 0xB9 PT0  ;
1554 sbit at 0xBA PX1  ;
1555 sbit at 0xBB PT1  ;
1556 sbit at 0xBC PS   ;
1557 sbit at 0xBF RWT  ;
1558 #endif
1559
1560 #ifdef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1561 #undef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1562 sfr at 0xA9 IP0   ; // interrupt priority register SAB80515 specific
1563 // Not directly accessible IP0 bits
1564 #define IP0_0    0x01
1565 #define IP0_1    0x02
1566 #define IP0_2    0x04
1567 #define IP0_3    0x08
1568 #define IP0_4    0x10
1569 #define IP0_5    0x20
1570 #define WDTS     0x40
1571 #endif
1572
1573 #ifdef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
1574 #undef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
1575 sfr at 0xB8 IP0   ; // interrupt priority register DS89C420 specific
1576 // Not directly accessible IP0 bits
1577 #define LPX0    0x01
1578 #define LPT0    0x02
1579 #define LPX1    0x04
1580 #define LPT1    0x08
1581 #define LPS0    0x10
1582 #define LPT2    0x20
1583 #define LPS1    0x40
1584 #endif
1585
1586 #ifdef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1587 #undef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1588 sfr at 0xB9 IP1   ; // interrupt priority register SAB80515 specific
1589 // Not directly accessible IP1 bits
1590 #define IP1_0    0x01
1591 #define IP1_1    0x02
1592 #define IP1_2    0x04
1593 #define IP1_3    0x08
1594 #define IP1_4    0x10
1595 #define IP1_5    0x20
1596 #endif
1597
1598 #ifdef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
1599 #undef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
1600 sfr at 0xB1 IP1   ; // interrupt priority register DS89C420 specific
1601 // Not directly accessible IP0 bits
1602 #define LPX0    0x01
1603 #define LPT0    0x02
1604 #define LPX1    0x04
1605 #define LPT1    0x08
1606 #define LPS0    0x10
1607 #define LPT2    0x20
1608 #define LPS1    0x40
1609 #endif
1610
1611 #ifdef IRCON
1612 #undef IRCON
1613 sfr at 0xC0 IRCON       ; // interrupt control register - SAB80515 specific
1614 // Bit registers
1615 sbit at 0xC0 IADC       ; // A/D converter irq flag
1616 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
1617 sbit at 0xC2 IEX3       ;
1618 sbit at 0xC3 IEX4       ;
1619 sbit at 0xC4 IEX5       ;
1620 sbit at 0xC5 IEX6       ;
1621 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
1622 sbit at 0xC7 EXF2       ; // timer2 reload flag
1623 #endif
1624
1625 #ifdef IRCON0
1626 #undef IRCON0
1627 sfr at 0xC0 IRCON0       ; // interrupt control register - SAB80515 specific
1628 // Bit registers
1629 sbit at 0xC0 IADC       ; // A/D converter irq flag
1630 sbit at 0xC1 IEX2       ; // external interrupt edge detect flag
1631 sbit at 0xC2 IEX3       ;
1632 sbit at 0xC3 IEX4       ;
1633 sbit at 0xC4 IEX5       ;
1634 sbit at 0xC5 IEX6       ;
1635 sbit at 0xC6 TF2        ; // timer 2 owerflow flag
1636 sbit at 0xC7 EXF2       ; // timer2 reload flag
1637 #endif
1638
1639 #ifdef IRCON1
1640 #undef IRCON1
1641 sfr at 0xD1 IRCON1      ; // interrupt control register - SAB80515 specific
1642 #endif
1643
1644 #ifdef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
1645 #undef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
1646 sfr at 0xC6 MCON        ; // DS5000
1647 #define SL       0x01
1648 #define PAA      0x02
1649 #define ECE2     0x04
1650 #define RA32_8   0x08
1651 #define PA0      0x10
1652 #define PA1      0x20
1653 #define PA2      0x40
1654 #define PA3      0x80
1655 #endif
1656
1657 #ifdef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
1658 #undef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
1659 sfr at 0xC6 MCON        ; // DS5001
1660 #define SL       0x01
1661 #define PM       0x02
1662 #define PES      0x04
1663 #define RG1      0x08
1664 #define PA0      0x10
1665 #define PA1      0x20
1666 #define PA2      0x40
1667 #define PA3      0x80
1668 #endif
1669
1670 #ifdef MD0
1671 #undef MD0
1672 sfr at 0xE9 MD0         ; // MUL / DIV register 0 SAB80517
1673 #endif
1674
1675 #ifdef MD1
1676 #undef MD1
1677 sfr at 0xEA MD1         ; // MUL / DIV register 1 SAB80517
1678 #endif
1679
1680 #ifdef MD2
1681 #undef MD2
1682 sfr at 0xEB MD2         ; // MUL / DIV register 2 SAB80517
1683 #endif
1684
1685 #ifdef MD3
1686 #undef MD3
1687 sfr at 0xEC MD3         ; // MUL / DIV register 3 SAB80517
1688 #endif
1689
1690 #ifdef MD4
1691 #undef MD4
1692 sfr at 0xED MD4         ; // MUL / DIV register 4 SAB80517
1693 #endif
1694
1695 #ifdef MD5
1696 #undef MD5
1697 sfr at 0xEE MD5         ; // MUL / DIV register 5 SAB80517
1698 #endif
1699
1700 #ifdef P0
1701 #undef P0
1702 sfr at 0x80 P0   ;
1703 //  Bit Registers
1704 sbit at 0x80 P0_0 ;
1705 sbit at 0x81 P0_1 ;
1706 sbit at 0x82 P0_2 ;
1707 sbit at 0x83 P0_3 ;
1708 sbit at 0x84 P0_4 ;
1709 sbit at 0x85 P0_5 ;
1710 sbit at 0x86 P0_6 ;
1711 sbit at 0x87 P0_7 ;
1712 #endif
1713
1714 #ifdef P1
1715 #undef P1
1716 sfr at 0x90 P1   ;
1717 // Bit registers
1718 sbit at 0x90 P1_0 ;
1719 sbit at 0x91 P1_1 ;
1720 sbit at 0x92 P1_2 ;
1721 sbit at 0x93 P1_3 ;
1722 sbit at 0x94 P1_4 ;
1723 sbit at 0x95 P1_5 ;
1724 sbit at 0x96 P1_6 ;
1725 sbit at 0x97 P1_7 ;
1726 #endif
1727
1728 #ifdef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
1729 #undef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
1730 // P1 alternate functions
1731 sbit at 0x90 T2   ;
1732 sbit at 0x91 T2EX ;
1733 sbit at 0x92 RXD1 ;
1734 sbit at 0x93 TXD1 ;
1735 sbit at 0x94 INT2 ;
1736 sbit at 0x95 INT3 ;
1737 sbit at 0x96 INT4 ;
1738 sbit at 0x97 INT5 ;
1739 #endif
1740
1741 #ifdef P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1742 sbit at 0x90 INT3_CC0   ; // P1 alternate functions - SAB80515 specific
1743 sbit at 0x91 INT4_CC1   ;
1744 sbit at 0x92 INT5_CC2   ;
1745 sbit at 0x93 INT6_CC3   ;
1746 sbit at 0x94 INT2       ;
1747 sbit at 0x95 T2EX       ;
1748 sbit at 0x96 CLKOUT     ;
1749 sbit at 0x97 T2         ;
1750 #endif
1751
1752 #ifdef P1_EXT__x__x__x__x__x__x__T2EX__T2
1753 #undef P1_EXT__x__x__x__x__x__x__T2EX__T2
1754 // P1 alternate functions
1755 sbit at 0x90 T2         ;
1756 sbit at 0x91 T2EX       ;
1757 #endif
1758
1759 #ifdef P2
1760 #undef P2
1761 sfr at 0xA0 P2   ;
1762 // Bit registers
1763 sbit at 0xA0 P2_0 ;
1764 sbit at 0xA1 P2_1 ;
1765 sbit at 0xA2 P2_2 ;
1766 sbit at 0xA3 P2_3 ;
1767 sbit at 0xA4 P2_4 ;
1768 sbit at 0xA5 P2_5 ;
1769 sbit at 0xA6 P2_6 ;
1770 sbit at 0xA7 P2_7 ;
1771 #endif
1772
1773 #ifdef P3
1774 #undef P3
1775 sfr at 0xB0 P3   ;
1776 // Bit registers
1777 sbit at 0xB0 P3_0 ;
1778 sbit at 0xB1 P3_1 ;
1779 sbit at 0xB2 P3_2 ;
1780 sbit at 0xB3 P3_3 ;
1781 sbit at 0xB4 P3_4 ;
1782 sbit at 0xB5 P3_5 ;
1783 #ifndef MCS51REG_EXTERNAL_RAM
1784 sbit at 0xB6 P3_6 ;
1785 sbit at 0xB7 P3_7 ;
1786 #endif
1787 // alternate names
1788 sbit at 0xB0 RXD  ;
1789 sbit at 0xB1 TXD  ;
1790 sbit at 0xB2 INT0 ;
1791 sbit at 0xB3 INT1 ;
1792 sbit at 0xB4 T0   ;
1793 sbit at 0xB5 T1   ;
1794 #ifndef MCS51REG_EXTERNAL_RAM
1795 sbit at 0xB6 WR   ;
1796 sbit at 0xB7 RD   ;
1797 #endif
1798 #endif
1799
1800 #ifdef P4_AT_0XE8
1801 #undef P4_AT_0XE8
1802 sfr at 0xE8 P4          ; // Port 4 - SAB80515 & compatible microcontrollers
1803 // Bit registers
1804 sbit at 0xE8 P4_0       ;
1805 sbit at 0xE9 P4_1       ;
1806 sbit at 0xEA P4_2       ;
1807 sbit at 0xEB P4_3       ;
1808 sbit at 0xEC P4_4       ;
1809 sbit at 0xED P4_5       ;
1810 sbit at 0xEE P4_6       ;
1811 sbit at 0xEF P4_7       ;
1812 #endif
1813
1814 #ifdef P5_AT_0XF8
1815 #undef P5_AT_0XF8
1816 sfr at 0xF8 P5          ; // Port 5 - SAB80515 & compatible microcontrollers
1817 // Bit registers
1818 sbit at 0xF8 P5_0       ;
1819 sbit at 0xF9 P5_1       ;
1820 sbit at 0xFA P5_2       ;
1821 sbit at 0xFB P5_3       ;
1822 sbit at 0xFC P5_4       ;
1823 sbit at 0xFD P5_5       ;
1824 sbit at 0xFE P5_6       ;
1825 sbit at 0xFF P5_7       ;
1826 #endif
1827
1828 #ifdef P6_AT_0XDB
1829 #undef P6_AT_0XDB
1830 sfr at 0xDB P6          ; // Port 6 - SAB80515 & compatible microcontrollers
1831 #endif
1832
1833 #ifdef P6_AT_0XFA
1834 #undef P6_AT_0XFA
1835 sfr at 0xFA P6          ; // Port 6 - SAB80517 specific
1836 #endif
1837
1838 #ifdef P7_AT_0XDB
1839 #undef P7_AT_0XDB
1840 sfr at 0xDB P7          ; // Port 7 - SAB80517 specific
1841 #endif
1842
1843 #ifdef P8_AT_0XDD
1844 #undef P8_AT_0XDD
1845 sfr at 0xDD P8          ; // Port 6 - SAB80517 specific
1846 #endif
1847
1848 #ifdef PCON__SMOD__x__x__x__x__x__x__x
1849 #undef PCON__SMOD__x__x__x__x__x__x__x
1850 sfr at 0x87 PCON ;
1851 // Not directly accessible PCON bits
1852 #define SMOD    0x80
1853 #endif
1854
1855 #ifdef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
1856 #undef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
1857 sfr at 0x87 PCON ;
1858 // Not directly accessible PCON bits
1859 #define IDL             0x01
1860 #define PD              0x02
1861 #define GF0             0x04
1862 #define GF1             0x08
1863 #define SMOD            0x80
1864 #endif
1865
1866 #ifdef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1867 #undef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1868 sfr at 0x87 PCON ;
1869 // Not directly accessible PCON bits
1870 #define IDL             0x01
1871 #define IDLE            0x01  ; same as IDL
1872 #define PD              0x02  ;
1873 #define PDE             0x02  ; same as PD
1874 #define IDLS            0x20
1875 #define PDS             0x40
1876 #define SMOD            0x80
1877 // alternate names
1878 #define PCON_IDLE       0x01
1879 #define PCON_PDE        0x02
1880 #define PCON_GF0        0x04
1881 #define PCON_GF1        0x08
1882 #define PCON_IDLS       0x20
1883 #define PCON_PDS        0x40
1884 #define PCON_SMOD       0x80
1885 #endif
1886
1887 #ifdef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
1888 #undef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
1889 sfr at 0x87 PCON ;
1890 // Not directly accessible PCON bits
1891 #define IDL             0x01
1892 #define IDLE            0x01  ; same as IDL
1893 #define STOP            0x02  ;
1894 #define EWT             0x04
1895 #define EPFW            0x08
1896 #define WTR             0x10
1897 #define PFW             0x20
1898 #define POR             0x40
1899 #define SMOD            0x80
1900 #endif
1901
1902 #ifdef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
1903 #undef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
1904 sfr at 0x87 PCON ;
1905 // Not directly accessible PCON bits
1906 #define IDL             0x01
1907 #define IDLE            0x01  ; same as IDL
1908 #define STOP            0x02  ;
1909 #define GF0             0x04
1910 #define GF1             0x08
1911 #define SMOD0           0x40
1912 #define SMOD            0x80
1913 #endif
1914
1915 #ifdef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
1916 #undef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
1917 sfr at 0x87 PCON ;
1918 // Not directly accessible PCON bits
1919 #define IDL             0x01
1920 #define IDLE            0x01  ; same as IDL
1921 #define STOP            0x02  ;
1922 #define GF0             0x04
1923 #define GF1             0x08
1924 #define OFDE            0x10
1925 #define OFDF            0x20
1926 #define SMOD0           0x40
1927 #define SMOD            0x80
1928 #endif
1929
1930 #ifdef PMR
1931 #undef PMR
1932 sfr at 0xC4 PMR  ;   // DS87C520, DS83C520
1933 // Not directly accessible bits
1934 #define DME0    0x01
1935 #define DME1    0x02
1936 #define ALEOFF  0x04
1937 #define XTOFF   0x08
1938 #define SWB     0x20
1939 #define CD0     0x40
1940 #define CD1     0x80
1941 #endif
1942
1943 #ifdef PSW
1944 #undef PSW
1945 sfr at 0xD0 PSW  ;
1946 // Bit registers
1947 sbit at 0xD0 P    ;
1948 sbit at 0xD1 F1   ;
1949 sbit at 0xD2 OV   ;
1950 sbit at 0xD3 RS0  ;
1951 sbit at 0xD4 RS1  ;
1952 sbit at 0xD5 F0   ;
1953 sbit at 0xD6 AC   ;
1954 sbit at 0xD7 CY   ;
1955 #endif
1956
1957 #ifdef RCAP2H
1958 #undef RCAP2H
1959 sfr at 0xCB RCAP2H  ;
1960 #endif
1961
1962 #ifdef RCAP2L
1963 #undef RCAP2L
1964 sfr at 0xCA RCAP2L  ;
1965 #endif
1966
1967 #ifdef RNR
1968 #undef RNR
1969 sfr at 0xCF RNR  ;
1970 #endif
1971
1972 #ifdef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
1973 #undef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
1974 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
1975 // Not directly accessible bits
1976 #define RSM0    0x01
1977 #define RSM1    0x02
1978 #define RSM2    0x04
1979 #endif
1980
1981 #ifdef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
1982 #undef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
1983 sfr at 0xC2 ROMSIZE  ;   // DS87C520, DS83C520
1984 // Not directly accessible bits
1985 #define RSM0    0x01
1986 #define RSM1    0x02
1987 #define RSM2    0x04
1988 #define PRAME   0x08
1989 #define MOVCX   0x10
1990 #define TE      0x20
1991 #define BPF     0x40
1992 #define HBPF    0x80
1993 #endif
1994
1995 #ifdef RPCTL
1996 #undef RPCTL
1997 sfr at 0xD8 RPCTL     ;  // Dallas DS5001 specific
1998 sbit at 0xD8 RG0      ;
1999 sbit at 0xD9 RPCON    ;
2000 sbit at 0xDA DMA      ;
2001 sbit at 0xDB IBI      ;
2002 sbit at 0xDC AE       ;
2003 sbit at 0xDD EXBS     ;
2004 sbit at 0xDF RNR_FLAG ;
2005 #endif
2006
2007 #ifdef S0BUF
2008 #undef S0BUF
2009 sfr at 0x99 S0BUF ; // serial channel 0 buffer register SAB80517 specific
2010 #endif
2011
2012 #ifdef S0CON
2013 #undef S0CON
2014 sfr at 0x98 S0CON ; // serial channel 0 control register SAB80517 specific
2015 // Bit registers
2016 sbit at 0x98 RI0  ; // S0CON.0: receiver0 interrupt flag
2017 sbit at 0x99 TI0  ; // S0CON.1: transmitter0 interrupt flag
2018 sbit at 0x9A RB80 ; // S0CON.2: receiver0 bit8
2019 sbit at 0x9B TB80 ; // S0CON.3: transmitter0 bit 8
2020 sbit at 0x9C REN0 ; // S0CON.4: receiver0 enable
2021 sbit at 0x9D SM20 ; // S0CON.5: multiprocessor feature
2022 sbit at 0x9E SM1  ; // S0CON.6: | select serial mode
2023 sbit at 0x9F SM0  ; // S0CON.7: |
2024 #endif
2025
2026 #ifdef S0RELL
2027 #undef S0RELL
2028 sfr at 0xAA S0RELL ; // serial channel 0 reload register low byte SAB80517 specific
2029 #endif
2030
2031 #ifdef S0RELH
2032 #undef S0RELH
2033 sfr at 0xBA S0RELH ; // serial channel 0 reload register high byte SAB80517 specific
2034 #endif
2035
2036 #ifdef S1BUF
2037 #undef S1BUF
2038 sfr at 0x9C S1BUF ; // serial channel 1 buffer register SAB80517 specific
2039 #endif
2040
2041 #ifdef S1CON
2042 #undef S1CON
2043 sfr at 0x9B S1CON ; // serial channel 1 control register SAB80517 specific
2044 #endif
2045
2046 #ifdef S1RELL
2047 #undef S1RELL
2048 sfr at 0x9D S1RELL ; // serial channel 1 reload register low byte SAB80517 specific
2049 #endif
2050
2051 #ifdef S1RELH
2052 #undef S1RELH
2053 sfr at 0xBB S1RELH ; // serial channel 1 reload register high byte SAB80517 specific
2054 #endif
2055
2056 #ifdef SADDR0
2057 #undef SADDR0
2058 // DS80C320 specific
2059 sfr at 0xA9 SADDR0  ;
2060 #endif
2061
2062 #ifdef SADDR1
2063 #undef SADDR1
2064 // DS80C320 specific
2065 sfr at 0xAA SADDR1  ;
2066 #endif
2067
2068 #ifdef SADEN0
2069 #undef SADEN0
2070 // DS80C320 specific
2071 sfr at 0xB9 SADEN0  ;
2072 #endif
2073
2074 #ifdef SADEN1
2075 #undef SADEN1
2076 // DS80C320 specific
2077 sfr at 0xBA SADEN1  ;
2078 #endif
2079
2080 #ifdef SBUF
2081 #undef SBUF
2082 sfr at 0x99 SBUF ;
2083 #endif
2084
2085 #ifdef SBUF1
2086 #undef SBUF1
2087 // DS80C320 specific
2088 sfr at 0xC1 SBUF1 ;
2089 #endif
2090
2091 #ifdef SCON
2092 #undef SCON
2093 sfr at 0x98 SCON ;
2094 // Bit registers
2095 sbit at 0x98 RI   ;
2096 sbit at 0x99 TI   ;
2097 sbit at 0x9A RB8  ;
2098 sbit at 0x9B TB8  ;
2099 sbit at 0x9C REN  ;
2100 sbit at 0x9D SM2  ;
2101 sbit at 0x9E SM1  ;
2102 sbit at 0x9F SM0  ;
2103 #endif
2104
2105 #ifdef SCON1
2106 #undef SCON1
2107 // DS80C320 specific
2108 sfr at 0xC0 SCON1  ;
2109 // Bit registers
2110 sbit at 0xC8 RI_1         ;
2111 sbit at 0xC9 TI_1         ;
2112 sbit at 0xCA RB8_1        ;
2113 sbit at 0xCB TB8_1        ;
2114 sbit at 0xCC REN_1        ;
2115 sbit at 0xCD SM2_1        ;
2116 sbit at 0xCE SM1_1        ;
2117 sbit at 0xCF SM0_1        ;
2118 sbit at 0xCF FE_1         ;
2119 sbit at 0xCF SM0_FE_1     ;
2120 #endif
2121
2122 #ifdef SP
2123 #undef SP
2124 sfr at 0x81 SP   ;
2125 #endif
2126
2127 #ifdef SPCR
2128 #undef SPCR
2129 sfr at 0xD5 SPCR   ;   // AT89S53 specific
2130 // Not directly accesible bits
2131 #define SPR0 0x01
2132 #define SPR1 0x02
2133 #define CPHA 0x04
2134 #define CPOL 0x08
2135 #define MSTR 0x10
2136 #define DORD 0x20
2137 #define SPE  0x40
2138 #define SPIE 0x80
2139 #endif
2140
2141 #ifdef SPDR
2142 #undef SPDR
2143 sfr at 0x86 SPDR   ;   // AT89S53 specific
2144 // Not directly accesible bits
2145 #define SPD_0 0x01
2146 #define SPD_1 0x02
2147 #define SPD_2 0x04
2148 #define SPD_3 0x08
2149 #define SPD_4 0x10
2150 #define SPD_5 0x20
2151 #define SPD_6 0x40
2152 #define SPD_7 0x80
2153 #endif
2154
2155 #ifdef SPSR
2156 #undef SPSR
2157 sfr at 0xAA SPSR   ;   // AT89S53 specific
2158 // Not directly accesible bits
2159 #define SPIF 0x40
2160 #define WCOL 0x80
2161 #endif
2162
2163 #ifdef SRELH
2164 #undef SRELH
2165 sfr at 0xBA SRELH       ; // Baudrate generator reload high
2166 #endif
2167
2168 #ifdef SRELL
2169 #undef SRELL
2170 sfr at 0xAA SRELL       ; // Baudrate generator reload low
2171 #endif
2172
2173 #ifdef STATUS__PIP__HIP__LIP__x__x__x__x__x
2174 #undef STATUS__PIP__HIP__LIP__x__x__x__x__x
2175 // DS80C320 specific
2176 sfr at 0xC5 STATUS ;
2177 // Not directly accessible Bits. DS80C320 specific
2178 #define LIP  0x20
2179 #define HIP  0x40
2180 #define PIP  0x80
2181 #endif
2182
2183 #ifdef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
2184 #undef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
2185 sfr at 0xC5 STATUS ; // DS87C520 & DS83520specific
2186 // Not directly accessible Bits.
2187 #define SPRA0  0x01
2188 #define SPTA0  0x02
2189 #define SPTA1  0x04
2190 #define SPTA2  0x08
2191 #define XTUP   0x10
2192 #define LIP    0x20
2193 #define HIP    0x40
2194 #define PIP    0x80
2195 #endif
2196
2197 #ifdef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
2198 #undef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
2199 sfr at 0xDA STATUS ; // DS5001specific
2200 // Not directly accessible Bits.
2201 #define OBF    0x01
2202 #define IBF    0x02
2203 #define F0     0x04
2204 #define IA0    0x08
2205 #define ST4    0x10
2206 #define ST5    0x20
2207 #define ST6    0x40
2208 #define ST7    0x80
2209 #endif
2210
2211 #ifdef SYSCON
2212 #undef SYSCON
2213 sfr at 0xB1 SYSCON      ; // XRAM Controller Access Control
2214 // SYSCON bits
2215 #define SYSCON_XMAP0    0x01
2216 #define SYSCON_XMAP1    0x02
2217 #define SYSCON_RMAP             0x10
2218 #define SYSCON_EALE             0x20
2219 #endif
2220
2221 #ifdef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
2222 #undef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
2223 sfr at 0xC8 T2CON ;
2224 // Definitions for the 8052 compatible microcontrollers.
2225 // Bit registers
2226 sbit at 0xC8 CP_RL2  ;
2227 sbit at 0xC9 C_T2    ;
2228 sbit at 0xCA TR2     ;
2229 sbit at 0xCB EXEN2   ;
2230 sbit at 0xCC TCLK    ;
2231 sbit at 0xCD RCLK    ;
2232 sbit at 0xCE EXF2    ;
2233 sbit at 0xCF TF2     ;
2234 // alternate names
2235 sbit at 0xC8 T2CON_0 ;
2236 sbit at 0xC9 T2CON_1 ;
2237 sbit at 0xCA T2CON_2 ;
2238 sbit at 0xCB T2CON_3 ;
2239 sbit at 0xCC T2CON_4 ;
2240 sbit at 0xCD T2CON_5 ;
2241 sbit at 0xCE T2CON_6 ;
2242 sbit at 0xCF T2CON_7 ;
2243 #endif
2244
2245 #ifdef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
2246 #undef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
2247 sfr at 0xC8 T2CON ;
2248 // Definitions for the Infineon / Siemens SAB80515, SAB80515A, SAB80517
2249 // Bit registers
2250 sbit at 0xC8 T2I0 ;
2251 sbit at 0xC9 T2I1 ;
2252 sbit at 0xCA T2CM ;
2253 sbit at 0xCB T2R0 ;
2254 sbit at 0xCC T2R1 ;
2255 sbit at 0xCD I2FR ;
2256 sbit at 0xCE I3FR ;
2257 sbit at 0xCF T2PS ;
2258 // alternate names
2259 sbit at 0xC8 T2CON_0 ;
2260 sbit at 0xC9 T2CON_1 ;
2261 sbit at 0xCA T2CON_2 ;
2262 sbit at 0xCB T2CON_3 ;
2263 sbit at 0xCC T2CON_4 ;
2264 sbit at 0xCD T2CON_5 ;
2265 sbit at 0xCE T2CON_6 ;
2266 sbit at 0xCF T2CON_7 ;
2267 #endif
2268
2269 #ifdef T2MOD
2270 #undef T2MOD
2271 // Definitions for the timer/counter 2 of the Atmel 89x52 microcontroller
2272 sfr at 0xC9 T2MOD  ;
2273 // Not not directly accessible T2MOD bits
2274 #define DCEN            0x01
2275 #define T2OE            0x02
2276 // Alternate names
2277 #define DCEN_           0x01
2278 #define T2OE_           0x02
2279 #endif
2280
2281 #ifdef TA
2282 #undef TA
2283 // DS500 & DS80C320 specific
2284 sfr at 0xC7 TA ;
2285 #endif
2286
2287 #ifdef TCON
2288 #undef TCON
2289 sfr at 0x88 TCON ;
2290 //  Bit registers
2291 sbit at 0x88 IT0  ;
2292 sbit at 0x89 IE0  ;
2293 sbit at 0x8A IT1  ;
2294 sbit at 0x8B IE1  ;
2295 sbit at 0x8C TR0  ;
2296 sbit at 0x8D TF0  ;
2297 sbit at 0x8E TR1  ;
2298 sbit at 0x8F TF1  ;
2299 #endif
2300
2301 #ifdef TH0
2302 #undef TH0
2303 sfr at 0x8C TH0  ;
2304 #endif
2305
2306 #ifdef TH1
2307 #undef TH1
2308 sfr at 0x8D TH1  ;
2309 #endif
2310
2311 #ifdef TH2
2312 #undef TH2
2313 sfr at 0xCD TH2     ;
2314 #endif
2315
2316 #ifdef TL0
2317 #undef TL0
2318 sfr at 0x8A TL0  ;
2319 #endif
2320
2321 #ifdef TL1
2322 #undef TL1
2323 sfr at 0x8B TL1  ;
2324 #endif
2325
2326 #ifdef TL2
2327 #undef TL2
2328 sfr at 0xCC TL2     ;
2329 #endif
2330
2331 #ifdef TMOD
2332 #undef TMOD
2333 sfr at 0x89 TMOD ;
2334 // Not directly accessible TMOD bits
2335 #define T0_M0           0x01
2336 #define T0_M1           0x02
2337 #define T0_CT           0x04
2338 #define T0_GATE         0x08
2339 #define T1_M0           0x10
2340 #define T1_M1           0x20
2341 #define T1_CT           0x40
2342 #define T1_GATE         0x80
2343
2344 #define T0_MASK         0x0F
2345 #define T1_MASK         0xF0
2346 #endif
2347
2348 #ifdef WCON
2349 #undef WCON
2350 sfr at 0x96 WCON   ;   // AT89S53 specific
2351 // Not directly accesible bits
2352 #define WDTEN  0x01
2353 #define WDTRST 0x02
2354 #define DPS    0x04
2355 #define PS0    0x20
2356 #define PS1    0x40
2357 #define PS2    0x80
2358 #endif
2359
2360 #ifdef WDCON
2361 #undef WDCON
2362 // DS80C320 specific
2363 sfr at 0xD8 WDCON ;
2364 // Not directly accessible bits
2365 #define RWT    0x01    /* Timed-Access protected */
2366 #define EWT    0x02    /* Timed-Access protected */
2367 #define WTRF   0x04
2368 #define WDIF   0x08    /* Timed-Access protected */
2369 #define PFI    0x10
2370 #define EPFI   0x20
2371 #define POR    0x40    /* Timed-Access protected */
2372 #define SMOD_1 0x80
2373 #endif
2374
2375 #ifdef WDTREL
2376 #undef WDTREL
2377 sfr at 0x86 WDTREL    ; // Watchdof Timer reload register
2378 #endif
2379
2380 #ifdef XPAGE
2381 #undef XPAGE
2382 sfr at 0x91 XPAGE     ; // Page Address Register for Extended On-Chip Ram - Infineon / Siemens SAB80515A specific
2383 #endif
2384
2385
2386 /////////////////////////
2387 /// Interrupt vectors ///
2388 /////////////////////////
2389
2390 // Interrupt numbers: address = (number * 8) + 3
2391 #define IE0_VECTOR      0       // 0x03 external interrupt 0
2392 #define TF0_VECTOR      1       // 0x0b timer 0
2393 #define IE1_VECTOR      2       // 0x13 external interrupt 1
2394 #define TF1_VECTOR      3       // 0x1b timer 1
2395 #define SI0_VECTOR      4       // 0x23 serial port 0
2396
2397 #ifdef MICROCONTROLLER_AT89S53
2398 #define TF2_VECTOR      5       /* 0x2B timer 2 */
2399 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
2400 #endif
2401
2402 #ifdef MICROCONTROLLER_AT89X52
2403 #define TF2_VECTOR      5       /* 0x2B timer 2 */
2404 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
2405 #endif
2406
2407 #ifdef MICROCONTROLLER_AT89X55
2408 #define TF2_VECTOR      5       /* 0x2B timer 2 */
2409 #define EX2_VECTOR      5       /* 0x2B external interrupt 2 */
2410 #endif
2411
2412 #ifdef MICROCONTROLLER_DS5000
2413 #define PFW_VECTOR      5       /* 0x2B */
2414 #endif
2415
2416 #ifdef MICROCONTROLLER_DS5001
2417 #define PFW_VECTOR      5       /* 0x2B */
2418 #endif
2419
2420 #ifdef MICROCONTROLLER_DS80C32X
2421 #define TF2_VECTOR      5  /* 0x2B */
2422 #define PFI_VECTOR      6  /* 0x33 */
2423 #define SIO1_VECTOR     7  /* 0x3B */
2424 #define IE2_VECTOR      8  /* 0x43 */
2425 #define IE3_VECTOR      9  /* 0x4B */
2426 #define IE4_VECTOR      10 /* 0x53 */
2427 #define IE5_VECTOR      11 /* 0x5B */
2428 #define WDI_VECTOR      12 /* 0x63 */
2429 #endif
2430
2431 #ifdef MICROCONTROLLER_DS8XC520
2432 #define TF2_VECTOR      5  /* 0x2B */
2433 #define PFI_VECTOR      6  /* 0x33 */
2434 #define SIO1_VECTOR     7  /* 0x3B */
2435 #define IE2_VECTOR      8  /* 0x43 */
2436 #define IE3_VECTOR      9  /* 0x4B */
2437 #define IE4_VECTOR      10 /* 0x53 */
2438 #define IE5_VECTOR      11 /* 0x5B */
2439 #define WDI_VECTOR      12 /* 0x63 */
2440 #endif
2441
2442 #ifdef MICROCONTROLLER_SAB80515
2443 #define TF2_VECTOR      5       // 0x2B timer 2
2444 #define EX2_VECTOR      5       // 0x2B external interrupt 2
2445 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
2446 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
2447 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
2448 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
2449 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
2450 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
2451 #endif
2452
2453 #ifdef MICROCONTROLLER_SAB80515A
2454 #define TF2_VECTOR      5       // 0x2B timer 2
2455 #define EX2_VECTOR      5       // 0x2B external interrupt 2
2456 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
2457 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
2458 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
2459 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
2460 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
2461 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
2462 #endif
2463
2464 #ifdef MICROCONTROLLER_SAB80517
2465 #define TF2_VECTOR      5       // 0x2B timer 2
2466 #define EX2_VECTOR      5       // 0x2B external interrupt 2
2467 #define IADC_VECTOR     8       // 0x43 A/D converter interrupt
2468 #define IEX2_VECTOR     9       // 0x4B external interrupt 2
2469 #define IEX3_VECTOR    10       // 0x53 external interrupt 3
2470 #define IEX4_VECTOR    11       // 0x5B external interrupt 4
2471 #define IEX5_VECTOR    12       // 0x63 external interrupt 5
2472 #define IEX6_VECTOR    13       // 0x6B external interrupt 6
2473                                 // 0x73 not used
2474                                 // 0x7B not used
2475 #define SI1_VECTOR     16       // 0x83 serial port 1
2476                                 // 0x8B not used
2477                                 // 0x93 not used
2478 #define COMPARE_VECTOR 19       // 0x9B compare
2479 #endif
2480
2481 #endif  // End of the header -> #ifndef MCS51REG_H