1 /*-------------------------------------------------------------------------
2 Register Declarations for the Intel 8051 Processor
4 Written By - Bela Torok / bela.torok@kssg.ch (July 2000)
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library 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 GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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 -------------------------------------------------------------------------*/
29 __sfr __at (0x80) P0 ;
30 __sfr __at (0x81) SP ;
31 __sfr __at (0x82) DPL ;
32 __sfr __at (0x83) DPH ;
33 __sfr __at (0x87) PCON ;
34 __sfr __at (0x88) TCON ;
35 __sfr __at (0x89) TMOD ;
36 __sfr __at (0x8A) TL0 ;
37 __sfr __at (0x8B) TL1 ;
38 __sfr __at (0x8C) TH0 ;
39 __sfr __at (0x8D) TH1 ;
40 __sfr __at (0x90) P1 ;
41 __sfr __at (0x98) SCON ;
42 __sfr __at (0x99) SBUF ;
43 __sfr __at (0xA0) P2 ;
44 __sfr __at (0xA8) IE ;
45 __sfr __at (0xB0) P3 ;
46 __sfr __at (0xB8) IP ;
47 __sfr __at (0xD0) PSW ;
48 __sfr __at (0xE0) ACC ;
54 __sbit __at (0x80) P0_0 ;
55 __sbit __at (0x81) P0_1 ;
56 __sbit __at (0x82) P0_2 ;
57 __sbit __at (0x83) P0_3 ;
58 __sbit __at (0x84) P0_4 ;
59 __sbit __at (0x85) P0_5 ;
60 __sbit __at (0x86) P0_6 ;
61 __sbit __at (0x87) P0_7 ;
64 __sbit __at (0x88) IT0 ;
65 __sbit __at (0x89) IE0 ;
66 __sbit __at (0x8A) IT1 ;
67 __sbit __at (0x8B) IE1 ;
68 __sbit __at (0x8C) TR0 ;
69 __sbit __at (0x8D) TF0 ;
70 __sbit __at (0x8E) TR1 ;
71 __sbit __at (0x8F) TF1 ;
74 __sbit __at (0x90) P1_0 ;
75 __sbit __at (0x91) P1_1 ;
76 __sbit __at (0x92) P1_2 ;
77 __sbit __at (0x93) P1_3 ;
78 __sbit __at (0x94) P1_4 ;
79 __sbit __at (0x95) P1_5 ;
80 __sbit __at (0x96) P1_6 ;
81 __sbit __at (0x97) P1_7 ;
84 __sbit __at (0x98) RI ;
85 __sbit __at (0x99) TI ;
86 __sbit __at (0x9A) RB8 ;
87 __sbit __at (0x9B) TB8 ;
88 __sbit __at (0x9C) REN ;
89 __sbit __at (0x9D) SM2 ;
90 __sbit __at (0x9E) SM1 ;
91 __sbit __at (0x9F) SM0 ;
94 __sbit __at (0xA0) P2_0 ;
95 __sbit __at (0xA1) P2_1 ;
96 __sbit __at (0xA2) P2_2 ;
97 __sbit __at (0xA3) P2_3 ;
98 __sbit __at (0xA4) P2_4 ;
99 __sbit __at (0xA5) P2_5 ;
100 __sbit __at (0xA6) P2_6 ;
101 __sbit __at (0xA7) P2_7 ;
104 __sbit __at (0xA8) EX0 ;
105 __sbit __at (0xA9) ET0 ;
106 __sbit __at (0xAA) EX1 ;
107 __sbit __at (0xAB) ET1 ;
108 __sbit __at (0xAC) ES ;
109 __sbit __at (0xAF) EA ;
112 __sbit __at (0xB0) P3_0 ;
113 __sbit __at (0xB1) P3_1 ;
114 __sbit __at (0xB2) P3_2 ;
115 __sbit __at (0xB3) P3_3 ;
116 __sbit __at (0xB4) P3_4 ;
117 __sbit __at (0xB5) P3_5 ;
118 __sbit __at (0xB6) P3_6 ;
119 __sbit __at (0xB7) P3_7 ;
121 __sbit __at (0xB0) RXD ;
122 __sbit __at (0xB1) TXD ;
123 __sbit __at (0xB2) INT0 ;
124 __sbit __at (0xB3) INT1 ;
125 __sbit __at (0xB4) T0 ;
126 __sbit __at (0xB5) T1 ;
127 __sbit __at (0xB6) WR ;
128 __sbit __at (0xB7) RD ;
131 __sbit __at (0xB8) PX0 ;
132 __sbit __at (0xB9) PT0 ;
133 __sbit __at (0xBA) PX1 ;
134 __sbit __at (0xBB) PT1 ;
135 __sbit __at (0xBC) PS ;
138 __sbit __at (0xD0) P ;
139 __sbit __at (0xD1) F1 ;
140 __sbit __at (0xD2) OV ;
141 __sbit __at (0xD3) RS0 ;
142 __sbit __at (0xD4) RS1 ;
143 __sbit __at (0xD5) F0 ;
144 __sbit __at (0xD6) AC ;
145 __sbit __at (0xD7) CY ;
147 /* BIT definitions for bits that are not directly accessible */
168 /* Interrupt numbers: address = (number * 8) + 3 */
169 #define IE0_VECTOR 0 /* 0x03 external interrupt 0 */
170 #define TF0_VECTOR 1 /* 0x0b timer 0 */
171 #define IE1_VECTOR 2 /* 0x13 external interrupt 1 */
172 #define TF1_VECTOR 3 /* 0x1b timer 1 */
173 #define SI0_VECTOR 4 /* 0x23 serial port 0 */