Menu

#3653 6502 no error when OSEG overflow in ZP

open
nobody
None
MOS6502
5
2023-12-08
2023-09-22
Under4Mhz
No

Zero Page overflow link error is not being reported in cases when the ZP is under 256 but the OSEG is over.

From what I can tell, OSEG needs to be in the 6502 ZP area as well, but there's no error when it's not. (I'm not sure on the details, but I think the compiler should error in the below case).

So the following game links successfully, but it fails to run:

ZP                                  00000020    000000E2 =         226. bytes (REL,CON,PAG)

      Value  Global                              Global Defined In Module
      -----  --------------------------------   ------------------------
     00000020  __TEMP                             vexed
     00000028  __DPTR                             vexed
     000000F6  ___SDCC_m6502_ret0                 _ret
     000000F7  ___SDCC_m6502_ret1                 _ret
     000000F8  ___SDCC_m6502_ret2                 _ret
     000000F9  ___SDCC_m6502_ret3                 _ret
     000000FA  ___SDCC_m6502_ret4                 _ret
     000000FB  ___SDCC_m6502_ret5                 _ret
     000000FC  ___SDCC_m6502_ret6                 _ret
     000000FD  ___SDCC_m6502_ret7                 _ret

...

OSEG                                00000102    00000004 =           4. bytes (REL,OVR,PAG)

      Value  Global                              Global Defined In Module
      -----  --------------------------------   ------------------------
     00000102  ___memcpy_PARM_2                   ___memcpy
     00000102  __divsint_PARM_2                   _divuint
     00000102  __divuint_PARM_2                   _divuint
     00000102  __modsint_PARM_2                   _divuint
     00000102  __moduint_PARM_2                   _divuint
     00000102  __mulint_PARM_2                    _mulint
     00000102  _strcpy_PARM_2                     _strcpy
     00000104  ___memcpy_PARM_3                   ___memcpy
$ sdcc -v
SDCC : z80/sm83/z80n/r800/mos6502 TD- 4.3.2 #14334 (Linux)

Discussion

  • Gabriele Gorla

    Gabriele Gorla - 2023-12-06
    • Category: other --> MOS6502
     
  • Maarten Brock

    Maarten Brock - 2023-12-08

    What is there from 0x00FE to 0x0101 ?
    PAG means that the area should not cross a 256 boundary, which is why it doesn't fail here.

     

Log in to post a comment.

MongoDB Logo MongoDB