1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-22 16:34:15 +00:00
C02/include/stack.h02
2018-07-26 10:33:03 -04:00

71 lines
2.0 KiB
Plaintext

/******************************************
* stack - Stack Memory Functions for C02 *
******************************************/
/* Set Stack Start Address *
* Args: &addr - Start Address */
void stkbgn();
/* Drop Top Entry from Stack *
* Returns: A=Number of bytes dropped *
* 0 if none */
char stkdrp();
/* Set Destination to Stack Pointer *
* Returns: Y,X=Pointer Address */
void stkdst();
/* Duplicate Top Stack Entry *
* Returns: A=Number of bytes retrieved *
* 0 if none or overflow */
char stkdup();
/* Set Stack End Address *
* Args: &addr - End Address */
void stkend();
/* Duplicate Entry Under Top of Stack *
* Returns: A=Number of bytes retrieved *
* 0 if none or overflow */
char stkovr();
/* Pop Top Stack Entry into Array *
* 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();
/* Reset Stack Pointer to Stack Start *
* Returns: Y,X=Pointer Address */
void stkrst();
/* Set Stack Pointer Address *
* Args: &addr - Pointer Address */
void stkset();
/* Push String onto Stack *
* Args: &m - String to push *
* Returns: A=$FF if bytes were written *
* $00 if block was overflowed */
char stkstr();
/* Copy Top Stack Entry into Array *
* Args: n - Number of bytes to write *
* &m - Array to pop contents into *
* Returns: A=Number of bytes retrieved *
* 0 if none */
char stktop();