Not applicable
Jun 21, 2017
10:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 21, 2017
10:31 AM
I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.
Consider stack starting address 0x5000 0000. The stack size is 0x2000.
If I take current stack pointer minus 0x2000, will that create stack exception? If yes, what might be 'C' or assembly language code that will achieve this?
My thought is if I subtract negative 0x2000 from current stack pointer or add 0x2000 to current stack pointer, I'll be outside stack and stack exception will occur ?
I need to set program counter to illegal address, i.e. 0x00FF FFFC. Can this be done with assembly language instructions?
If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
Consider stack starting address 0x5000 0000. The stack size is 0x2000.
If I take current stack pointer minus 0x2000, will that create stack exception? If yes, what might be 'C' or assembly language code that will achieve this?
My thought is if I subtract negative 0x2000 from current stack pointer or add 0x2000 to current stack pointer, I'll be outside stack and stack exception will occur ?
I need to set program counter to illegal address, i.e. 0x00FF FFFC. Can this be done with assembly language instructions?
If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
- Tags:
- IFX
2 Replies
Not applicable
Jun 21, 2017
10:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 21, 2017
10:33 AM
Please disregard following text from my original post:
"I need to set program counter to illegal address, i.e. 0x00FF FFFC. Can this be done with assembly language instructions?
If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running."
"I need to set program counter to illegal address, i.e. 0x00FF FFFC. Can this be done with assembly language instructions?
If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running."
Jul 26, 2018
03:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 26, 2018
03:26 AM
Just allocate uint32_t array[size>maximally available size on stack] = {0};
this will cause a stack overflow -> just look at the assembly instructions during debugging and you will see the assembly commands causing this.
this will cause a stack overflow -> just look at the assembly instructions during debugging and you will see the assembly commands causing this.