‎12-23-2007
08:37 AM
2,591 Views

Vickyg
Contributor II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm a newbie to assembler. I've been tracing through my code trying to discover what is happening, and I've found that my RTS is returning to the wrong place. Can anybody shed any light on a situation like this?
Thanks
Solved! Go to Solution.
1 Solution
‎12-23-2007
02:17 PM
985 Views

Vickyg
Contributor II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you both for your time and effort. Just knowing that there were people out there on my side (me against the chip) was what I needed to get past my problem. It turned out that I had changed chip sets and had missed that the add hx to a routines had moved and I was jumping in one point past where the stack pointer was incremented. Stupid error on my part, but as a complete novice I was sure it was something like an overrun of the stack bounderies.
Thanks, your being there was very important to me.
3 Replies
‎12-23-2007
10:06 AM
985 Views

kef
Specialist I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is stack pointer (SP) pointing to RAM?
‎12-23-2007
12:41 PM
985 Views


NXP Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
other things to check too
- stack is aligned, all the bytes added in the function have been removed before the RTS
- nothing in the function overwrites the return address
- the caller is using a JSR/BSR (and not CALL, for example)
- the stack is in RAM (as kef noted)
- the stack is allocated large enough.
Daniel
- stack is aligned, all the bytes added in the function have been removed before the RTS
- nothing in the function overwrites the return address
- the caller is using a JSR/BSR (and not CALL, for example)
- the stack is in RAM (as kef noted)
- the stack is allocated large enough.
Daniel
‎12-23-2007
02:17 PM
986 Views

Vickyg
Contributor II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you both for your time and effort. Just knowing that there were people out there on my side (me against the chip) was what I needed to get past my problem. It turned out that I had changed chip sets and had missed that the add hx to a routines had moved and I was jumping in one point past where the stack pointer was incremented. Stupid error on my part, but as a complete novice I was sure it was something like an overrun of the stack bounderies.
Thanks, your being there was very important to me.
