- lastHexAddr = addr;
- fprintf(ofp, ":%02X%04X00", chksum, addr);
- chksum += (addr >> 8) + (addr & 0xff);
- for (i = rtvalIndex, bytes = 0; i < rtcnt; i++) {
- if (rtflg[i]) {
- fprintf(ofp, "%02X", rtval[i]);
- chksum += rtval[i];
- if (addr + ++bytes > 0xffff) {
- if (rflag) {
- fprintf(ofp, "%02X\n", (0-chksum) & 0xff);
- overrun = hexPageOverrun + 1;
- ihxEntendedLinearAddress(lastExtendedAddress + overrun);
- hexPageOverrun = overrun;
- hexRecord(0, i + 1);
- return;
- } else {
- fprintf(stderr,
- "warning: extended linear address encountered; "
- "you probably want the -r flag.\n");
- }
- }
- }
- }
- fprintf(ofp, "%02X\n", (0-chksum) & 0xff);
+ lastHexAddr = addr;
+ fprintf(ofp, ":%02X%04X00", chksum, addr);
+ chksum += (addr >> 8) + (addr & 0xff);
+ for (i = rtvalIndex, bytes = 0; i < rtcnt; i++) {
+ if (rtflg[i]) {
+ fprintf(ofp, "%02X", rtval[i]);
+ chksum += rtval[i];
+ if (addr + ++bytes > 0xffff) {
+ if (rflag) {
+ fprintf(ofp, "%02X\n", (0-chksum) & 0xff);
+ overrun = hexPageOverrun + 1;
+ ihxEntendedLinearAddress(lastExtendedAddress + overrun);
+ hexPageOverrun = overrun;
+ hexRecord(0, i + 1);
+ return;
+ } else {
+ fprintf(stderr,
+ "warning: extended linear address encountered; "
+ "you probably want the -r flag.\n");
+ }
+ }
+ }
+ }
+ fprintf(ofp, "%02X\n", (0-chksum) & 0xff);