I also need a way of setting the flags to function calls (and possibly in expressions).
C02 allows direct references to the A, X, and Y registers by name, where appropriate. I could do something similar with the flags, although this would reserve B, C, D, I, N, V, and Z from being used as variable names.
Code:
C=1; //Compiles to SEC
C=0; //Compiles to CLC
etc...
This could be done before the function call:
Code:
C=1; plot(row,col); //Set Carry before call
C=0; plot(row,col); //Clear Carry before call
or as addition parameters
Code:
plot(row,col, C=1); //Set Carry before call
plot(row,col, C=0); //Clear Carry before call
but this syntax would not work in expressions.
I could also use the current (or a proposed) logical evaluation syntax:
Code:
plot(row,col, :C); //Set Carry before call
plot(row,col, :!C); //Clear Carry before call
plot(row,col, :NC); //Clear Carry before call
plot(row,col, :-); //Set Negative before call
plot(row,col, :+); //Clear Negative before call
but I would want any notation to not look too strange embedded in an expression.