2020-04-27 15:50:22 +00:00
|
|
|
/* run6502 Header File */
|
|
|
|
|
2020-10-19 19:42:10 +00:00
|
|
|
/* Platform Specific Settings */
|
2022-04-04 23:47:16 +00:00
|
|
|
#pragma zeropage $40 $FF //Zero Page Free Space
|
2020-10-19 19:42:10 +00:00
|
|
|
|
|
|
|
/* Platform Specific Constants */
|
2022-04-04 23:47:16 +00:00
|
|
|
#define DELKEY $7F //Delete/Backspace Key
|
2020-10-19 19:42:10 +00:00
|
|
|
#define ESCKEY $1B //Escape/Stop Key
|
|
|
|
#define RTNKEY $0D //Return/Enter Key
|
2020-10-11 18:45:01 +00:00
|
|
|
#define SYSBFL 128 //System Buffer Length
|
2020-04-27 15:50:22 +00:00
|
|
|
|
2020-10-19 19:42:10 +00:00
|
|
|
/* Standard Library Variables */
|
2022-04-04 23:47:16 +00:00
|
|
|
zeropage int srcptr, dstptr; //Source and Destination Pointer
|
|
|
|
zeropage int blkptr, stkptr; //Block and Stack Pointers
|
|
|
|
zeropage int tmpptr, lstptr, usrptr; //Temporary and User Pointer
|
|
|
|
int stkbgn, stkend; //Stack Begin and End Address
|
|
|
|
int blkbgn, blkend; //Block Begin and End Address
|
|
|
|
char blklen, xmbank; //Block Segment Length, Ext Memory Bank
|
|
|
|
int xmaddr; //Extended Memory Address
|
|
|
|
int intacc, intarg, intovr; //Integer Accumulator, Argument, Overflow
|
|
|
|
char random, rdseed; //Pseudo-Random Number and Seed
|
|
|
|
char temp0, temp1, temp2, temp3; //Temporary Storage
|
|
|
|
char sysbfr[], sysbfp; //System String Buffer and Position
|
2020-04-27 15:50:22 +00:00
|
|
|
|
2020-10-19 19:42:10 +00:00
|
|
|
/* System Subroutines */
|
2020-10-16 02:58:12 +00:00
|
|
|
void delchr(); //Delete previous character
|
2020-04-27 15:50:22 +00:00
|
|
|
char getchr(); //Wait for character from Console
|
2020-10-19 19:42:10 +00:00
|
|
|
char getkey(); //Read ASCII character from Console
|
2020-04-27 15:50:22 +00:00
|
|
|
void newlin(); //Advance cursor to beginning of next line
|
2020-10-19 19:42:10 +00:00
|
|
|
char polkey(); //Poll Console for character
|
|
|
|
void prbyte(); //Print Accumulator as Hexadecimal number
|
2020-04-27 15:50:22 +00:00
|
|
|
void prhex(); //Print Low Nybble of Accumulator as Hex Digit
|
2022-04-04 23:47:16 +00:00
|
|
|
void prword(); //Print Low Nybble of Accumulator as Hex Digit
|
2020-10-19 19:42:10 +00:00
|
|
|
char putchr(); //Print ASCII character to Console
|
|
|
|
char putstr(); //Print ASCII string to Console
|
2020-04-27 15:50:22 +00:00
|
|
|
|
2020-10-19 19:42:10 +00:00
|
|
|
/* System Labels */
|
2020-04-27 15:50:22 +00:00
|
|
|
start: //Start of Code
|
|
|
|
exit: //Return to Operating System
|