Menu

#189 6502 zero page overflow

None
pending
None
5
2023-12-06
2023-05-23
Under4Mhz
No

I'm having a problem with my code under the 6502 front end.

It looks like I'm overflowing the zero page. If I remove certain of my functions, I can get the ZP under FF and the code runs, otherwise it hangs on start.

Any tips on reducing the size I'm using in the zero page?

Area                                    Addr        Size        Decimal Bytes ZP                                  00000020    000000ED =         237. bytes 
      Value  Global                              Global Defined In Module
     00000020  __TEMP                             mahjong
     00000028  __DPTR                             mahjong
     000000E4  ___SDCC_m6502_ret0                 _ret
     000000E5  ___SDCC_m6502_ret1                 _ret
     000000E6  ___SDCC_m6502_ret2                 _ret
     000000E7  ___SDCC_m6502_ret3                 _ret
     000000E8  ___SDCC_m6502_ret4                 _ret
     000000E9  ___SDCC_m6502_ret5                 _ret
     000000EA  ___SDCC_m6502_ret6                 _ret
     000000EB  ___SDCC_m6502_ret7                 _ret

Area                                    Addr        Size        Decimal Bytes OSEG                                0000010D    0000000C =          12. bytes 
      Value  Global                              Global Defined In Module
     0000010D  ___memcpy_PARM_2                   ___memcpy
     0000010D  __divsint_PARM_2                   _divuint
     0000010D  __divuint_PARM_2                   _divuint
     0000010D  __modsint_PARM_2                   _divuint
     0000010D  __moduint_PARM_2                   _divuint
     0000010D  __mulint_PARM_2                    _mulint
     0000010F  ___memcpy_PARM_3                   ___memcpy

Discussion

  • Gabriele Gorla

    Gabriele Gorla - 2023-12-06

    I added --no-zp-spill in [r14503]
    When using this option all register spills will end up in the BSS segment instead of ZP.

     

    Related

    Commit: [r14503]

  • Gabriele Gorla

    Gabriele Gorla - 2023-12-06
    • status: open --> pending
    • assigned_to: Gabriele Gorla
    • Group: -->
     

Log in to post a comment.