X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fds390%2Fmain.c;h=dad9b7488824e013267a6e0fe56f8f2e80ac6313;hb=b39b9a851fa0122a6fb71bb1e40badc28f6192f0;hp=65af1a65c5f4c308b656b5d64cf2706c8dbcdbe6;hpb=3270f325cf2270f7656186324330c4ee3b9c9515;p=fw%2Fsdcc diff --git a/src/ds390/main.c b/src/ds390/main.c index 65af1a65..dad9b748 100644 --- a/src/ds390/main.c +++ b/src/ds390/main.c @@ -32,6 +32,8 @@ static char *_ds390_keywords[] = "pdata", "reentrant", "sfr", + "sfr16", + "sfr32", "sbit", "using", "xdata", @@ -59,7 +61,7 @@ static builtins __ds390_builtins[] = { { "__builtin_memcmp_c2x","c",3,{"cx*","cp*","i"}}, /* void __builtin_memcmp_c2x (xdata char *,code char *,int) */ { NULL , NULL,0, {NULL}} /* mark end of table */ }; -void ds390_assignRegisters (eBBlock ** ebbs, int count); +void ds390_assignRegisters (ebbIndex * ebbi); static int regParmFlg = 0; /* determine if we can register a parameter */ @@ -70,14 +72,16 @@ _ds390_init (void) } static void -_ds390_reset_regparm () +_ds390_reset_regparm (void) { regParmFlg = 0; } static int -_ds390_regparm (sym_link * l) +_ds390_regparm (sym_link * l, bool reentrant) { + if (IS_SPEC(l) && (SPEC_NOUN(l) == V_BIT)) + return 0; if (options.parms_in_bank1 == 0) { /* simple can pass only the first parameter in a register */ if (regParmFlg) @@ -235,8 +239,25 @@ _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) if (options.model != MODEL_FLAT24) { - /* Let the default code handle it. */ - return FALSE; + fprintf (of, "\tljmp\t__sdcc_gsinit_startup\n"); + + /* now for the other interrupts */ + for (i = 0; i < maxInterrupts; i++) + { + if (interrupts[i]) + { + fprintf (of, "\tljmp\t%s\n", interrupts[i]->rname); + if ( i != maxInterrupts - 1 ) + fprintf (of, "\t.ds\t5\n"); + } + else + { + fprintf (of, "\treti\n"); + if ( i != maxInterrupts - 1 ) + fprintf (of, "\t.ds\t7\n"); + } + } + return TRUE; } fprintf (of, "\tajmp\t__reset_vect\n"); @@ -840,12 +861,17 @@ PORT ds390_port = /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ 1, 2, 2, 4, 1, 2, 3, 1, 4, 4 }, + + /* tags for generic pointers */ + { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ + { "XSEG (XDATA)", "STACK (DATA)", "CSEG (CODE)", "DSEG (DATA)", "ISEG (DATA)", + "PSEG (PAG,XDATA)", "XSEG (XDATA)", "BSEG (BIT)", "RSEG (DATA)", @@ -853,8 +879,10 @@ PORT ds390_port = "OSEG (OVR,DATA)", "GSFINAL (CODE)", "HOME (CODE)", - "XISEG (XDATA)", // initialized xdata - "XINIT (CODE)", // a code copy of xiseg + "XISEG (XDATA)", // initialized xdata + "XINIT (CODE)", // a code copy of xiseg + "CONST (CODE)", // const_name - const data (code or not) + "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not) NULL, NULL, 1 @@ -870,6 +898,14 @@ PORT ds390_port = { ds390_emitDebuggerSymbol }, + { + 255/4, /* maxCount */ + 4, /* sizeofElement */ + {8,12,20}, /* sizeofMatchJump[] */ + {10,14,22}, /* sizeofRangeCompare[] */ + 4, /* sizeofSubtract */ + 7, /* sizeofDispatch */ + }, "_", _ds390_init, _ds390_parseOptions, @@ -975,7 +1011,7 @@ static void _tininative_finaliseOptions (void) static int _tininative_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) { - return 1; + return TRUE; } static void _tininative_genAssemblerPreamble (FILE * of) { @@ -1143,21 +1179,27 @@ PORT tininative_port = /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ 1, 2, 2, 4, 1, 3, 3, 1, 4, 4 }, + /* tags for generic pointers */ + { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ + { "XSEG (XDATA)", "STACK (DATA)", "CSEG (CODE)", "DSEG (DATA)", "ISEG (DATA)", + "PSEG (PAG,XDATA)", "XSEG (XDATA)", "BSEG (BIT)", "RSEG (DATA)", "GSINIT (CODE)", "OSEG (OVR,DATA)", "GSFINAL (CODE)", - "HOME (CODE)", + "HOME (CODE)", NULL, NULL, + "CONST (CODE)", // const_name - const data (code or not) + "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not) NULL, NULL, 1 @@ -1173,6 +1215,14 @@ PORT tininative_port = { ds390_emitDebuggerSymbol }, + { + 255/4, /* maxCount */ + 4, /* sizeofElement */ + {8,12,20}, /* sizeofMatchJump[] */ + {10,14,22}, /* sizeofRangeCompare[] */ + 4, /* sizeofSubtract */ + 7, /* sizeofDispatch */ + }, "", _tininative_init, _ds390_parseOptions, @@ -1361,12 +1411,17 @@ PORT ds400_port = /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ 1, 2, 2, 4, 1, 2, 3, 1, 4, 4 }, + + /* tags for generic pointers */ + { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ + { "XSEG (XDATA)", "STACK (DATA)", "CSEG (CODE)", "DSEG (DATA)", "ISEG (DATA)", + "PSEG (PAG,XDATA)", "XSEG (XDATA)", "BSEG (BIT)", "RSEG (DATA)", @@ -1376,6 +1431,8 @@ PORT ds400_port = "HOME (CODE)", "XISEG (XDATA)", // initialized xdata "XINIT (CODE)", // a code copy of xiseg + "CONST (CODE)", // const_name - const data (code or not) + "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not) NULL, NULL, 1 @@ -1391,6 +1448,14 @@ PORT ds400_port = { ds390_emitDebuggerSymbol }, + { + 255/4, /* maxCount */ + 4, /* sizeofElement */ + {8,12,20}, /* sizeofMatchJump[] */ + {10,14,22}, /* sizeofRangeCompare[] */ + 4, /* sizeofSubtract */ + 7, /* sizeofDispatch */ + }, "_", _ds390_init, _ds390_parseOptions,