X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic%2Fmain.c;h=d0cd1a33f00c2e1ad9e36b93b721743caf9a7aee;hb=7489be486a8008b25b31654823bd7ac115d7ad85;hp=ebc5839bde0d96d6aa83d46938e723937e7f276a;hpb=1e268ec9106bf4b907eff98c705e11689c9dcb64;p=fw%2Fsdcc diff --git a/src/pic/main.c b/src/pic/main.c index ebc5839b..d0cd1a33 100644 --- a/src/pic/main.c +++ b/src/pic/main.c @@ -7,7 +7,8 @@ #include "common.h" #include "main.h" #include "ralloc.h" -#include "gen.h" +//#include "gen.h" + static char _defaultRules[] = { @@ -42,6 +43,7 @@ static char *_pic14_keywords[] = NULL }; +void pCodeInitRegisters(void); void pic14_assignRegisters (eBBlock ** ebbs, int count); @@ -51,6 +53,7 @@ static void _pic14_init (void) { asm_addTree (&asm_asxxxx_mapping); + pCodeInitRegisters(); } static void @@ -64,10 +67,10 @@ _pic14_regparm (sym_link * l) { /* for this processor it is simple can pass only the first parameter in a register */ - if (regParmFlg) - return 0; + //if (regParmFlg) + // return 0; - regParmFlg = 1; + regParmFlg++;// = 1; return 1; } @@ -83,6 +86,9 @@ _pic14_parseOptions (int *pargc, char **argv, int *i) static void _pic14_finaliseOptions (void) { + + port->mem.default_local_map = data; + port->mem.default_globl_map = data; #if 0 /* Hack-o-matic: if we are using the flat24 model, * adjust pointer sizes. @@ -156,9 +162,9 @@ _pic14_getRegName (struct regs *reg) static void _pic14_genAssemblerPreamble (FILE * of) { - fprintf (of, "\tlist\tp=16c84\n"); + fprintf (of, "\tlist\tp=16f877\n"); fprintf (of, "\t__config _wdt_off\n"); - fprintf (of, "\ninclude \"p16c84.inc\"\n"); + fprintf (of, "\ninclude \"p16f877.inc\"\n"); } /* Generate interrupt vector table. */ @@ -222,14 +228,17 @@ PORT pic_port = { _asmCmd, NULL, + NULL, NULL, //"-plosgffc", /* Options with debug */ //"-plosgff", /* Options without debug */ - 0 + 0, + ".asm" }, { _linkCmd, NULL, + NULL, ".rel" }, { @@ -237,7 +246,7 @@ PORT pic_port = }, { /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ - 1, 1, 2, 4, 1, 2, 1, 1, 4, 4 + 1, 2, 2, 4, 1, 2, 1, 1, 4, 4 /* TSD - I changed the size of gptr from 3 to 1. However, it should be 2 so that we can accomodate the PIC's with 4 register banks (like the 16f877) @@ -265,7 +274,7 @@ PORT pic_port = }, /* pic14 has an 8 bit mul */ { - 1, 0 + 1, -1 }, "_", _pic14_init, @@ -280,6 +289,8 @@ PORT pic_port = _pic14_reset_regparm, _pic14_regparm, NULL, + NULL, + NULL, FALSE, 0, /* leave lt */ 0, /* leave gt */ @@ -287,5 +298,8 @@ PORT pic_port = 1, /* transform >= to ! < */ 1, /* transform != to !(a == b) */ 0, /* leave == */ + FALSE, /* No array initializer support. */ + 0, /* no CSE cost estimation yet */ + NULL, /* no builtin functions */ PORT_MAGIC };