Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to create stack underflow exception ?

Status
Not open for further replies.

jani12

Advanced Member level 4
Joined
Oct 30, 2014
Messages
107
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,296
Activity points
2,527
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?
 

Hi,

Simply POP some bytes from stack...without PUSHing them onto stack first.

Klaus
 
  • Like
Reactions: jani12

    jani12

    Points: 2
    Helpful Answer Positive Rating
Please provide assembly language code to achieve popping from stack.

Our code is written in embedded 'C'. Do I need to do anything special to add assembly langauge, like asm keyword or disable and enable interrupts, etc.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top