%%HP: T(3)A(D)F(.);
"
% This file can be LINKed to the end of your main program so that you can
% execute the stack functions by using a GOSUB (ex: GOSUB PUSH_C).
% This helps keep your programs from becoming too long.
%
% There are two possible implementations.  You can LINK it as is, or remove
% each macro statement, and all the % signs.  (If you use it as-is, then
% you will need the Macro directory which contains the proper Macros.)
%
% Be careful using this method!  You need 3 or 4 free levels in RSTK
% before calling these functions.


*INIT_STK
/INIT_STK
RTN

*PUSH_A
/PUSH_A
 %ACEX
 %GOSUB PUSH_C
 %ACEX
RTN

*PUSH_B
/PUSH_B
 %BCEX
 %GOSUB PUSH_C
 %BCEX
RTN

*PUSH_C
/PUSH_C
RTN

*PUSH_D
/PUSH_D
 %CDEX
 %PUSH_C
 %CDEX
RTN

*PUSH_D0
/PUSH_D0
 %CD0EX
 %PUSH_C
 %CD0EX
RTN

*PUSH_D1
/PUSH_D1
 %CD1EX
 %PUSH_C
 %CD1EX
RTN

*POP_A
/POP_A
 %ACEX
 %GOSUB POP_C
 %ACEX
RTN

*POP_B
/POP_B
 %BCEX
 %GOSUB POP_C
 %BCEX
RTN

*POP_C
/POP_C
RTN

*POP_D
/POP_D
 %CDEX
 %POP_C
 %CDEX
RTN

*POP_D0
/POP_D0
 %CD0EX
 %POP_C
 %CD0EX
RTN

*POP_D1
/POP_D1
 %CD1EX
 %POP_C
 %CD1EX
RTN
@"

