1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-06-15 07:29:29 +00:00

Updates to compiler header files

This commit is contained in:
Curtis F Kaylor 2018-01-28 13:38:17 -05:00
parent d53a4629f3
commit 595d4d8cf4
5 changed files with 52 additions and 3 deletions

33
apple1/oldclude/apple1.h Normal file
View File

@ -0,0 +1,33 @@
/* Apple 1 Header File */
//The keyboard data register returns ASCII codes with the high bit set
//These can be safely printed, since the display hardware ignores the high bit
#define CR $8D //Carriage Return key code
#define ESC $9B //Escape key code
#define DEL $DF //Delete (Backspace) key code
//Memory locations used by monitor program
char* buffer = $0200 //Monitor Input Buffer
//PIA 6820 Registers
char* kbd = $D010 //Keyboard Data
char* kbdcr = $D011 //Keyboard Control Register
char* dsp = $D012 //Display Data
char* dspcr = $D013 //Display Control Register
#label exit $FF00 //Monitor Entry Point
/*
void echo(A) = $FFEF //Print Character in Accumulator
void prbyte(A) = $FFDC //Print Accumulator as Hexadadecimal number
void prhex(A) = $FFE5 //Print Low Nybble of Accumulator as Hex Digit
*/
#origin $0300 //$0200 through $02FF used as a string buffer
/*
#asm
#endasm
char getkey();
*/

View File

@ -21,10 +21,11 @@
#define CPUOP "PROCESSOR" //Target CPU Pseudo-Operator
#define CPUARG "6502" //Target CPU Operand
#define ORGOP "ORG" //Equate Pseudo-Op
#define ORGOP "ORG" //Origin Pseudo-Op
#define EQUOP "EQU" //Equate Pseudo-Op
#define BYTEOP "DC" //Define Byte Pseudo-Op
#define STROP "DS" //Define String Pseudo-Op
#define ALNOP "ALIGN" //Align Pseudo-Op
#define ASMFMT "%-7s %-3s %-12s %s\n" //Assembly Language Line printf Format
@ -33,6 +34,7 @@
#define FALSE 0
#define DEBUG(fmt, val) if (debug) {prtpos(); printf(fmt, val);}
#define DETAIL(fmt, val) if (debug) {printf(fmt, val);}
#define ERROR(fmt, val, err) if (debug) {printf(fmt, val);exterr(err);}
#define SCMNT(str) if (gencmt) {setcmt(str);}
#define ACMNT(str) if (gencmt) {addcmt(str);}
@ -48,6 +50,7 @@ int nxtchr; //Next Character of Source File to Process
int nxtupc; //Next Character Converted to Uppercase
int savchr; //Holds nxtchr when switching input files
char incdir[FNAMLEN]; //Include File Directory
char inpnam[FNAMLEN]; //Include File Name
int alcvar; //Allocate Variables Flag

View File

@ -37,6 +37,9 @@ int isvpre(); //Is Next Character a Value Prefix
int isoper(); //Is Next Character an Operator
int ispopr(); //Is Next Character a Post-Operator
int invasc; //Invert ASCII Flag
char invchr(char c); //Invert Character Case
int wordis(char *s); //Does word match s
char getnxt(); //Return Next Character and Advance

9
test/test.h Normal file
View File

@ -0,0 +1,9 @@
/* Generic 6502 header file */
//int getchar() = $f000
//void putchar() = $f002
#label exit $FF00
#origin $0300

5
vars.h
View File

@ -4,6 +4,7 @@
/* Variable Table */
char varnam[MAXVAR+1][VARLEN+1]; //Variable Name Table
char varmod[MAXVAR+1]; //Variable Modifier
char vartyp[MAXVAR+1]; //Variable Type
char varsiz[MAXVAR+1][4]; //Variable Array
int varcnt; //Number of Variables in Table
@ -26,7 +27,7 @@ int dsize; //Total Data Length
enum dtypes {DTBYTE, DTSTR, DTARRY}; //Variable Data Types
enum mtypes {MTNONE, MTZP}; //Variable Modifier Types
enum mtypes {MTNONE, MTALGN, MTZP}; //Variable Modifier Types
int symdef(char *name); //Is Variable defined (TRUE or FALSE)
int zpaddr; //Current Zero-Page Address
@ -40,7 +41,7 @@ int prmcnt; //Number of Parameters
void chksym(int alwreg, char *name); //Error if Variable not defined
void prsdts(); //Parse Data String
void setdat(); //Set Variable Data
void setvar(int t); //Set Variable Name and Size
void setvar(int m, int t); //Set Variable Name and Size
void pdecl(int m, int t); //Parse Variable Declaration
void vartbl(); //Create Variable Table