From 3796ceffd7dbfa0d7844fe7e1c1026f6f32568c5 Mon Sep 17 00:00:00 2001 From: Curtis F Kaylor Date: Wed, 30 Sep 2020 12:17:18 -0400 Subject: [PATCH] Deleted/Moved test programs from py65/ to test/ --- py65/testiox.c02 | 95 ------------- py65/teststk.c02 | 199 --------------------------- py65/testmem.c02 => test/memtest.c02 | 0 py65/testmio.c02 => test/miotest.c02 | 0 {py65 => test}/testswp.c02 | 0 {py65 => test}/testtst.c02 | 0 6 files changed, 294 deletions(-) delete mode 100644 py65/testiox.c02 delete mode 100644 py65/teststk.c02 rename py65/testmem.c02 => test/memtest.c02 (100%) rename py65/testmio.c02 => test/miotest.c02 (100%) rename {py65 => test}/testswp.c02 (100%) rename {py65 => test}/testtst.c02 (100%) diff --git a/py65/testiox.c02 b/py65/testiox.c02 deleted file mode 100644 index 200aea3..0000000 --- a/py65/testiox.c02 +++ /dev/null @@ -1,95 +0,0 @@ -/*********************************************** - * TESTIOX - Test Library stdiox.h for py65mon * - ***********************************************/ - -#include -#include -#include -#include -#include - -char c, i, j; -const char s = "string"; - -main: - -getcpr("Press any key to begin..."); - -i = 0; - -putln("prtdec()"); -do { - putdec(i); - putc(':'); - i++; - if (!i&15) newlin(); -} while (i); -anykey(); - -putln("prtdel()"); -do { - putdel(i); - putc(':'); - i++; - if (!i&15) newlin(); -} while (i); -anykey(); - -putln("prtder()"); -do { - putder(i); - putc(':'); - i++; - if (!i&15) newlin(); -} while (i); -anykey(); - -putln("prthex()"); -do { - puthex(i); - putc(':'); - i++; - if (!i&15) newlin(); -} while (i); -anykey(); - -putln("prtbin()"); -do { - putbin(i); - putc(':'); - i++; - if (!i&7) newlin(); -} while (i); -anykey(); - -putln("prtwrd()"); -do { - j = i ^ $FF; - putwrd(*,i,j); - putc(':'); - i++; - if (!i&15) newlin(); -} while (i); -anykey(); - -do { - pfchar(i); putc($09); pfchar(i+16); newlin(); - i++; if (!i&15) {i = i + 16; anykey(); } -} while (i<128); - -setdst(&s); -printf("S=\"%s\""); -newlin(); - -setdst(&$1234); -printf("&$1234=%w"); -newlin(); - -done: - goto exit; - -void pfchar(c) { - if (c<32) printf(c," B='%b' H='%h' R='%r' L='%l' D='%d'"); - else printf(c,"C='%c' B= '%b' H='%h' R='%r' L='%l' D='%d'"); -} - diff --git a/py65/teststk.c02 b/py65/teststk.c02 deleted file mode 100644 index bcc9c2a..0000000 --- a/py65/teststk.c02 +++ /dev/null @@ -1,199 +0,0 @@ -/*********************************************** - * TESTSTK - Test Stack Manipulation Functions * - ***********************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -char c,f,g,i; -char aa,xx,yy; -char lo,hi; -const char r={6,7,8,9}; -const char s="Test String"; -char t[255]; - -main: - -for (i=0;i<$20;i++) srclo[i]=0; //Initialize Pointers - -puts("Setting Stack Start Address\t"); -puts("stkbgn($7FFF);\t"); -stkbgn(&$7FFF); lo=stkslo; hi=stkshi; -setdst("stks"); cklohi(&$7FFF); - -puts("Setting Stack End Address\t"); -puts("stkend($807E)\t"); -stkend(&$807E); lo=stkelo; hi=stkehi; -setdst("stke"); cklohi(&$807E); - -puts("Setting Stack Pointer Address\t"); -puts("stkset($8765)\t"); -stkset(&$8765); lo=stklo; hi=stkhi; -setdst("stk"); cklohi(0,&$8765); - -puts("Resetting Stack Pointer\t\t"); -puts("stkrst()\t"); -stkrst(); lo=stklo; hi=stkhi; -setdst("stk"); cklohi(0,&$7FFF); - -puts("Getting Stack Pointer Address\t"); -puts("stkptr()\t"); -aa, hi, lo = stkptr(); -setdst(""); cklohi(0,&$7FFF); - -puts("Setting Source to Stack Pointer\t"); -puts("stksrc()\t"); -stksrc(); lo=srclo; hi=srchi; -setdst("src"); cklohi(0,&$7FFF); - -puts("Setting Dest. to Stack Pointer\t"); -puts("stkdst()\t"); -stkdst(); lo=dstlo; hi=dsthi; -setdst("src"); cklohi(0,&$7FFF); - -puts("Incrementing Stack Pointer\t"); -puts("stkinc()\t"); -stkinc(); lo=stklo; hi=stkhi; -setdst("stk"); cklohi(0,&$8000); - -puts("Decrementing Stack Pointer\t"); -puts("stkdec()\t"); -stkdec(); lo=stklo; hi=stkhi; -setdst("stk"); cklohi(0,&$7FFF); - -puts("Pushing Array onto Stack\t"); -puts("stkpsh(@r,$r)\t"); -aa,hi,lo=stkptr(); //Save Stack Pointer -f=stkpsh(@r,&r); printf(f,"bytes=%d:"); -setdst(*,hi,lo); g=(memcmp(@r, &r)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8004); - -puts("Duplicating Top of Stack\t"); -puts("stkdup()\t"); -aa,hi,lo=stkptr(); //Save Stack Pointer -f=stkdup(); printf(f,"bytes=%d:"); -setdst(*,hi,lo); g=(memcmp(@r, &r)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8009); - -puts("Pushing String onto Stack\t"); -puts("stkstr(&s)\t"); -aa,hi,lo=stkptr(); //Save Stack Pointer -f=stkstr(&s); printf(f,"bytes=%d:"); -setdst(*,hi,lo); g=(strcmp(&s)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8016); - -puts("Duplicating Second Stack Entry\t"); -puts("stkovr()\t"); -aa,hi,lo=stkptr(); //Save Stack Pointer -f=stkovr(); printf(f,"bytes=%d:"); -setdst(*,hi,lo); g=(memcmp(@r, &r)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$801B); - -c = anykey(); if (c == #esckey) goto exit; - -puts("Dropping Duplicate off Stack\t"); -puts("stkdrp()\t"); -f=stkdrp(); printf(f,"bytes=%d:"); -g=(f==4) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8016); - -puts("Copying String from Stack\t"); -puts("stktop(&t)\t"); -f=stktop(&t); setdst(&t); printf("\"%s\":"); -g=(strcmp(&s)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8016); - -puts("Popping String off Stack\t"); -puts("stkpop(&t)\t"); -f=stkpop(&t); setdst(&t); printf("\"%s\":"); -g=(strcmp(&s)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8009); - -puts("Dropping Duplicate off Stack\t"); -puts("stkdrp()\t"); -f=stkdrp(); printf(f,"bytes=%d:"); -g=(f==4) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$8004); - -puts("Popping Array off Stack\t\t"); -puts("stkpop(&t)\t"); -f=stkpop(&t); prtary(f); puts(": "); -g=(memcmp(f,&r)==0) ? #TRUE : #FALSE; -psorfl(f & g); -chkptr(&$7FFF); - -puts("Popping off Empty Stack\t\t"); -puts("stkpop(&t)\t"); -f=stkpop(&t); printf(f,"bytes=%d:"); -if (f) fail(); else pass(); -chkptr(&$7FFF); - -puts("Overflowing Stack\t\t"); -puts("stkpsh(255,&t)\t"); -f=stkpsh(255,&t); printf(f,"bytes=%d:"); -if (f) fail(); else pass(); -chkptr(&$7FFF); - -putln("Tests Complete"); - -goto exit; - -void chkptr(aa,yy,xx) { - puts("\tChecking Stack Pointer\t\t\t"); - puts("address=$"); prbyte(stkhi); prbyte(stklo); putc(':'); - xx = (stklo == xx) ? #TRUE : #FALSE; - yy = (stkhi == yy) ? #TRUE : #FALSE; - psorfl(xx & yy); -} - -void prtary(aa) { - putc('{'); - for (i=0;i