EmbeddedRelated.com
Forums

How to create stack underflow exception ?

Started by learn 7 years ago185 views
I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.
 
Consider stack starting at address 0x5000 0000.  The stack size is 0x1000.  

If I add 0x1000 to current stack pointer(Register A10) and store result in A10, then I should get underflow error.

What might be the code in assembly to change stack pointer?  something like following:

stw a10, 0x1000(a10)   # I'm not sure if stw is correct opcode ?

what are other options to create stack undeflow exception?