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

Renamed internal label constants

This commit is contained in:
Curtis F Kaylor 2019-05-18 20:57:39 -04:00
parent 0150493748
commit 2f297edbcd
4 changed files with 20 additions and 18 deletions

View File

@ -2,7 +2,7 @@
* C02 Assembly Language Routines *
*************************************/
char lblasm[LABLEN+2]; //Label to emit on next asm line
char lblasm[LBLLEN+2]; //Label to emit on next asm line
void asmlin(char *opcode, char *oprnd); //Output a line of assembly code
void cmtlin(); //Output a comment lines

View File

@ -16,10 +16,12 @@
#define DATASPC 4096 //Space to Allocate for Variable Data
#define SUBMAX 4 //Maximum Number of Sub Directories
#define LABLEN 6 //Maximum Label Length
#define LABFMT "L_%04d" //Label Format
#define LBLLEN 6 //Maximum Label Length
#define LBLFMT "L_%04d" //Label Format
#define LABSFX ":" //Label Suffix
#define MAXLAB 15 //Maximum Number of Labels (Nesting Depth)
#define MAXLBL 15 //Maximum Number of Labels (Nesting Depth)
#define LOCPFX "." //Local Variable Prefix
#define CPUOP "PROCESSOR" //Target CPU Pseudo-Operator

View File

@ -44,7 +44,7 @@ void setlbl(char *lblset) {
DEBUG("Emitting Label '%s'\n'", lblasm);
asmlin("",""); //Emit Block End Label on it's own line
}
if (strlen(lblset) > LABLEN) ERROR("Label '%s' exceeds maximum size\n", word, EXIT_FAILURE)
if (strlen(lblset) > LBLLEN) ERROR("Label '%s' exceeds maximum size\n", word, EXIT_FAILURE)
strcpy(lblasm, lblset);
}
@ -58,7 +58,7 @@ void prslbl(void) {
/* generate new label */
void newlbl(char* lbname) {
sprintf(lbname, LABFMT, lblnxt++);
sprintf(lbname, LBLFMT, lblnxt++);
DEBUG("Generated new label '%s'\n", lbname)
}

View File

@ -2,20 +2,20 @@
* C02 Label Parsing, Generation, and Lookup Routines *
******************************************************/
char curlbl[LABLEN+1]; //Most recently generated label
char cmplbl[LABLEN+1]; //Label for Comparison
char cndlbl[LABLEN+1]; //Label for Conditional Code
char endlbl[LABLEN+1]; //End Label
char forlbl[LABLEN+1]; //For Loop Label
char loplbl[LABLEN+1]; //Skip Increment Label
char skplbl[LABLEN+1]; //Skip Increment Label
char tmplbl[LABLEN+1]; //Temporary Label
char lblnam[MAXLAB+1][LABLEN+1]; //Label Name Table
int lbltyp[MAXLAB+1]; //Label Type
int lblblk[MAXLAB+1]; //Label Ends Program Block
char curlbl[LBLLEN+1]; //Most recently generated label
char cmplbl[LBLLEN+1]; //Label for Comparison
char cndlbl[LBLLEN+1]; //Label for Conditional Code
char endlbl[LBLLEN+1]; //End Label
char forlbl[LBLLEN+1]; //For Loop Label
char loplbl[LBLLEN+1]; //Skip Increment Label
char skplbl[LBLLEN+1]; //Skip Increment Label
char tmplbl[LBLLEN+1]; //Temporary Label
char lblnam[MAXLBL+1][LBLLEN+1]; //Label Name Table
int lbltyp[MAXLBL+1]; //Label Type
int lblblk[MAXLBL+1]; //Label Ends Program Block
int lblcnt; //Number of Labels in stack
int lblnxt; //Sequence of next label to be generated
char lbltmp[LABLEN+1]; //Label Temporary Storage
char lbltmp[LBLLEN+1]; //Label Temporary Storage
enum ltypes {LTNONE, LTIF, LTELSE, LTLOOP, LTEND, LTDO, LTDWHL, LTSLCT, LTCASE, LTFUNC}; //Label Types
enum lflags {LFNONE, LFBGN, LFEND}; //Label Flag Types