mirror of
https://github.com/RevCurtisP/C02.git
synced 2026-04-25 12:22:40 +00:00
Added Integer Variables and Bitmask Enums
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/***************************
|
||||
* Test Address References *
|
||||
***************************/
|
||||
char b , i; //byte type has been removed
|
||||
char c,d,f; //a char is an unsigned 8 bit number
|
||||
char r[15]; //reserves dimension bytes
|
||||
char z[15];
|
||||
const char s = "This is a string.";
|
||||
|
||||
|
||||
funcx:
|
||||
f = testfn(&s); //Pointer
|
||||
f = testfn(b,&s); //Byte and Pointer
|
||||
f = testfn(r[i],&s); //Array Element and Pointer
|
||||
f = testfn(r[1],&s); //Array Element and Pointer
|
||||
f = testfn(b+c+d,&s); //Expression in Function Call
|
||||
f = testfn(getkey(b)+c); //Nested Function Call
|
||||
|
||||
funcs:
|
||||
testfn(&s); //Print a String
|
||||
|
||||
goto &$C000;
|
||||
|
||||
push &s, b+c+d, r[i];
|
||||
isort(); inline &r;
|
||||
|
||||
blkbgn(&$C000);
|
||||
blkend(&$C400);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
enum {SOLO};
|
||||
enum {ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN};
|
||||
bitmask {BLUE, GREEN, RED, BRIGHT, INVERT, BLINK, FLIP, BKGRND};
|
||||
|
||||
const char b = {#TRUE, #FALSE};
|
||||
char c, i;
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/* Test Integer Variables */
|
||||
|
||||
#pragma origin $F000
|
||||
#pragma zeropage $80
|
||||
|
||||
char b,d;
|
||||
char s[128];
|
||||
char aa,yy,xx;
|
||||
|
||||
zeropage int zp80, zp82;
|
||||
alias int c0 = $C000;
|
||||
const int c = $1234;
|
||||
int e;
|
||||
int i,j;
|
||||
int m,n;
|
||||
int yx;
|
||||
|
||||
i<<;
|
||||
j>>;
|
||||
m++;
|
||||
n--;
|
||||
|
||||
e = $5678;
|
||||
e = c;
|
||||
e = &$D000;
|
||||
e = &s;
|
||||
|
||||
b = fnb(e);
|
||||
d = fnd(b,c);
|
||||
|
||||
i = fni(c);
|
||||
j = fnj(b,c);
|
||||
|
||||
int fnb(*,yy,xx) {
|
||||
return *,xx,yy;
|
||||
}
|
||||
|
||||
int fnd(aa,yy,xx) {
|
||||
if (aa) return *,xx,yy;
|
||||
else return *,yy,xx;
|
||||
}
|
||||
|
||||
int fni(yx) {
|
||||
yx++;
|
||||
return yx;
|
||||
}
|
||||
|
||||
int fnj(aa, yx) {
|
||||
if (aa:-) yx--;
|
||||
else {if (aa) yx++;}
|
||||
return yx;
|
||||
}
|
||||
Reference in New Issue
Block a user