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

Fixed >> on char variables, < and > operators in function calls

This commit is contained in:
Curtis F Kaylor 2020-10-17 22:19:30 -04:00
parent 3773129162
commit 929fa2976c
4 changed files with 8 additions and 9 deletions

View File

@ -89,7 +89,7 @@ void pdrctv(void) {
void prolog(void) { void prolog(void) {
DEBUG("c02.prolog: Writing Assembly Prolog\n", 0) DEBUG("c02.prolog: Writing Assembly Prolog\n", 0)
asmlin(CPUOP,cputyp); if (strlen(cputyp)) asmlin(CPUOP,cputyp);
setcmt("Program "); setcmt("Program ");
addcmt(srcnam); addcmt(srcnam);
cmtlin(); cmtlin();
@ -193,9 +193,8 @@ void pargs(int argc, char *argv[]) {
* Uses: cputype * * Uses: cputype *
* Sets: cmos */ * Sets: cmos */
void chkcpu(void) { void chkcpu(void) {
if (strcmp(cputyp, "6502") == 0) cmos = FALSE; if (strcmp(cputyp, "65C02") == 0) cmos = TRUE;
else if (strcmp(cputyp, "65C02") == 0) cmos = TRUE; else cmos = FALSE;
else ERROR("Invalid CPU Type %s\n", cputyp, EXIT_FAILURE)
} }

View File

@ -26,7 +26,7 @@
#define LOCPFX "." //Local Variable Prefix #define LOCPFX "." //Local Variable Prefix
#define CPUOP "PROCESSOR" //Target CPU Pseudo-Operator #define CPUOP "PROCESSOR" //Target CPU Pseudo-Operator
#define CPUARG "6502" //Target CPU Operand #define CPUARG "" //Target CPU Operand
#define ORGOP "ORG" //Origin Pseudo-Op #define ORGOP "ORG" //Origin Pseudo-Op
#define EQUOP "EQU" //Equate Pseudo-Op #define EQUOP "EQU" //Equate Pseudo-Op
#define BYTEOP "BYTE" //Define Byte Pseudo-Op #define BYTEOP "BYTE" //Define Byte Pseudo-Op

View File

@ -38,7 +38,7 @@ int isspc(void) {return isspace(nxtchr);}
int isszop(void) {return match('@');} int isszop(void) {return match('@');}
int isvpre(void) {return TF(isalph() || islpre());} int isvpre(void) {return TF(isalph() || islpre());}
int isxfop(void) {return match('?');} int isxfop(void) {return match('?');}
int isxpre(void) {return TF(isvpre() || match('-') || match('*'));} int isxpre(void) {return TF(isvpre() || isbtop() || match('-') || match('*'));}
/* Process ASCII Character */ /* Process ASCII Character */
char prcchr(char c) { char prcchr(char c) {
@ -375,7 +375,7 @@ void poperr(char* name) {
/* Process Post Operator */ /* Process Post Operator */
void prcpst(int isint, char* name, char *index, char indtyp, char ispntr) { void prcpst(int isint, char* name, char *index, char indtyp, char ispntr) {
DEBUG("parse.prcpst: Processing post operation '%c'\n", oper) DEBUG("parse.prcpst: Processing post operation '%c\n'", oper)
if (ispntr) ERROR("Post Operation on dereferenced pointer %s not supported\n", name, EXIT_FAILURE) if (ispntr) ERROR("Post Operation on dereferenced pointer %s not supported\n", name, EXIT_FAILURE)
//sprintf(word,"(%s),Y", name); strcpy(name, word); } //sprintf(word,"(%s),Y", name); strcpy(name, word); }
char name1[VARLEN+3]; char name1[VARLEN+3];
@ -429,8 +429,8 @@ void prcpst(int isint, char* name, char *index, char indtyp, char ispntr) {
else if (strcmp(name, "Y")==0) poperr(name); //Index Register Shift not Supported else if (strcmp(name, "Y")==0) poperr(name); //Index Register Shift not Supported
else if (strcmp(name, "A")==0) asmlin("LSR", ""); else if (strcmp(name, "A")==0) asmlin("LSR", "");
else { else {
asmlin("LSR", name); if (isint) {asmlin("LSR", name1); asmlin("ROR", name);}
if (isint) asmlin("ROR", name1); else asmlin("LSR", name);
} }
break; break;
default: default: