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

[ loading the pc register ]

Parents
  • Note: This was originally posted on 15th July 2009 at http://forums.arm.com

    Actually, pc is correctly loaded, and I guess there is
    a problem with my copy, but I dont see which one.
    main is a naked function and has no local variable,
    so it doesnot use the stack at all...
    When I replace the first sub to compute the size with
    a harcoded one (ie. mov r2, #0x1000), it works...


    Hmm... Since you mention a hardcoded value works, and decrement by 4, I wonder if the size is actually not a multiple of 4 when working it out?  It looks like the code might loop if it wasn't.
Reply
  • Note: This was originally posted on 15th July 2009 at http://forums.arm.com

    Actually, pc is correctly loaded, and I guess there is
    a problem with my copy, but I dont see which one.
    main is a naked function and has no local variable,
    so it doesnot use the stack at all...
    When I replace the first sub to compute the size with
    a harcoded one (ie. mov r2, #0x1000), it works...


    Hmm... Since you mention a hardcoded value works, and decrement by 4, I wonder if the size is actually not a multiple of 4 when working it out?  It looks like the code might loop if it wasn't.
Children
No data