* src/mcs51/gen.c (pushSide, genSignedRightShift, genDjnz, geniPush):
[fw/sdcc] / device / include / mc68hc908gp32.h
1 /*-------------------------------------------------------------------------
2   Register Declarations for Motorola MC68HC908GP32
3   
4   Copyright (c) 2004, Juan Gonzalez <juan@iearobotics.com>
5
6   Based on mc68hc908qy.h,
7    Written By - Erik Petrich
8     epetrich@users.sourceforge.net (2003)
9     
10    This program is free software; you can redistribute it and/or modify it
11    under the terms of the GNU General Public License as published by the
12    Free Software Foundation; either version 2, or (at your option) any
13    later version.
14    
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19    
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23    
24    In other words, you are welcome to use, share and improve this program.
25    You are forbidden to forbid anyone else to use, share and improve
26    what you give them.   Help stamp out software-hoarding!  
27 -------------------------------------------------------------------------*/
28
29 #ifndef MC68HC908GP32_H
30 #define MC68HC908GP32_H
31
32 #ifndef UINT8
33  #define UINT8 unsigned char
34 #endif
35 #ifndef UINT16
36  #define UINT16 unsigned int
37 #endif
38 #ifndef VOLDATA
39  #define VOLDATA volatile data
40 #endif
41 #ifndef VOLXDATA
42  #define VOLXDATA volatile xdata
43 #endif
44
45 struct _hc08_bits
46 {
47   unsigned int bit0:1;
48   unsigned int bit1:1;
49   unsigned int bit2:1;
50   unsigned int bit3:1;
51   unsigned int bit4:1;
52   unsigned int bit5:1;
53   unsigned int bit6:1;
54   unsigned int bit7:1;
55 };
56   
57
58 VOLDATA UINT8 at 0x00 PTA;     /* Port A Data Register */
59 #define PORTA PTA                                                        /* Alias for PTA        */
60   #define PTA0 ((struct _hc08_bits *)(&PTA))->bit0
61   #define PTA1 ((struct _hc08_bits *)(&PTA))->bit1
62   #define PTA2 ((struct _hc08_bits *)(&PTA))->bit2
63   #define PTA3 ((struct _hc08_bits *)(&PTA))->bit3
64   #define PTA4 ((struct _hc08_bits *)(&PTA))->bit4
65   #define PTA5 ((struct _hc08_bits *)(&PTA))->bit5
66   #define AWUL ((struct _hc08_bits *)(&PTA))->bit6
67   
68 VOLDATA UINT8 at 0x01 PTB;     /* Port B Data Register */
69 #define PORTB PTB              /* Alias for PTB        */       
70   #define PTB0 ((struct _hc08_bits *)(&PTB))->bit0
71   #define PTB1 ((struct _hc08_bits *)(&PTB))->bit1
72   #define PTB2 ((struct _hc08_bits *)(&PTB))->bit2
73   #define PTB3 ((struct _hc08_bits *)(&PTB))->bit3
74   #define PTB4 ((struct _hc08_bits *)(&PTB))->bit4
75   #define PTB5 ((struct _hc08_bits *)(&PTB))->bit5
76   #define PTB6 ((struct _hc08_bits *)(&PTB))->bit6
77   #define PTB7 ((struct _hc08_bits *)(&PTB))->bit7
78
79 VOLDATA UINT8 at 0x02 PTC;     /* Port C Data Register */
80 #define PORTC PTC              /* Alias for PTC        */
81   #define PTC0 ((struct _hc08_bits *)(&PTC))->bit0
82   #define PTC1 ((struct _hc08_bits *)(&PTC))->bit1
83   #define PTC2 ((struct _hc08_bits *)(&PTC))->bit2
84   #define PTC3 ((struct _hc08_bits *)(&PTC))->bit3
85   #define PTC4 ((struct _hc08_bits *)(&PTC))->bit4
86   #define PTC5 ((struct _hc08_bits *)(&PTC))->bit5
87   #define PTC6 ((struct _hc08_bits *)(&PTC))->bit6
88   #define PTC7 ((struct _hc08_bits *)(&PTC))->bit7
89
90 VOLDATA UINT8 at 0x03 PTD;     /* Port D Data Register */
91 #define PORTD PTD              /* Alias for PTD        */
92   #define PTD0 ((struct _hc08_bits *)(&PTD))->bit0
93   #define PTD1 ((struct _hc08_bits *)(&PTD))->bit1
94   #define PTD2 ((struct _hc08_bits *)(&PTD))->bit2
95   #define PTD3 ((struct _hc08_bits *)(&PTD))->bit3
96   #define PTD4 ((struct _hc08_bits *)(&PTD))->bit4
97   #define PTD5 ((struct _hc08_bits *)(&PTD))->bit5
98   #define PTD6 ((struct _hc08_bits *)(&PTD))->bit6
99   #define PTD7 ((struct _hc08_bits *)(&PTD))->bit7
100
101 VOLDATA UINT8 at 0x04 DDRA;    /* Data Direction Register A */
102   #define DDRA0 ((struct _hc08_bits *)(&DDRA))->bit0
103   #define DDRA1 ((struct _hc08_bits *)(&DDRA))->bit1
104   #define DDRA2 ((struct _hc08_bits *)(&DDRA))->bit2
105   #define DDRA3 ((struct _hc08_bits *)(&DDRA))->bit3
106   #define DDRA4 ((struct _hc08_bits *)(&DDRA))->bit4
107   #define DDRA5 ((struct _hc08_bits *)(&DDRA))->bit5
108   #define DDRA6 ((struct _hc08_bits *)(&DDRA))->bit6
109   #define DDRA7 ((struct _hc08_bits *)(&DDRA))->bit7
110
111 VOLDATA UINT8 at 0x05 DDRB;    /* Data Direction Register B */
112   #define DDRB0 ((struct _hc08_bits *)(&DDRB))->bit0
113   #define DDRB1 ((struct _hc08_bits *)(&DDRB))->bit1
114   #define DDRB2 ((struct _hc08_bits *)(&DDRB))->bit2
115   #define DDRB3 ((struct _hc08_bits *)(&DDRB))->bit3
116   #define DDRB4 ((struct _hc08_bits *)(&DDRB))->bit4
117   #define DDRB5 ((struct _hc08_bits *)(&DDRB))->bit5
118   #define DDRB6 ((struct _hc08_bits *)(&DDRB))->bit6
119   #define DDRB7 ((struct _hc08_bits *)(&DDRB))->bit7
120
121 VOLDATA UINT8 at 0x06 DDRC;    /* Data Direction Register C */
122   #define DDRC0 ((struct _hc08_bits *)(&DDRC))->bit0
123   #define DDRC1 ((struct _hc08_bits *)(&DDRC))->bit1
124   #define DDRC2 ((struct _hc08_bits *)(&DDRC))->bit2
125   #define DDRC3 ((struct _hc08_bits *)(&DDRC))->bit3
126   #define DDRC4 ((struct _hc08_bits *)(&DDRC))->bit4
127   #define DDRC5 ((struct _hc08_bits *)(&DDRC))->bit5
128   #define DDRC6 ((struct _hc08_bits *)(&DDRC))->bit6
129   #define DDRC7 ((struct _hc08_bits *)(&DDRC))->bit7
130
131 VOLDATA UINT8 at 0x07 DDRD;    /* Data Direction Register D */
132   #define DDRD0 ((struct _hc08_bits *)(&DDRD))->bit0
133   #define DDRD1 ((struct _hc08_bits *)(&DDRD))->bit1
134   #define DDRD2 ((struct _hc08_bits *)(&DDRD))->bit2
135   #define DDRD3 ((struct _hc08_bits *)(&DDRD))->bit3
136   #define DDRD4 ((struct _hc08_bits *)(&DDRD))->bit4
137   #define DDRD5 ((struct _hc08_bits *)(&DDRD))->bit5
138   #define DDRD6 ((struct _hc08_bits *)(&DDRD))->bit6
139   #define DDRD7 ((struct _hc08_bits *)(&DDRD))->bit7
140
141 VOLDATA UINT8 at 0x08 PTE;     /* Port E Data Register */
142 #define PORTE PTE              /* Alias for PTE        */
143   #define PTE0 ((struct _hc08_bits *)(&PTE))->bit0
144   #define PTE1 ((struct _hc08_bits *)(&PTE))->bit1
145   #define PTE2 ((struct _hc08_bits *)(&PTE))->bit2
146   #define PTE3 ((struct _hc08_bits *)(&PTE))->bit3
147   #define PTE4 ((struct _hc08_bits *)(&PTE))->bit4
148   #define PTE5 ((struct _hc08_bits *)(&PTE))->bit5
149   #define PTE6 ((struct _hc08_bits *)(&PTE))->bit6
150   #define PTE7 ((struct _hc08_bits *)(&PTE))->bit7
151
152 VOLDATA UINT8 at 0x0C DDRE;    /* Data Direction Register E */
153   #define DDRE0 ((struct _hc08_bits *)(&DDRE))->bit0
154   #define DDRE1 ((struct _hc08_bits *)(&DDRE))->bit1
155   #define DDRE2 ((struct _hc08_bits *)(&DDRE))->bit2
156   #define DDRE3 ((struct _hc08_bits *)(&DDRE))->bit3
157   #define DDRE4 ((struct _hc08_bits *)(&DDRE))->bit4
158   #define DDRE5 ((struct _hc08_bits *)(&DDRE))->bit5
159   #define DDRE6 ((struct _hc08_bits *)(&DDRE))->bit6
160   #define DDRE7 ((struct _hc08_bits *)(&DDRE))->bit7
161                 
162 VOLDATA UINT8 at 0x0D PTAPUE;  /* Port A pull-up enables */
163         #define PTAPUE0 ((struct _hc08_bits *)(&PTAPUE))->bit0
164         #define PTAPUE1 ((struct _hc08_bits *)(&PTAPUE))->bit1  
165         #define PTAPUE2 ((struct _hc08_bits *)(&PTAPUE))->bit2
166         #define PTAPUE3 ((struct _hc08_bits *)(&PTAPUE))->bit3  
167   #define PTAPUE4 ((struct _hc08_bits *)(&PTAPUE))->bit4
168         #define PTAPUE5 ((struct _hc08_bits *)(&PTAPUE))->bit5  
169         #define PTAPUE6 ((struct _hc08_bits *)(&PTAPUE))->bit6
170         #define PTAPUE7 ((struct _hc08_bits *)(&PTAPUE))->bit7          
171                 
172 VOLDATA UINT8 at 0x0E PTCPUE;    /* Port C pull-up enables */
173         #define PTCPUE0 ((struct _hc08_bits *)(&PTCPUE))->bit0
174         #define PTCPUE1 ((struct _hc08_bits *)(&PTCPUE))->bit1  
175         #define PTCPUE2 ((struct _hc08_bits *)(&PTCPUE))->bit2
176         #define PTCPUE3 ((struct _hc08_bits *)(&PTCPUE))->bit3          
177         #define PTCPUE4 ((struct _hc08_bits *)(&PTCPUE))->bit4
178         #define PTCPUE5 ((struct _hc08_bits *)(&PTCPUE))->bit5  
179         #define PTCPUE6 ((struct _hc08_bits *)(&PTCPUE))->bit6
180         /* PTCPUE7 does not exit! */
181         
182 VOLDATA UINT8 at 0x0F PTDPUE;  /* port D pull-up enables */
183         #define PTDPUE0 ((struct _hc08_bits *)(&PTDPUE))->bit0
184         #define PTDPUE1 ((struct _hc08_bits *)(&PTDPUE))->bit1  
185   #define PTDPUE2 ((struct _hc08_bits *)(&PTDPUE))->bit2
186         #define PTDPUE3 ((struct _hc08_bits *)(&PTDPUE))->bit3
187         #define PTDPUE4 ((struct _hc08_bits *)(&PTDPUE))->bit4
188         #define PTDPUE5 ((struct _hc08_bits *)(&PTDPUE))->bit5  
189   #define PTDPUE6 ((struct _hc08_bits *)(&PTDPUE))->bit6
190         #define PTDPUE7 ((struct _hc08_bits *)(&PTDPUE))->bit7
191                 
192 VOLDATA UINT8 at 0x10 SPCR;   /* SPI Control Register */
193         #define SPRIE  ((struct _hc08_bits *)(&SPCR))->bit7
194         #define DMAS   ((struct _hc08_bits *)(&SPCR))->bit6
195         #define SPMSTR ((struct _hc08_bits *)(&SPCR))->bit5     
196         #define CPOL   ((struct _hc08_bits *)(&SPCR))->bit4
197         #define CPHA   ((struct _hc08_bits *)(&SPCR))->bit3     
198   #define SPWOM  ((struct _hc08_bits *)(&SPCR))->bit2
199         #define SPE    ((struct _hc08_bits *)(&SPCR))->bit1     
200   #define SPTIE  ((struct _hc08_bits *)(&SPCR))->bit0   
201         
202 VOLDATA UINT8 at 0x11 SPSCR;  /* SPI Status and Control Register */
203         #define SPRF   ((struct _hc08_bits *)(&SPSCR))->bit7
204         #define ERRIE  ((struct _hc08_bits *)(&SPSCR))->bit6
205         #define OVRF   ((struct _hc08_bits *)(&SPSCR))->bit5
206         #define MODF   ((struct _hc08_bits *)(&SPSCR))->bit4
207         #define SPTE   ((struct _hc08_bits *)(&SPSCR))->bit3
208         #define MODFEN ((struct _hc08_bits *)(&SPSCR))->bit2
209         #define SPR1   ((struct _hc08_bits *)(&SPSCR))->bit1
210         #define SPR0   ((struct _hc08_bits *)(&SPSCR))->bit0    
211                 
212 VOLDATA UINT8 at 0x12 SPDR;   /* SPI Data Register */
213
214 VOLDATA UINT8 at 0x13 SCC1;  /* SCI Control Register 1 */ 
215         #define LOOPS  ((struct _hc08_bits *)(&SCC1))->bit7
216   #define ENSCI  ((struct _hc08_bits *)(&SCC1))->bit6   
217         #define TXINV  ((struct _hc08_bits *)(&SCC1))->bit5
218   #define M      ((struct _hc08_bits *)(&SCC1))->bit4           
219         #define WAKE   ((struct _hc08_bits *)(&SCC1))->bit3
220   #define ILTY   ((struct _hc08_bits *)(&SCC1))->bit2
221         #define PEN    ((struct _hc08_bits *)(&SCC1))->bit1
222   #define PTY    ((struct _hc08_bits *)(&SCC1))->bit0
223         
224                 
225 VOLDATA UINT8 at 0x14 SCC2;  /* SCI Control Register 2 */ 
226         #define SCTIE  ((struct _hc08_bits *)(&SCC2))->bit7
227         #define TCIE   ((struct _hc08_bits *)(&SCC2))->bit6
228         #define SCRIE  ((struct _hc08_bits *)(&SCC2))->bit5
229         #define ILIE   ((struct _hc08_bits *)(&SCC2))->bit4
230         #define TE     ((struct _hc08_bits *)(&SCC2))->bit3
231         #define RE     ((struct _hc08_bits *)(&SCC2))->bit2
232         #define WRU    ((struct _hc08_bits *)(&SCC2))->bit1
233         #define SBK    ((struct _hc08_bits *)(&SCC2))->bit0
234         
235 VOLDATA UINT8 at 0x15 SCC3;  /* SCI Control Register 3 */ 
236         #define SCC3_R8 ((struct _hc08_bits *)(&SCC3))->bit7
237         #define SCC3_TB ((struct _hc08_bits *)(&SCC3))->bit6
238   #define DMARE   ((struct _hc08_bits *)(&SCC3))->bit5
239         #define DMATE   ((struct _hc08_bits *)(&SCC3))->bit4
240         #define ORIE    ((struct _hc08_bits *)(&SCC3))->bit3
241         #define NEIE    ((struct _hc08_bits *)(&SCC3))->bit2
242   #define FEIE    ((struct _hc08_bits *)(&SCC3))->bit1
243         #define PEIE    ((struct _hc08_bits *)(&SCC3))->bit0
244         
245 VOLDATA UINT8 at 0x16 SCS1;  /* SCI Status Register 1 */
246         #define SCTE  ((struct _hc08_bits *)(&SCS1))->bit7
247         #define TC    ((struct _hc08_bits *)(&SCS1))->bit6
248         #define SCRF  ((struct _hc08_bits *)(&SCS1))->bit5
249         #define IDLE  ((struct _hc08_bits *)(&SCS1))->bit4
250         #define OR    ((struct _hc08_bits *)(&SCS1))->bit3
251         #define NF    ((struct _hc08_bits *)(&SCS1))->bit2
252         #define FE    ((struct _hc08_bits *)(&SCS1))->bit1
253         #define PE    ((struct _hc08_bits *)(&SCS1))->bit0      
254                 
255 VOLDATA UINT8 at 0x17 SCS2;  /* SCI Status Register 2 */
256         #define RPF  ((struct _hc08_bits *)(&SCS2))->bit0
257         #define BKF  ((struct _hc08_bits *)(&SCS2))->bit1
258   /*  Bits 2-7 not implemented  */
259         
260 VOLDATA UINT8 at 0x18 SCDR;  /* SCI Data Register */
261         
262 VOLDATA UINT8 at 0x19 SCBR;  /* SCI Baud Rate Register */
263         #define SCP1  ((struct _hc08_bits *)(&SCBR))->bit5
264         #define SCP0  ((struct _hc08_bits *)(&SCBR))->bit4
265   #define R     ((struct _hc08_bits *)(&SCBR))->bit3
266   #define SCR2  ((struct _hc08_bits *)(&SCBR))->bit2
267   #define SCR1  ((struct _hc08_bits *)(&SCBR))->bit1
268   #define SCR0  ((struct _hc08_bits *)(&SCBR))->bit0
269         /*-- Bits 6 and 7 do not exist */
270                 
271 VOLDATA UINT8 at 0x1a INTKBSCR; /* Keyboard Status and Control Register */
272         #define KEYF   ((struct _hc08_bits *)(&INTKBSCR))->bit3
273         #define ACKK   ((struct _hc08_bits *)(&INTKBSCR))->bit2
274         #define IMASKK ((struct _hc08_bits *)(&INTKBSCR))->bit1
275         #define MODEK  ((struct _hc08_bits *)(&INTKBSCR))->bit0
276         /*-- Bits 4-7 do not exist  */
277                 
278 VOLDATA UINT8 at 0x1b INTKBIER; /* Keyboard Interrupt Enable Register */
279   #define KBIE7  ((struct _hc08_bits *)(&INTKBIER))->bit7       
280         #define KBIE6  ((struct _hc08_bits *)(&INTKBIER))->bit6
281         #define KBIE5  ((struct _hc08_bits *)(&INTKBIER))->bit5
282         #define KBIE4  ((struct _hc08_bits *)(&INTKBIER))->bit4
283         #define KBIE3  ((struct _hc08_bits *)(&INTKBIER))->bit3
284         #define KBIE2  ((struct _hc08_bits *)(&INTKBIER))->bit2
285         #define KBIE1  ((struct _hc08_bits *)(&INTKBIER))->bit1
286         #define KBIE0  ((struct _hc08_bits *)(&INTKBIER))->bit0
287                 
288 VOLDATA UINT8 at 0x1C TBCR;    /* Time Base Module Control */
289         #define TBIF   ((struct _hc08_bits *)(&TBCR))->bit7
290         #define TBR2   ((struct _hc08_bits *)(&TBCR))->bit6
291         #define TBR1   ((struct _hc08_bits *)(&TBCR))->bit5
292         #define TBR0   ((struct _hc08_bits *)(&TBCR))->bit4
293         #define TACK   ((struct _hc08_bits *)(&TBCR))->bit3
294         #define TBIE   ((struct _hc08_bits *)(&TBCR))->bit2
295         #define TBON   ((struct _hc08_bits *)(&TBCR))->bit1
296         /* Bit 0 Reserved */    
297                 
298 VOLDATA UINT8 at 0x1D INTSCR;   /* IRQ status/control       */
299         #define IRQF1  ((struct _hc08_bits *)(&INTSCR))->bit3
300         #define ACK1   ((struct _hc08_bits *)(&INTSCR))->bit2
301         #define IMASK1 ((struct _hc08_bits *)(&INTSCR))->bit1
302         #define MODE1  ((struct _hc08_bits *)(&INTSCR))->bit0
303         /* Bits 4-7 unimplemented */
304         
305 VOLDATA UINT8 at 0x1e CONFIG2; /* Configuration Register 2 */
306 /* CONFIG2 is one-time writeble, so can't use bitfields  */     
307         
308 VOLDATA UINT8 at 0x1f CONFIG1; /* Configuration Register 1 */
309 /* CONFIG1 is one-time writeable, so can't use bitfields */     
310         
311 VOLDATA UINT8 at 0x20 T1SC;     /* TIM 1 Status and Control */
312   #define PS0   ((struct _hc08_bits *)(&T1SC))->bit0
313   #define PS1   ((struct _hc08_bits *)(&T1SC))->bit1
314   #define PS2   ((struct _hc08_bits *)(&T1SC))->bit2
315   #define TRST  ((struct _hc08_bits *)(&T1SC))->bit4
316   #define TSTOP ((struct _hc08_bits *)(&T1SC))->bit5
317   #define TOIE  ((struct _hc08_bits *)(&T1SC))->bit6
318   #define TOF   ((struct _hc08_bits *)(&T1SC))->bit7    
319
320 VOLDATA UINT16 at 0x21 T1CNT;    /* TIM1 Counter High & Low Registers */
321 VOLDATA UINT8  at 0x21  T1CNTH;  /* TIM1 Counter Register High */
322 VOLDATA UINT8  at 0x22  T1CNTL;  /* TIM1 Counter Register Low */
323
324 VOLDATA UINT16 at 0x23 T1MOD;    /* TIM1 Counter Modulo High & Low Registers */
325 VOLDATA UINT8  at 0x23 T1MODH;   /* TIM1 Counter Modulo Register High */
326 VOLDATA UINT8  at 0x24 T1MODL;   /* TIM1 Counter Modulo Register Low */
327
328 VOLDATA UINT8 at 0x25 T1SC0;    /* TIM1 Channel 0 Status and Control Register */
329   #define CH0MAX ((struct _hc08_bits *)(&T1SC0))->bit0
330   #define TOV0   ((struct _hc08_bits *)(&T1SC0))->bit1
331   #define ELS0A  ((struct _hc08_bits *)(&T1SC0))->bit2
332   #define ELS0B  ((struct _hc08_bits *)(&T1SC0))->bit3
333   #define MS0A   ((struct _hc08_bits *)(&T1SC0))->bit4
334   #define MS0B   ((struct _hc08_bits *)(&T1SC0))->bit5
335   #define CH0IE  ((struct _hc08_bits *)(&T1SC0))->bit6
336   #define CH0F   ((struct _hc08_bits *)(&T1SC0))->bit7
337                 
338 VOLDATA UINT16 at 0x26 T1CH0;   /* TIM1 Channel 0 High & Low Registers */
339 VOLDATA UINT8 at 0x26 T1CH0H;   /* TIM1 Channel 0 Register High */
340 VOLDATA UINT8 at 0x27 T1CH0L;   /* TIM1 Channel 0 Register Low */
341
342 VOLDATA UINT8 at 0x28 T1SC1;    /* TIM1 Channel 1 Status and Control Register */
343   #define CH1MAX ((struct _hc08_bits *)(&T1SC1))->bit0
344   #define TOV1   ((struct _hc08_bits *)(&T1SC1))->bit1
345   #define ELS1A  ((struct _hc08_bits *)(&T1SC1))->bit2
346   #define ELS1B  ((struct _hc08_bits *)(&T1SC1))->bit3
347   #define MS1A   ((struct _hc08_bits *)(&T1SC1))->bit4
348   #define CH1IE  ((struct _hc08_bits *)(&T1SC1))->bit6
349   #define CH1F   ((struct _hc08_bits *)(&T1SC1))->bit7
350
351 VOLDATA UINT16 at 0x29 T1CH1;    /* TIM1 Channel 1 High & Low Registers */
352 VOLDATA UINT8  at 0x29  T1CH1H;  /* TIM1 Channel 1 Register High */
353 VOLDATA UINT8  at 0x2A  T1CH1L;  /* TIM1 Channel 1 Register Low */
354         
355 /*------------------*/
356 /* TIM 2 REGISTERS  */
357 /*------------------*/
358         
359 VOLDATA UINT8 at 0x2B T2SC;     /* TIM 2 Status and Control */
360   #define PS0_2   ((struct _hc08_bits *)(&T2SC))->bit0
361   #define PS1_2   ((struct _hc08_bits *)(&T2SC))->bit1
362   #define PS2_2   ((struct _hc08_bits *)(&T2SC))->bit2
363   #define TRST_2  ((struct _hc08_bits *)(&T2SC))->bit4
364   #define TSTOP_2 ((struct _hc08_bits *)(&T2SC))->bit5
365   #define TOIE_2  ((struct _hc08_bits *)(&T2SC))->bit6
366   #define TOF_2   ((struct _hc08_bits *)(&T2SC))->bit7  
367                 
368 VOLDATA UINT16 at 0x2C T2CNT;   /* TIM2 Counter High & Low Registers */
369 VOLDATA UINT8  at 0x2C T2CNTH;  /* TIM2 Counter Register High */
370 VOLDATA UINT8  at 0x2D T2CNTL;  /* TIM2 Counter Register Low */
371         
372 VOLDATA UINT16 at 0x2E T2MOD;    /* TIM2 Counter Modulo High & Low Registers */
373 VOLDATA UINT8  at 0x2E T2MODH;   /* TIM2 Counter Modulo Register High */
374 VOLDATA UINT8  at 0x2F T2MODL;   /* TIM2 Counter Modulo Register Low */ 
375         
376 VOLDATA UINT8 at 0x30 T2SC0;    /* TIM2 Channel 0 Status and Control Register */
377   #define CH0MAX_2 ((struct _hc08_bits *)(&T2SC0))->bit0
378   #define TOV0_2   ((struct _hc08_bits *)(&T2SC0))->bit1
379   #define ELS0A_2  ((struct _hc08_bits *)(&T2SC0))->bit2
380   #define ELS0B_2  ((struct _hc08_bits *)(&T2SC0))->bit3
381   #define MS0A_2   ((struct _hc08_bits *)(&T2SC0))->bit4
382   #define MS0B_2   ((struct _hc08_bits *)(&T2SC0))->bit5
383   #define CH0IE_2  ((struct _hc08_bits *)(&T2SC0))->bit6
384   #define CH0F_2   ((struct _hc08_bits *)(&T2SC0))->bit7        
385         
386 VOLDATA UINT16 at 0x31 T2CH0;    /* TIM2 Channel 0 High & Low Registers */
387 VOLDATA UINT8  at 0x31 T2CH0H;   /* TIM2 Channel 0 Register High */
388 VOLDATA UINT8  at 0x32 T2CH0L;   /* TIM2 Channel 0 Register Low */      
389         
390 VOLDATA UINT8 at 0x33 T2SC1;    /* TIM2 Channel 1 Status and Control Register */
391   #define CH1MAX_2 ((struct _hc08_bits *)(&T2SC1))->bit0
392   #define TOV1_2   ((struct _hc08_bits *)(&T2SC1))->bit1
393   #define ELS1A_2  ((struct _hc08_bits *)(&T2SC1))->bit2
394   #define ELS1B_2  ((struct _hc08_bits *)(&T2SC1))->bit3
395   #define MS1A_2   ((struct _hc08_bits *)(&T2SC1))->bit4
396   #define CH1IE_2  ((struct _hc08_bits *)(&T2SC1))->bit6
397   #define CH1F_2   ((struct _hc08_bits *)(&T2SC1))->bit7
398
399 VOLDATA UINT16 at 0x34  T2CH1;   /* TIM2 Channel 1 High & Low Registers */
400 VOLDATA UINT8  at 0x34  T2CH1H;  /* TIM2 Channel 1 Register High */
401 VOLDATA UINT8  at 0x35  T2CH1L;  /* TIM2 Channel 1 Register Low */      
402         
403 VOLDATA UINT8 at 0x36 PCTL;  /* PLL Control Register */
404         #define PLLIE ((struct _hc08_bits *)(&PCTL))->bit7
405         #define PLLF  ((struct _hc08_bits *)(&PCTL))->bit6
406         #define PLLON ((struct _hc08_bits *)(&PCTL))->bit5
407         #define BCS   ((struct _hc08_bits *)(&PCTL))->bit4
408         #define PRE1  ((struct _hc08_bits *)(&PCTL))->bit3
409         #define PRE0  ((struct _hc08_bits *)(&PCTL))->bit2
410         #define VPR1  ((struct _hc08_bits *)(&PCTL))->bit1
411         #define VPR0  ((struct _hc08_bits *)(&PCTL))->bit0
412                 
413 VOLDATA UINT8 at 0x37 PBWC;  /* PLL Bandwidth Control Register */
414         #define AUTO ((struct _hc08_bits *)(&PBWC))->bit7
415         #define LOCK ((struct _hc08_bits *)(&PBWC))->bit6
416         #define ACQ  ((struct _hc08_bits *)(&PBWC))->bit5
417         /* Bits 1-4, Unimplemented */
418         /* Bit 0, Reserved         */
419         
420 VOLDATA UINT8 at 0x38 PMSH;  /* PLL Multiplier Select High */
421         #define MUL11 ((struct _hc08_bits *)(&PMSH))->bit3
422         #define MUL10 ((struct _hc08_bits *)(&PMSH))->bit2
423         #define MUL9  ((struct _hc08_bits *)(&PMSH))->bit1
424         #define MUL8  ((struct _hc08_bits *)(&PMSH))->bit0
425         /* Bits 4-7 unimplemented */
426         
427 VOLDATA UINT8 at 0x39 PMSL;  /* PLL Multiplir Select Low */
428         #define MUL7 ((struct _hc08_bits *)(&PMSL))->bit7
429         #define MUL6 ((struct _hc08_bits *)(&PMSL))->bit6
430         #define MUL5 ((struct _hc08_bits *)(&PMSL))->bit5
431         #define MUL4 ((struct _hc08_bits *)(&PMSL))->bit4
432         #define MUL3 ((struct _hc08_bits *)(&PMSL))->bit3
433         #define MUL2 ((struct _hc08_bits *)(&PMSL))->bit2
434         #define MUL1 ((struct _hc08_bits *)(&PMSL))->bit1
435         #define MUL0 ((struct _hc08_bits *)(&PMSL))->bit0
436         
437 VOLDATA UINT8 at 0x3a PMRS;  /* PLL VCO Select Range  */
438         #define VRS7 ((struct _hc08_bits *)(&PMRS))->bit7
439         #define VRS6 ((struct _hc08_bits *)(&PMRS))->bit6
440         #define VRS5 ((struct _hc08_bits *)(&PMRS))->bit5
441         #define VRS4 ((struct _hc08_bits *)(&PMRS))->bit4
442         #define VRS3 ((struct _hc08_bits *)(&PMRS))->bit3
443         #define VRS2 ((struct _hc08_bits *)(&PMRS))->bit2
444         #define VRS1 ((struct _hc08_bits *)(&PMRS))->bit1
445         #define VRS0 ((struct _hc08_bits *)(&PMRS))->bit0
446                 
447 VOLDATA UINT8 at 0x3b PMDS;  /* PLL Reference Divider Select Register */        
448         #define RDS3 ((struct _hc08_bits *)(&PMDS))->bit3
449         #define RDS2 ((struct _hc08_bits *)(&PMDS))->bit2
450         #define RDS1 ((struct _hc08_bits *)(&PMDS))->bit1
451         #define RDS0 ((struct _hc08_bits *)(&PMDS))->bit0
452         /* Bits 4-7 unimplemented */
453
454 VOLDATA UINT8 at 0x3c ADSCR; /* Analog-to-Digital Status and Control Reg. */
455         #define COCO  ((struct _hc08_bits *)(&ADSCR))->bit7
456         #define AIEN  ((struct _hc08_bits *)(&ADSCR))->bit6
457         #define ADCO  ((struct _hc08_bits *)(&ADSCR))->bit5
458         #define ADCH4 ((struct _hc08_bits *)(&ADSCR))->bit4
459         #define ADCH3 ((struct _hc08_bits *)(&ADSCR))->bit3
460         #define ADCH2 ((struct _hc08_bits *)(&ADSCR))->bit2
461         #define ADCH1 ((struct _hc08_bits *)(&ADSCR))->bit1
462         #define ADCH0 ((struct _hc08_bits *)(&ADSCR))->bit0
463         
464 VOLDATA UINT8 at 0x3d ADR;   /* Analog-to-Digital Data Register  */
465         
466 VOLDATA UINT8 at 0x3e ADCLK; /* Analog-to-Digital Clock */
467         #define ADIV2  ((struct _hc08_bits *)(&ADCLK))->bit7
468         #define ADIV1  ((struct _hc08_bits *)(&ADCLK))->bit6
469         #define ADIV0  ((struct _hc08_bits *)(&ADCLK))->bit5
470         #define ADICLK ((struct _hc08_bits *)(&ADCLK))->bit4
471         /* Bits 0-3 unimplemented */
472
473 VOLXDATA UINT8 at 0xfe00 SBSR;     /* SIM Break Status Register */
474   #define SBSW ((struct _hc08_bits *)(&SBSR))->bit1
475
476 VOLXDATA UINT8 at 0xfe01 SRSR;    /* SIM Reset Status Register */
477   #define LVI    ((struct _hc08_bits *)(&SRSR))->bit1
478   #define MODRST ((struct _hc08_bits *)(&SRSR))->bit2
479   #define ILAD   ((struct _hc08_bits *)(&SRSR))->bit3
480   #define ILOP   ((struct _hc08_bits *)(&SRSR))->bit4
481   #define COP    ((struct _hc08_bits *)(&SRSR))->bit5
482   #define PIN    ((struct _hc08_bits *)(&SRSR))->bit6
483   #define POR    ((struct _hc08_bits *)(&SRSR))->bit7
484   /* Bit 0 unimplemented */
485
486 VOLXDATA UINT8 at 0xfe02 SUBAR;  /* SIM Upper Byte Address */
487         
488 VOLXDATA UINT8 at 0xfe03 SBFCR;    /* SIM Break Flag Control Register */
489   #define BFCE ((struct _hc08_bits *)(&BFCR))->bit7
490
491 VOLXDATA UINT8 at 0xfe04 INT1;    /* Interrupt Status Register 1 */
492   #define IF1 ((struct _hc08_bits *)(&INT1))->bit2
493   #define IF2 ((struct _hc08_bits *)(&INT1))->bit3
494   #define IF3 ((struct _hc08_bits *)(&INT1))->bit4
495   #define IF4 ((struct _hc08_bits *)(&INT1))->bit5
496   #define IF5 ((struct _hc08_bits *)(&INT1))->bit6
497   #define IF6 ((struct _hc08_bits *)(&INT1))->bit7
498         /* Bits 0-1 Reserved */
499         
500 VOLXDATA UINT8 at 0xfe05 INT2;  /* Interrupt Status Register 2 */
501   #define IF14 ((struct _hc08_bits *)(&INT2))->bit7
502         #define IF13 ((struct _hc08_bits *)(&INT2))->bit6       
503         #define IF12 ((struct _hc08_bits *)(&INT2))->bit5
504         #define IF11 ((struct _hc08_bits *)(&INT2))->bit4       
505         #define IF10 ((struct _hc08_bits *)(&INT2))->bit3
506         #define IF9 ((struct _hc08_bits *)(&INT2))->bit2
507         #define IF8 ((struct _hc08_bits *)(&INT2))->bit1
508         #define IF7 ((struct _hc08_bits *)(&INT2))->bit0        
509                 
510 VOLXDATA UINT8 at 0xfe06 INT3;  /* Interrupt Status Register 3 */
511   #define IF16 ((struct _hc08_bits *)(&INT3))->bit1     
512         #define IF15 ((struct _hc08_bits *)(&INT3))->bit0       
513                 
514 VOLXDATA UINT8 at 0xfe07 FLCTR;  /* Flash test/programming */   
515         
516 VOLXDATA UINT8 at 0xfe08 FLCR;    /* FLASH Control Register */
517   #define PGM   ((struct _hc08_bits *)(&FLCR))->bit0
518   #define ERASE ((struct _hc08_bits *)(&FLCR))->bit1
519   #define MASS  ((struct _hc08_bits *)(&FLCR))->bit2
520   #define HVEN  ((struct _hc08_bits *)(&FLCR))->bit3
521                 
522 VOLXDATA UINT16 at 0xfe09 BRK;    /* Break Address High & Low Registers */
523 VOLXDATA UINT8 at 0xfe09 BRKH;    /* Break Address High Register */
524 VOLXDATA UINT8 at 0xfe0a BRKL;    /* Break Address Low Register */      
525         
526 VOLXDATA UINT8 at 0xfe0b BRKSCR;  /* Break Status and Control Register */
527   #define BRKA ((struct _hc08_bits *)(&BRKSCR))->bit6
528   #define BRKE ((struct _hc08_bits *)(&BRKSCR))->bit7   
529
530 VOLXDATA UINT8 at 0xfe0c LVISR;   /* Low voltage detect */
531         #define LVIOUT ((struct _hc08_bits *)(&LVISR))->bit7
532         
533         
534 VOLXDATA UINT8 at 0xfe7e FLBPR;    /* FLASH Block Protect Register */
535   #define BPR0 ((struct _hc08_bits *)(&FLBPR))->bit0
536   #define BPR1 ((struct _hc08_bits *)(&FLBPR))->bit1
537   #define BPR2 ((struct _hc08_bits *)(&FLBPR))->bit2
538   #define BPR3 ((struct _hc08_bits *)(&FLBPR))->bit3
539   #define BPR4 ((struct _hc08_bits *)(&FLBPR))->bit4
540   #define BPR5 ((struct _hc08_bits *)(&FLBPR))->bit5
541   #define BPR6 ((struct _hc08_bits *)(&FLBPR))->bit6
542   #define BPR7 ((struct _hc08_bits *)(&FLBPR))->bit7
543
544 VOLXDATA UINT8 at 0xffff COPCTL;  /* COP Control Register */
545
546 #endif