X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fmcs51%2Fmain.c;h=eeef4b25aecb83a377a4e42ba084d3086cb50c0f;hb=c18a4cebda9c0f424821db515901d7357ea233a7;hp=b1676b91ea18d723d6c8503fe254b967bba688d5;hpb=7df05163e42276aeed7d7a937f241546b215b1c7;p=fw%2Fsdcc diff --git a/src/mcs51/main.c b/src/mcs51/main.c index b1676b91..eeef4b25 100644 --- a/src/mcs51/main.c +++ b/src/mcs51/main.c @@ -20,10 +20,11 @@ static char _defaultRules[] = static OPTION _mcs51_options[] = { - { 0, OPTION_STACK_SIZE, NULL, "Tells the linker to allocate this space for stack"}, + { 0, OPTION_STACK_SIZE, &options.stack_size, "Tells the linker to allocate this space for stack", CLAT_INTEGER }, { 0, "--parms-in-bank1", &options.parms_in_bank1, "use Bank1 for parameter passing"}, { 0, "--pack-iram", NULL, "Tells the linker to pack variables in internal ram (default)"}, { 0, "--no-pack-iram", &options.no_pack_iram, "Tells the linker not to pack variables in internal ram"}, + { 0, "--acall-ajmp", &options.acall_ajmp, "Use acall/ajmp instead of lcall/ljmp" }, { 0, NULL } }; @@ -124,11 +125,6 @@ _mcs51_parseOptions (int *pargc, char **argv, int *i) /* TODO: allow port-specific command line options to specify * segment names here. */ - if (!strcmp (argv[*i], OPTION_STACK_SIZE)) - { - options.stack_size = getIntArg(OPTION_STACK_SIZE, argv, i, *pargc); - return TRUE; - } return FALSE; } @@ -196,16 +192,17 @@ _mcs51_genIVT (struct dbuf_s * oBuf, symbol ** interrupts, int maxInterrupts) { int i; - dbuf_printf (oBuf, "\tljmp\t__sdcc_gsinit_startup\n"); + dbuf_printf (oBuf, "\t%cjmp\t__sdcc_gsinit_startup\n", options.acall_ajmp?'a':'l'); + if((options.acall_ajmp)&&(maxInterrupts)) dbuf_printf (oBuf, "\t.ds\t1\n"); /* now for the other interrupts */ for (i = 0; i < maxInterrupts; i++) { if (interrupts[i]) { - dbuf_printf (oBuf, "\tljmp\t%s\n", interrupts[i]->rname); + dbuf_printf (oBuf, "\t%cjmp\t%s\n", options.acall_ajmp?'a':'l', interrupts[i]->rname); if ( i != maxInterrupts - 1 ) - dbuf_printf (oBuf, "\t.ds\t5\n"); + dbuf_printf (oBuf, "\t.ds\t%d\n", options.acall_ajmp?6:5); } else {