* device/lib/Makefile.in: removed comment line with model-pic16,
[fw/sdcc] / src / pic16 / main.c
1 /*-------------------------------------------------------------------------
2
3   main.c - pic16 specific general functions.
4
5    Written by - Scott Dattalo scott@dattalo.com
6    Ported to PIC16 by - Martin Dubuc m.debuc@rogers.com
7     
8    Note that mlh prepended _pic16_ on the static functions.  Makes
9    it easier to set a breakpoint using the debugger.
10
11
12    This program is free software; you can redistribute it and/or modify it
13    under the terms of the GNU General Public License as published by the
14    Free Software Foundation; either version 2, or (at your option) any
15    later version.
16    
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License for more details.
21    
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 -------------------------------------------------------------------------*/
26
27 #include "common.h"
28 #include "main.h"
29 #include "ralloc.h"
30 #include "device.h"
31 #include "SDCCutil.h"
32 #include "glue.h"
33 #include "pcode.h"
34 //#include "gen.h"
35
36
37 static char _defaultRules[] =
38 {
39 #include "peeph.rul"
40 };
41
42 /* list of key words used by pic16 */
43 static char *_pic16_keywords[] =
44 {
45   "at",
46   "bit",
47   "code",
48   "critical",
49   "data",
50   "far",
51   "idata",
52   "interrupt",
53   "near",
54   "pdata",
55   "reentrant",
56   "sfr",
57   "sbit",
58   "using",
59   "xdata",
60   "_data",
61   "_code",
62   "_generic",
63   "_near",
64   "_xdata",
65   "_pdata",
66   "_idata",
67   "_naked",
68   NULL
69 };
70
71
72 pic16_sectioninfo_t pic16_sectioninfo;
73
74
75 extern char *pic16_processor_base_name(void);
76
77 void  pic16_pCodeInitRegisters(void);
78
79 void pic16_assignRegisters (eBBlock ** ebbs, int count);
80
81 static int regParmFlg = 0;      /* determine if we can register a parameter */
82
83 pic16_options_t pic16_options;
84
85 extern set *includeDirsSet;
86 extern set *dataDirsSet;
87 extern set *libFilesSet;
88
89 /* Also defined in gen.h, but the #include is commented out */
90 /* for an unknowned reason. - EEP */
91 void pic16_emitDebuggerSymbol (char *);
92  
93 extern regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alias, operand *refop);
94 extern void pic16_emitConfigRegs(FILE *of);
95
96
97
98
99 static void
100 _pic16_init (void)
101 {
102         asm_addTree (&asm_asxxxx_mapping);
103         pic16_pCodeInitRegisters();
104         maxInterrupts = 2;
105
106         /* set pic16 port options to defaults */
107         pic16_options.no_banksel = 0;
108         pic16_options.opt_banksel = 0;
109         pic16_options.omit_configw = 0;
110         pic16_options.omit_ivt = 0;
111         pic16_options.leave_reset = 0;
112         pic16_options.stack_model = 0;                  /* 0 for 'small', 1 for 'large' */
113 }
114
115 static void
116 _pic16_reset_regparm ()
117 {
118   regParmFlg = 0;
119 }
120
121 static int
122 _pic16_regparm (sym_link * l)
123 {
124   /* for this processor it is simple
125      can pass only the first parameter in a register */
126   //if (regParmFlg)
127   //  return 0;
128
129   regParmFlg++;// = 1;
130   return 1;
131 }
132
133
134 int initsfpnt=0;                /* set to 1 if source provides a pragma for stack
135                                  * so glue() later emits code to initialize stack/frame pointers */
136 set *absSymSet;
137
138 static int
139 _process_pragma(const char *sz)
140 {
141   static const char *WHITE = " \t";
142   
143   char  *ptr = strtok((char *)sz, WHITE);
144
145         if (startsWith (ptr, "maxram")) {
146           char *maxRAM = strtok((char *)NULL, WHITE);
147
148                 if (maxRAM != (char *)NULL) {
149                   int maxRAMaddress;
150                   value *maxRAMVal;
151
152                         maxRAMVal = constVal(maxRAM);
153                         maxRAMaddress = (int)floatFromVal(maxRAMVal);
154                         pic16_setMaxRAM(maxRAMaddress);
155                 }
156         }
157         
158         if(startsWith(ptr, "stack")) {
159           char *stackPosS = strtok((char *)NULL, WHITE);
160           value *stackPosVal;
161           regs *reg;
162
163 //              fprintf(stderr, "Initializing stack pointer to 0x%x\n", (int)floatFromVal(constVal(stackPos)));
164                 stackPosVal = constVal( stackPosS );
165                 stackPos = (unsigned int)floatFromVal( stackPosVal );
166
167                 reg=newReg(REG_SFR, PO_SFR_REGISTER, stackPos, "stack", 1, 0, NULL);
168                 addSet(&pic16_fix_udata, reg);
169                 
170                 initsfpnt = 1;          // force glue() to initialize stack/frame pointers */
171
172           return 0;
173         }
174         
175         if(startsWith(ptr, "code")) {
176           char *symname = strtok((char *)NULL, WHITE);
177           char *location = strtok((char *)NULL, WHITE);
178           absSym *absS;
179           value *addr;
180
181                 absS = Safe_calloc(1, sizeof(absSym));
182                 absS->name = Safe_strdup( symname );
183                 addr = constVal( location );
184                 absS->address = (unsigned int)floatFromVal( addr );
185
186                 addSet(&absSymSet, absS);
187                 fprintf(stderr, "%s:%d symbol %s will be placed in location 0x%06x in code memory\n",
188                         __FILE__, __LINE__, symname, absS->address);
189
190           return 0;
191         }         
192
193   return 1;
194 }
195
196 #define REP_UDATA       "--preplace-udata-with="
197
198 #define STACK_MODEL     "--pstack-model="
199 #define OPT_BANKSEL     "--obanksel="
200
201 #define ALT_ASM         "--asm="
202 #define ALT_LINK        "--link="
203
204 char *alt_asm=NULL;
205 char *alt_link=NULL;
206
207 extern int pic16_debug_verbose;
208 extern int pic16_ralloc_debug;
209 extern int pic16_pcode_verbose;
210
211 OPTION pic16_optionsTable[]= {
212         { 0,    "--pno-banksel",        &pic16_options.no_banksel,      "do not generate BANKSEL assembler directives"},
213         { 0,    OPT_BANKSEL,            NULL,                           "set banksel optimization level (default=0 no)"},
214         { 0,    "--pomit-config-words", &pic16_options.omit_configw,    "omit the generation of configuration words"},
215         { 0,    "--pomit-ivt",          &pic16_options.omit_ivt,        "omit the generation of the Interrupt Vector Table"},
216         { 0,    "--pleave-reset-vector",&pic16_options.leave_reset,     "when omitting IVT leave RESET vector"},
217         { 0,    STACK_MODEL,    NULL,   "use stack model 'small' (default) or 'large'"},
218
219         { 0,    "--debug-xtra",         &pic16_debug_verbose,   "show more debug info in assembly output"},
220         { 0,    "--debug-ralloc",       &pic16_ralloc_debug,    "dump register allocator debug file *.d"},
221         { 0,    "--pcode-verbose",      &pic16_pcode_verbose,   "dump pcode related info"},
222                 
223         { 0,    REP_UDATA,      NULL,   "Place udata variables at another section: udata_acs, udata_ovr, udata_shr"},
224
225         { 0,    ALT_ASM,        NULL,   "Use alternative assembler"},
226         { 0,    ALT_LINK,       NULL,   "Use alternative linker"},
227
228         { 0,    NULL,           NULL,   NULL}
229         };
230
231
232 #define ISOPT(str)      !strncmp(argv[ *i ], str, strlen(str) )
233
234 extern char *getStringArg(const char *,  char **, int *, int);
235 extern int getIntArg(const char *, char **, int *, int);
236
237 static bool
238 _pic16_parseOptions (int *pargc, char **argv, int *i)
239 {
240   int j=0;
241   char *stkmodel;
242   
243   /* TODO: allow port-specific command line options to specify
244    * segment names here.
245    */
246         /* check for arguments that have associated an integer variable */
247         while(pic16_optionsTable[j].pparameter) {
248                 if(ISOPT( pic16_optionsTable[j].longOpt )) {
249                         (*pic16_optionsTable[j].pparameter)++;
250                         return TRUE;
251                 }
252                 j++;
253         }
254
255
256         if(ISOPT(STACK_MODEL)) {
257                 stkmodel = getStringArg(STACK_MODEL, argv, i, *pargc);
258                 if(STRCASECMP(stkmodel, "small"))pic16_options.stack_model = 0;
259                 else if(STRCASECMP(stkmodel, "large"))pic16_options.stack_model = 1;
260                 else {
261                         fprintf(stderr, "Unknown stack model: %s", stkmodel);
262                         exit(-1);
263                 }
264                 return TRUE;
265         }
266
267         if(ISOPT(OPT_BANKSEL)) {
268                 pic16_options.opt_banksel = getIntArg(OPT_BANKSEL, argv, i, *pargc);
269                 return TRUE;
270         }
271
272         if(ISOPT(REP_UDATA)) {
273                 pic16_sectioninfo.at_udata = Safe_strdup(getStringArg(REP_UDATA, argv, i, *pargc));
274                 return TRUE;
275         }
276         
277         if(ISOPT(ALT_ASM)) {
278                 alt_asm = Safe_strdup(getStringArg(ALT_ASM, argv, i, *pargc));
279                 return TRUE;
280         }
281         
282         if(ISOPT(ALT_LINK)) {
283                 alt_link = Safe_strdup(getStringArg(ALT_LINK, argv, i, *pargc));
284                 return TRUE;
285         }
286
287
288   return FALSE;
289 }
290
291 static void _pic16_initPaths(void)
292 {
293   char pic16incDir[512];
294   char pic16libDir[512];
295   set *pic16incDirsSet;
296   set *pic16libDirsSet;
297   char devlib[512];
298
299         setMainValue("mcu", pic16->name[2] );
300         addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
301
302         sprintf(pic16incDir, "%s%cpic16", INCLUDE_DIR_SUFFIX, DIR_SEPARATOR_CHAR);
303         sprintf(pic16libDir, "%s%cpic16", LIB_DIR_SUFFIX, DIR_SEPARATOR_CHAR);
304
305         if(!options.nostdinc) {
306                 /* setup pic16 include directory */
307                 pic16incDirsSet = appendStrSet(dataDirsSet, NULL, pic16incDir);
308                 mergeSets(&includeDirsSet, pic16incDirsSet);
309         }
310         
311         if(!options.nostdlib) {
312                 /* setup pic16 library directory */
313                 pic16libDirsSet = appendStrSet(dataDirsSet, NULL, pic16libDir);
314                 mergeSets(&libDirsSet, pic16libDirsSet);
315         
316                 /* now add the library for the device */
317                 sprintf(devlib, "%s.lib", pic16->name[2]);
318                 addSet(&libFilesSet, Safe_strdup(devlib));
319         }
320 }
321
322
323 /* forward declarations */
324 extern const char *pic16_linkCmd[];
325 extern const char *pic16_asmCmd[];
326
327 static void
328 _pic16_finaliseOptions (void)
329 {
330         port->mem.default_local_map = data;
331         port->mem.default_globl_map = data;
332
333         /* peepholes are disabled for the time being */
334         options.nopeep = 1;
335
336         options.all_callee_saves = 1;           // always callee saves
337 //      options.float_rent = 1;
338 //      options.intlong_rent = 1;
339         
340
341         if(alt_asm && strlen(alt_asm))
342                 pic16_asmCmd[0] = alt_asm;
343         
344         if(alt_link && strlen(alt_link))
345                 pic16_linkCmd[0] = alt_link;
346 }
347
348
349 /* all the rest is commented ifdef'd out */
350 #if 0
351   /* Hack-o-matic: if we are using the flat24 model,
352    * adjust pointer sizes.
353    */
354   if (options.model == MODEL_FLAT24)
355     {
356
357       fprintf (stderr, "*** WARNING: you should use the '-mds390' option "
358                "for DS80C390 support. This code generator is "
359                "badly out of date and probably broken.\n");
360
361       port->s.fptr_size = 3;
362       port->s.gptr_size = 4;
363       port->stack.isr_overhead++;       /* Will save dpx on ISR entry. */
364 #if 1
365       port->stack.call_overhead++;      /* This acounts for the extra byte 
366                                          * of return addres on the stack.
367                                          * but is ugly. There must be a 
368                                          * better way.
369                                          */
370 #endif
371       fReturn = fReturn390;
372       fReturnSize = 5;
373     }
374
375   if (options.model == MODEL_LARGE)
376     {
377       port->mem.default_local_map = xdata;
378       port->mem.default_globl_map = xdata;
379     }
380   else
381     {
382       port->mem.default_local_map = data;
383       port->mem.default_globl_map = data;
384     }
385
386   if (options.stack10bit)
387     {
388       if (options.model != MODEL_FLAT24)
389         {
390           fprintf (stderr,
391                    "*** warning: 10 bit stack mode is only supported in flat24 model.\n");
392           fprintf (stderr, "\t10 bit stack mode disabled.\n");
393           options.stack10bit = 0;
394         }
395       else
396         {
397           /* Fixup the memory map for the stack; it is now in
398            * far space and requires a FPOINTER to access it.
399            */
400           istack->fmap = 1;
401           istack->ptrType = FPOINTER;
402         }
403     }
404 #endif
405
406
407 static void
408 _pic16_setDefaultOptions (void)
409 {
410         /* initialize to defaults section locations, names and addresses */
411         pic16_sectioninfo.at_udata      = "udata";
412
413         /* set pic16 port options to defaults */
414         pic16_options.no_banksel = 0;
415         pic16_options.opt_banksel = 0;
416         pic16_options.omit_configw = 0;
417         pic16_options.omit_ivt = 0;
418         pic16_options.leave_reset = 0;
419         pic16_options.stack_model = 0;                  /* 0 for 'small', 1 for 'large' */
420 }
421
422 static const char *
423 _pic16_getRegName (struct regs *reg)
424 {
425   if (reg)
426     return reg->name;
427   return "err";
428 }
429
430
431 #if 1
432 static  char *_pic16_mangleFunctionName(char *sz)
433 {
434 //      fprintf(stderr, "mangled function name: %s\n", sz);
435
436   return sz;
437 }
438 #endif
439
440
441 static void
442 _pic16_genAssemblerPreamble (FILE * of)
443 {
444   char *name = pic16_processor_base_name();
445
446         if(!name) {
447                 name = "p18f452";
448                 fprintf(stderr,"WARNING: No Pic has been selected, defaulting to %s\n",name);
449         }
450
451         fprintf (of, "\tlist\tp=%s\n",&name[1]);
452
453         if(!pic16_options.omit_configw) {
454                 pic16_emitConfigRegs(of);
455 #if 0           
456                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300001, pic16_getConfigWord(0x300001));
457                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300002, pic16_getConfigWord(0x300002));
458                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300003, pic16_getConfigWord(0x300003));
459                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300005, pic16_getConfigWord(0x300005));
460                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300006, pic16_getConfigWord(0x300006));
461                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300008, pic16_getConfigWord(0x300008));
462                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300009, pic16_getConfigWord(0x300009));
463                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000a, pic16_getConfigWord(0x30000a));
464                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000b, pic16_getConfigWord(0x30000b));
465                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000c, pic16_getConfigWord(0x30000c));
466                 fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000d, pic16_getConfigWord(0x30000d));
467 #endif
468         }
469         
470   fprintf (of, "\tradix dec\n");
471 }
472
473 /* Generate interrupt vector table. */
474 static int
475 _pic16_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
476 {
477 #if 1
478         /* PIC18F family has only two interrupts, the high and the low
479          * priority interrupts, which reside at 0x0008 and 0x0018 respectively - VR */
480
481         if((!pic16_options.omit_ivt) || (pic16_options.omit_ivt && pic16_options.leave_reset)) {
482                 fprintf(of, "; RESET vector\n");
483                 fprintf(of, "\tgoto\t__sdcc_gsinit_startup\n");
484         }
485         
486         if(!pic16_options.omit_ivt) {
487                 fprintf(of, "\tres 4\n");
488
489
490                 fprintf(of, "; High priority interrupt vector 0x0008\n");
491                 if(interrupts[1]) {
492                         fprintf(of, "\tgoto\t%s\n", interrupts[1]->rname);
493                         fprintf(of, "\tres\t12\n"); 
494                 } else {
495                         fprintf(of, "\tretfie\n");
496                         fprintf(of, "\tres\t14\n");
497                 }
498
499                 fprintf(of, "; Low priority interrupt vector 0x0018\n");
500                 if(interrupts[2]) {
501                         fprintf(of, "\tgoto\t%s\n", interrupts[2]->rname);
502                 } else {
503                         fprintf(of, "\tretfie\n");
504                 }
505         }
506 #endif
507   return TRUE;
508 }
509
510 /* return True if the port can handle the type,
511  * False to convert it to function call */
512 static bool _hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right)
513 {
514 //      fprintf(stderr,"checking for native mult for %c (size: %d)\n", ic->op, getSize(OP_SYMBOL(IC_RESULT(ic))->type));
515
516 #if 1
517         /* multiplication is fixed */
518         /* support mul for char/int/long */
519         if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) <= 4)
520                 && (ic->op == '*'))return TRUE;
521 #endif
522
523 #if 0
524         /* support div for char/int/long */
525         if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) <= 0)
526                 && (ic->op == '/'))return TRUE;
527 #endif
528         
529   return FALSE;
530 }
531
532
533 #if 0
534 /* Do CSE estimation */
535 static bool cseCostEstimation (iCode *ic, iCode *pdic)
536 {
537 //    operand *result = IC_RESULT(ic);
538 //    sym_link *result_type = operandType(result);
539
540
541         /* VR -- this is an adhoc. Put here after conversation
542          * with Erik Epetrich */
543
544         if(ic->op == '<'
545                 || ic->op == '>'
546                 || ic->op == EQ_OP) {
547
548                 fprintf(stderr, "%d %s\n", __LINE__, __FUNCTION__);
549           return 0;
550         }
551
552 #if 0
553     /* if it is a pointer then return ok for now */
554     if (IC_RESULT(ic) && IS_PTR(result_type)) return 1;
555
556     /* if bitwise | add & subtract then no since mcs51 is pretty good at it
557        so we will cse only if they are local (i.e. both ic & pdic belong to
558        the same basic block */
559     if (IS_BITWISE_OP(ic) || ic->op == '+' || ic->op == '-') {
560         /* then if they are the same Basic block then ok */
561         if (ic->eBBlockNum == pdic->eBBlockNum) return 1;
562         else return 0;
563     }
564 #endif
565
566     /* for others it is cheaper to do the cse */
567     return 1;
568 }
569 #endif
570
571
572 /* Indicate which extended bit operations this port supports */
573 static bool
574 hasExtBitOp (int op, int size)
575 {
576   if (op == RRC
577       || op == RLC
578       /* || op == GETHBIT */ /* GETHBIT doesn't look complete for PIC */
579      )
580     return TRUE;
581   else
582     return FALSE;
583 }
584
585 /* Indicate the expense of an access to an output storage class */
586 static int
587 oclsExpense (struct memmap *oclass)
588 {
589   /* The IN_FARSPACE test is compatible with historical behaviour, */
590   /* but I don't think it is applicable to PIC. If so, please feel */
591   /* free to remove this test -- EEP */
592   if (IN_FARSPACE(oclass))
593     return 1;
594     
595   return 0;
596 }
597
598 /** $1 is always the basename.
599     $2 is always the output file.
600     $3 -L path and -l libraries
601     $l is the list of extra options that should be there somewhere...
602     MUST be terminated with a NULL.
603 */
604 const char *pic16_linkCmd[] =
605 {
606   "gplink", "$3", "\"$1.o\"", "-o \"$2\"", "$l", NULL
607 };
608
609
610
611 /** $1 is always the basename.
612     $2 is always the output file.
613     $3 varies (nothing currently)
614     $l is the list of extra options that should be there somewhere...
615     MUST be terminated with a NULL.
616 */
617 const char *pic16_asmCmd[] =
618 {
619   "gpasm", "$l", "$3", "-c", "\"$1.asm\"", "-o \"$2\"", NULL
620
621 };
622
623 /* Globals */
624 PORT pic16_port =
625 {
626   TARGET_ID_PIC16,
627   "pic16",
628   "MCU PIC16",                  /* Target name */
629   "p18f452",                    /* Processor */
630   {
631     pic16glue,
632     TRUE,                       /* Emit glue around main */
633     MODEL_SMALL | MODEL_LARGE | MODEL_FLAT24,
634     MODEL_SMALL
635   },
636   {
637     pic16_asmCmd,               /* assembler command and arguments */
638     NULL,                       /* alternate macro based form */
639     "-g",                       /* arguments for debug mode */
640     NULL,                       /* arguments for normal mode */
641     0,                          /* print externs as global */
642     ".asm",                     /* assembler file extension */
643     NULL                        /* no do_assemble function */
644   },
645   {
646     pic16_linkCmd,              /* linker command and arguments */
647     NULL,                       /* alternate macro based form */
648     NULL,                       /* no do_link function */
649     ".o",                       /* extension for object files */
650     0                           /* no need for linker file */
651   },
652   {
653     _defaultRules
654   },
655   {
656         /* Sizes */
657     1,          /* char */
658     2,          /* short */
659     2,          /* int */
660     4,          /* long */
661     2,          /* ptr */
662     3,          /* fptr, far pointers (see Microchip) */
663     2,          /* gptr */
664     1,          /* bit */
665     4,          /* float */
666     4           /* max */
667   },
668   {
669     "XSEG    (XDATA)",          // xstack
670     "STACK   (DATA)",           // istack
671     "CSEG    (CODE)",           // code
672     "DSEG    (DATA)",           // data
673     "ISEG    (DATA)",           // idata
674     "XSEG    (XDATA)",          // xdata
675     "BSEG    (BIT)",            // bit
676     "RSEG    (DATA)",           // reg
677     "GSINIT  (CODE)",           // static
678     "OSEG    (OVR,DATA)",       // overlay
679     "GSFINAL (CODE)",           // post static
680     "HOME        (CODE)",       // home
681     NULL,                       // xidata
682     NULL,                       // xinit
683     NULL,                       // default location for auto vars
684     NULL,                       // default location for global vars
685     1                           // code is read only 1=yes
686   },
687   {
688     NULL,               /* genExtraAreaDeclaration */
689     NULL                /* genExatrAreaLinkOptions */
690   },
691   {
692         /* stack related information */
693     -1,                 /* -1 stack grows downwards, +1 upwards */
694     1,                  /* extra overhead when calling between banks */
695     4,                  /* extra overhead when the function is an ISR */
696     1,                  /* extra overhead for a function call */
697     1,                  /* re-entrant space */
698     0                   /* 'banked' call overhead, mild overlap with bank_overhead */
699   },
700     /* pic16 has an 8 bit mul */
701   {
702      0, -1
703   },
704   {
705     pic16_emitDebuggerSymbol
706   },
707   "_",
708   _pic16_init,
709   _pic16_parseOptions,
710   pic16_optionsTable,
711   _pic16_initPaths,
712   _pic16_finaliseOptions,
713   _pic16_setDefaultOptions,
714   pic16_assignRegisters,
715   _pic16_getRegName,
716   _pic16_keywords,
717   _pic16_genAssemblerPreamble,
718   NULL,                         /* no genAssemblerEnd */
719   _pic16_genIVT,
720   NULL, // _pic16_genXINIT
721   NULL,                         /* genInitStartup */
722   _pic16_reset_regparm,
723   _pic16_regparm,
724   _process_pragma,                              /* process a pragma */
725   _pic16_mangleFunctionName,                            /* mangles function name */
726   _hasNativeMulFor,
727   hasExtBitOp,                  /* hasExtBitOp */
728   oclsExpense,                  /* oclsExpense */
729   FALSE,                        
730   TRUE,                         /* little endian */
731   0,                            /* leave lt */
732   0,                            /* leave gt */
733   1,                            /* transform <= to ! > */
734   1,                            /* transform >= to ! < */
735   1,                            /* transform != to !(a == b) */
736   0,                            /* leave == */
737   FALSE,                        /* No array initializer support. */
738   0,    //cseCostEstimation,            /* !!!no CSE cost estimation yet */
739   NULL,                         /* no builtin functions */
740   GPOINTER,                     /* treat unqualified pointers as "generic" pointers */
741   1,                            /* reset labelKey to 1 */
742   1,                            /* globals & local static allowed */
743   PORT_MAGIC
744 };