X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=as%2Fmcs51%2Fasmain.c;h=0f40fe8461ebac26dbdbb0318c40cf5da7fb5220;hb=fe9b00fb61dc71f48cb6416e608b5b6882bbc35f;hp=79934663b7702ae7aeeff89cca18c99ac893c8f3;hpb=be3db2fc38c037d646f1f32573765d7c154da1c3;p=fw%2Fsdcc diff --git a/as/mcs51/asmain.c b/as/mcs51/asmain.c index 79934663..0f40fe84 100644 --- a/as/mcs51/asmain.c +++ b/as/mcs51/asmain.c @@ -17,6 +17,7 @@ #include #include "asm.h" +#include "strcmpi.h" /*)Module asmain.c * @@ -129,7 +130,7 @@ * VOID diag() assubr.c * VOID err() assubr.c * int fprintf() c-library - * int getline() aslex.c + * int as_getline() aslex.c * VOID list() aslist.c * VOID lstsym() aslist.c * VOID minit() ___mch.c @@ -288,7 +289,7 @@ char *argv[]; dot.s_area = &dca; symp = ˙ minit(); - while (getline()) { + while (as_getline()) { cp = cb; cpt = cbt; ep = eb; @@ -374,7 +375,7 @@ int i; if (i) { // remove output file printf ("removing %s\n", relFile); - unlink(relFile); + remove(relFile); } exit(i); } @@ -555,7 +556,7 @@ loop: goto loop; } /* - * If the first character is a letter then assume a lable, + * If the first character is a letter then assume a label, * symbol, assembler directive, or assembler mnemonic is * being processed. */ @@ -799,7 +800,7 @@ loop: break; case S_MODUL: - getst(id, -1); + getst(id, getnb()); // a module can start with a digit if (pass == 0) { if (module[0]) { err('m'); @@ -810,6 +811,20 @@ loop: lmode = SLIST; break; + case S_OPTSDCC: + p = optsdcc; + if ((c = getnb()) != 0) { + do { + if (p < &optsdcc[NINPUT-1]) + *p++ = c; + } while ((c = get()) != 0); + } + *p = 0; + unget(c); + lmode = SLIST; + /*if (pass == 0) printf("optsdcc=%s\n", optsdcc);*/ + break; + case S_GLOBL: do { getid(id, -1); @@ -860,7 +875,7 @@ loop: case S_ORG: if (dot.s_area->a_flag & A_ABS) { outall(); - laddr = dot.s_addr = absexpr(); + laddr = dot.s_addr = dot.s_org = absexpr(); } else { err('o'); } @@ -931,7 +946,7 @@ loop: { getst(id, -1); - if (!strcmpi(id, "on")) + if (!as_strcmpi(id, "on")) { /* Quick sanity check: size of * Addr_T must be at least 24 bits. @@ -949,7 +964,7 @@ loop: flat24Mode = 1; } } - else if (!strcmpi(id, "off")) + else if (!as_strcmpi(id, "off")) { flat24Mode = 0; } @@ -1118,7 +1133,11 @@ register struct area *nap; if (oap->a_size < dot.s_addr) { oap->a_size = dot.s_addr; } + } else if (oap->a_flag & A_ABS) { + oap->a_addr = dot.s_org; + oap->a_size = dot.s_addr - dot.s_org; } else { + oap->a_addr = 0; oap->a_size = dot.s_addr; } if (nap->a_flag & A_OVR) {