2018-09-23 22:39:27 +00:00
|
|
|
/********************************************
|
|
|
|
* stack - Software Stack Functions for C02 *
|
|
|
|
********************************************/
|
|
|
|
|
|
|
|
/* Add to Stack Pointer Address *
|
|
|
|
* Internal Utility Function *
|
|
|
|
* Args: b - Number of Bytes to Add */
|
|
|
|
void stkadd();
|
2018-07-25 23:00:46 +00:00
|
|
|
|
|
|
|
/* Set Stack Start Address *
|
|
|
|
* Args: &addr - Start Address */
|
|
|
|
void stkbgn();
|
|
|
|
|
2018-09-23 22:39:27 +00:00
|
|
|
/* Decrement Stack Pointer Address *
|
|
|
|
* Internal Utility Function */
|
|
|
|
void stkdec();
|
|
|
|
|
2018-07-26 14:33:03 +00:00
|
|
|
/* Drop Top Entry from Stack *
|
|
|
|
* Returns: A=Number of bytes dropped *
|
|
|
|
* 0 if none */
|
|
|
|
char stkdrp();
|
|
|
|
|
2018-07-25 23:00:46 +00:00
|
|
|
/* Set Destination to Stack Pointer *
|
|
|
|
* Returns: Y,X=Pointer Address */
|
|
|
|
void stkdst();
|
|
|
|
|
|
|
|
/* Set Stack End Address *
|
|
|
|
* Args: &addr - End Address */
|
|
|
|
void stkend();
|
|
|
|
|
2018-09-23 22:39:27 +00:00
|
|
|
/* Increment Stack Pointer Address *
|
|
|
|
* Internal Utility Function */
|
|
|
|
void stkinc();
|
2018-07-26 14:33:03 +00:00
|
|
|
|
|
|
|
/* Pop Top Stack Entry into Array *
|
2018-07-25 23:00:46 +00:00
|
|
|
* Args: n - Number of bytes to write *
|
|
|
|
* &m - Array to pop contents into *
|
|
|
|
* Returns: A=Number of bytes retrieved *
|
|
|
|
* 0 if none */
|
|
|
|
char stkpop();
|
|
|
|
|
|
|
|
/* Push Array Contents onto Stack *
|
|
|
|
* Args: n - Number of bytes to write *
|
|
|
|
* &m - Array containing bytes to push *
|
|
|
|
* Returns: A=$FF if bytes were written *
|
|
|
|
* $00 if block was overflowed */
|
|
|
|
char stkpsh();
|
|
|
|
|
|
|
|
/* Get Stack Pointer Address *
|
|
|
|
* Returns: Y,X=Pointer Address */
|
|
|
|
void stkptr();
|
|
|
|
|
2018-09-23 22:39:27 +00:00
|
|
|
/* Restore Stack Pointer Address *
|
|
|
|
* Internal Utility Function */
|
|
|
|
void stkrsp();
|
|
|
|
|
2018-07-25 23:00:46 +00:00
|
|
|
/* Reset Stack Pointer to Stack Start *
|
|
|
|
* Returns: Y,X=Pointer Address */
|
|
|
|
void stkrst();
|
|
|
|
|
|
|
|
/* Set Stack Pointer Address *
|
2018-09-23 22:39:27 +00:00
|
|
|
* Internal Utility Function *
|
2018-07-25 23:00:46 +00:00
|
|
|
* Args: &addr - Pointer Address */
|
|
|
|
void stkset();
|
|
|
|
|
2018-09-23 22:39:27 +00:00
|
|
|
/* Save Stack Pointer Address *
|
|
|
|
* Internal Utility Function */
|
|
|
|
void stkssp();
|
2018-07-25 23:00:46 +00:00
|
|
|
|
2018-09-23 22:39:27 +00:00
|
|
|
/* Get Stack Size *
|
|
|
|
* Returns: A=$FF if size greater than 0 *
|
|
|
|
* $00 if stack is empty *
|
|
|
|
* Y,X=Stack size in bytes */
|
|
|
|
void stksiz();
|
2018-07-26 14:33:03 +00:00
|
|
|
|
2018-09-23 22:39:27 +00:00
|
|
|
/* Subtract from Stack Pointer Address *
|
|
|
|
* Internal Utility Function *
|
|
|
|
* Args: b - Number of Bytes to Subtract */
|
|
|
|
void stksub();
|