Cart Contact NSDSP Home

nsdsp_debug_read_stack

This function reads data from the stack.

Syntax

unsigned int nsdsp_debug_read_stack(
        nsdsp_session_t   session,
        unsigned int      pos
);

Parameters

session - a reference to the Debug Session Object obtained with nsdsp_session_program_for_debug or nsdsp_start_debug_session function

pos - position in the stack

Target Device Position
PIC12,PIC16,PIC18The value in hardware call stack, as if pos was loaded into STKPTR register
PIC24,dsPIC33The word from stack pointed to by W15 register. For the last word pushed to the stack set pos to 0, for previous word set pos to 1 and so on. Be careful not to go out of bounds of implemented RAM.
PIC32MThe word from stack pointed to by SP register. For the last word pushed to the stack set pos to 0, for previous word set pos to 1 and so on. Be careful not to go out of bounds of implemented RAM.

Return

The function returns the size of the stack word, or zero in case of error.

Notes

This instruction only queues a command. The command will be sent to NSDSP when you queue enough commands to fill the buffer or when you call nsdsp_session_flush.

Once the data arrives, you can retrieve the value of the register with nsdsp_debug_fetch_stack function.

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

© 2007-2025 Northern Software Inc. All Rights Reserved.