This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Meaning of scratch register in ARM series

Can I have the meaning of why r3,r4 registers are called scratch registers

  • Hello, I'm not sure which document you are referring to (as r4 is typically not a scratch register), but in the Arm Procedure call standard, r0-r3, and r12 are defined as scratch registers, meaning that when a function is called, the values therein may be different upon return. This is not an issue for C programming, the compiler will look after everything for you, but if writing assembler level code, this is important. Also important for exception handling.

    For more detail see:
    https://developer.arm.com/docs/ihi0042/latest

    Regards,

    Ronan