* as/link/mcs51/lkihx.c (hexRecord): bugfix do not insert extended address
[fw/sdcc] / as / link / mcs51 / lkihx.c
index cce29ff4ec16de338f4a48e4181062af76b42ddf..bfe383e300f0d99ca9be668edfc97d005218c5bc 100644 (file)
@@ -143,7 +143,8 @@ hexRecord(unsigned addr, int rtvalIndex)
     if (chksum == 0)
         return;         // nothing to output
 
-    if ( (lastHexAddr > addr) && (rflag) ) {
+    /* Is this record in the same bank as previous? */
+    if ( ((lastHexAddr>>16) != (addr>>16)) && (rflag) ) {
         overrun = hexPageOverrun + 1;
         ihxExtendedLinearAddress(lastExtendedAddress + overrun);
         hexPageOverrun = overrun;