Skip to main content
LHans.2
Associate II
July 13, 2022
Question

Fill Stack with watermarks without reset handler

  • July 13, 2022
  • 4 replies
  • 958 views

Hello,

I need to fill the stack with watermarks, but I do not have access to the assembly startup script. Usually I would do it right at the start of the reset handler, is there another way of doing this?

    This topic has been closed for replies.

    4 replies

    waclawek.jan
    Super User
    July 13, 2022

    It's OK to do it at the start of main(), best in asm, inline, or calling a function in separate asm source.

    As you never return from main(), all stack consumed - for whatever reason - at entry to main(), remains consumed forever.

    JW

    LHans.2
    LHans.2Author
    Associate II
    July 13, 2022

    Main will have to do for now. For everyone doing this, try not to overwrite stuff that is already on the stack when main is beeing called.

    Tesla DeLorean
    Guru
    July 13, 2022

    If you can call another function, or pull the SP register (perhaps via a pointer to an auto/local variable) you can move downward from there.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Andrew Neil
    Super User
    July 13, 2022

    "I do not have access to the assembly startup script."

    Could you say why not?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.