X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=as%2Fmcs51%2Flkihx.c;h=461d56799f74290d5ac477691043d1b44e8968ad;hb=faf36532f8fe1cff757958cb6a222c141f1eeaa4;hp=2e52d94b8bc4ac5369ab51eb41ef59c1611f1683;hpb=aed2b39c46fcdfdd017adbf9e50c254efc5dea42;p=fw%2Fsdcc diff --git a/as/mcs51/lkihx.c b/as/mcs51/lkihx.c index 2e52d94b..461d5679 100644 --- a/as/mcs51/lkihx.c +++ b/as/mcs51/lkihx.c @@ -11,9 +11,6 @@ #include #include -//#if !defined(_MSC_VER) -//#include -//#endif #include "aslink.h" /*)Module lkihx.c @@ -108,7 +105,7 @@ VOID ihx(i) { register Addr_T chksum; - + int byte, bytes, address=0; if (i) { if (hilo == 0) { chksum = rtval[0]; @@ -120,16 +117,35 @@ 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); + fprintf(ofp, "%02X\n", (0-chksum) & 0xff); } else { fprintf(ofp, ":00000001FF\n"); } @@ -165,5 +181,5 @@ 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 + fprintf(ofp, ":02000004%04X%02X\n", a & 0xffff, (0-chksum) & 0xff); +}