From: johanknol Date: Wed, 7 Feb 2001 16:14:02 +0000 (+0000) Subject: a first small step to cross the 64k barrier X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7b297ab72b9a2ddf181139a3cd2fb0027b59cf2b;p=fw%2Fsdcc a first small step to cross the 64k barrier git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@606 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/as/mcs51/lkihx.c b/as/mcs51/lkihx.c index 2e52d94b..6058fa49 100644 --- a/as/mcs51/lkihx.c +++ b/as/mcs51/lkihx.c @@ -108,7 +108,7 @@ VOID ihx(i) { register Addr_T chksum; - + int byte, bytes, address=0; if (i) { if (hilo == 0) { chksum = rtval[0]; @@ -120,14 +120,33 @@ ihx(i) chksum++; } fprintf(ofp, ":%02X", chksum); + // how much bytes? + for (i=0, bytes=0; i0xffff) { + fprintf (stderr, "64k boundary cross at %04x\n", address); + } + break; + } + fprintf(ofp, "%02X", rtval[i]); + chksum += rtval[i]; + byte++; + } + if (i == 1) { + fprintf(ofp, "00"); + } } fprintf(ofp, "%02X\n", (-chksum) & 0xff); } else { @@ -166,4 +185,4 @@ ihxEntendedLinearAddress(Addr_T a) chksum = 2 + 4 + (a & 0xff) + ((a >> 8) & 0xff); fprintf(ofp, ":02000004%04X%02X\n", a & 0xffff, (-chksum) & 0xff); -} \ No newline at end of file +} diff --git a/as/mcs51/lkmain.c b/as/mcs51/lkmain.c index 8abd00f4..44a8f13f 100644 --- a/as/mcs51/lkmain.c +++ b/as/mcs51/lkmain.c @@ -420,7 +420,7 @@ link_main() sdp.s_area = NULL; sdp.s_areax = NULL; sdp.s_addr = 0; - lastExtendedAddress = -1; + // jwk lastExtendedAddress = -1; break; case 'M': diff --git a/as/mcs51/lkrloc.c b/as/mcs51/lkrloc.c index f6ac50bf..7a9dbcfb 100644 --- a/as/mcs51/lkrloc.c +++ b/as/mcs51/lkrloc.c @@ -52,7 +52,7 @@ /* Global which holds the upper 16 bits of the last 32 bit area adress * output. Useful only for iHex mode. */ -int lastExtendedAddress; +int lastExtendedAddress=-1; /*)Function VOID reloc(c) * @@ -536,10 +536,12 @@ relr() if (extendedAddress != lastExtendedAddress) { - #if 0 - printf("output extended linear address record 0x%x\n", - extendedAddress); - #endif +#if 1 // jwk + if (lastExtendedAddress!=-1) { + printf("output extended linear address record 0x%x 0x%x\n", + extendedAddress, lastExtendedAddress); + } +#endif if (rflag) {