2018-08-14 18:49:55 +00:00
|
|
|
/* VIC 20 with 3k Expansion Header File */
|
|
|
|
|
|
|
|
//#pragma ascii invert //switch case for PETSCII
|
|
|
|
|
|
|
|
//Platform Specific Constants
|
|
|
|
#define DELKEY $14 //Delete/Backspace Key (DEL)
|
|
|
|
#define ESCKEY $03 //Escape/Stop Key (STOP)
|
|
|
|
#define RTNKEY $0D //Return/Enter Key (RETURN)
|
2020-10-11 18:45:01 +00:00
|
|
|
#define SYSBFL 88 //System Buffer Length
|
2018-08-14 18:49:55 +00:00
|
|
|
|
2020-10-16 02:58:12 +00:00
|
|
|
/* Standard Library Pointers */
|
|
|
|
zeropage int srcptr, dstptr, bfrptr, blkptr;
|
|
|
|
char bfrlo,bfrhi; //Buffer Pointer for Library Functions
|
2018-08-14 18:49:55 +00:00
|
|
|
char stklo,stkhi; //Stack Pointer
|
|
|
|
|
2020-10-16 02:58:12 +00:00
|
|
|
/* Standard Library Variables */
|
|
|
|
int blkbgn, blkend; //Block Start and End Address
|
|
|
|
char blklen; //Block Segment Length
|
2018-08-14 18:49:55 +00:00
|
|
|
char stkslo, stkshi; //Stack Start Address
|
|
|
|
char stkelo, stkehi; //Stsck End Address
|
|
|
|
char random, rdseed; //Pseudo-Random Number Generation
|
|
|
|
char temp0, temp1, temp2, temp3; //Temporary Storage
|
2020-10-11 18:45:01 +00:00
|
|
|
char sysbfr[], sysbfp; //System String Buffer and Position
|
2018-08-14 18:49:55 +00:00
|
|
|
|
|
|
|
//System Subroutines
|
2018-09-12 13:54:54 +00:00
|
|
|
char polkey(); //Poll Console for character
|
|
|
|
char getchr(); //Wait for character from Console
|
2018-08-14 18:49:55 +00:00
|
|
|
char getkey(); //Read ASCII character from Console
|
|
|
|
void newlin(); //Advance cursor to beginning of next line
|
|
|
|
void delchr(); //Delete previous character
|
2018-09-12 13:54:54 +00:00
|
|
|
char putchr(); //Print ASCII character to Console
|
2018-08-14 18:49:55 +00:00
|
|
|
void prbyte(); //Print Accumulator as Hexadadecimal number
|
|
|
|
void prhex(); //Print Low Nybble of Accumulator as Hex Digit
|
|
|
|
|
2019-05-19 02:27:09 +00:00
|
|
|
//System Labels
|
|
|
|
start: //Start of Code
|
|
|
|
exit: //Return to Operating System
|