1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-10-31 10:14:09 +00:00
C02/test/testsd.c02
2018-08-19 18:24:02 -04:00

83 lines
1.5 KiB
Plaintext

/************************************************
* TESTSD - Test Library stddef.h02 for py65mon *
************************************************/
//use -h option on command line
#include <stddef.h02>
const char txtstr = {
"#TRUE=",", #FALSE=",
"SAVREG($A,$B,$C)", " TEMP0,1,2=",
"RESREG()", " A,X,Y=",
"SETSRC(&$1234)"," SRCLO,HI=", " GETSRC()=",
"SETDST(&$5678)"," DSTLO,HI=", " GETDST()="
};
char txtidx;
char aa,xx,yy;
main:
txtidx = 0;
newlin();
prttxt(); prbyte(#TRUE);
prttxt(); prbyte(#FALSE);
newlin(); newlin();
temp0=0; temp1=0; temp3 = 0;
prtlin(); savreg($A,$B,$C);
prttxt(); prbyte(temp0);
prtcma(); prbyte(temp1);
prtcma(); prbyte(temp2);
newlin();
setreg(0,0,0);
prtlin(); aa,yy,xx = resreg();
prttxt(); prbyte(aa);
prtcma(); prbyte(yy);
prtcma(); prbyte(xx);
newlin(); newlin();
srclo = 0; srchi = 0;
prtlin(); setsrc(&$1234);
prttxt(); prbyte(srclo);
prtcma(); prbyte(srchi);
newlin();
prttxt(); setreg(0,0,0);
getsrc(); prtwrd();
newlin(); newlin();
dstlo = 0; dsthi = 0;
prtlin(); setdst(&$5678);
prttxt(); prbyte(dstlo);
prtcma(); prbyte(dsthi);
newlin();
prttxt(); setreg(0,0,0);
getdst(); prtwrd();
newlin(); newlin();
goto exit;
void setreg(aa,yy,xx) {}
void prtwrd(aa,yy,xx) {
prbyte(yy);
prbyte(xx);
}
void prtcma() {prchr(',');}
void prtlin() {prttxt(); newlin();}
void prttxt() {
while (txtstr[txtidx]) {
//prbyte(txtidx);prchr(' ');
prchr(txtstr[txtidx]);
txtidx++;
}
txtidx++;
}