├── .gitignore ├── C-lang-subset.md ├── COPYING ├── Design.md ├── File-formats.md ├── Lib-reference.md ├── Makefile ├── README.md ├── Release-howto.md ├── Runtime-libs.md ├── Usage.md ├── Versions.md ├── Why-Forth.md ├── archived ├── v03 │ ├── README.md │ ├── cc64v03.txt │ └── cc64v03.zip ├── v04 │ ├── README.md │ ├── cc64v04.doc │ ├── cc64v04.prg │ ├── cc64v04.txt │ ├── cc64v04.zip │ ├── cc64v04e.prg │ ├── char_asm.seq │ ├── charset.prg │ ├── peddi02.prg │ └── read.me └── v05 │ ├── .gitignore │ ├── Makefile │ ├── build-cc64.sh │ ├── build-cc64pe.sh │ ├── build-in-vice.sh │ ├── build-peddi.sh │ ├── build-uf-build-base.sh │ ├── c-char-rom-gen │ ├── c-char-rom-gen.a │ ├── c-charset │ ├── c-charset.a │ ├── c64files.d64 │ ├── c64files.zip │ ├── c64files │ ├── c-charset │ ├── cc64v05 │ ├── cc64v05pe │ ├── helloworld.c │ ├── kernal-io.c │ ├── peddi03 │ ├── rt-c64-0801.h │ ├── rt-c64-0801.i │ └── rt-c64-0801.o │ ├── cc64v05.T64 │ ├── cc64v05pe.T64 │ ├── devenv-uF83 │ ├── devenv-uF83.T64 │ ├── generate_pragma_cc64.awk │ ├── helloworld.c │ ├── kernal-io.c │ ├── notdone │ ├── obsolete-howtos │ ├── build-cc64-manual.howto │ ├── build-cc64-semimanual.howto │ └── build-uf-build-base.howto │ ├── peddi03.T64 │ ├── rt-c64-0801.a │ ├── rt-c64-0801.h │ ├── rt-c64-0801.i │ ├── rt-c64-0801.o │ ├── run-cc64.sh │ ├── run-devenv.sh │ ├── src │ ├── cc64 │ │ ├── 2words.fth │ │ ├── 6502asm.fth │ │ ├── cc64-main.fth │ │ ├── cc64pe-main.fth │ │ ├── codegen.fth │ │ ├── codehandler.fth │ │ ├── codeoutput.fth │ │ ├── errorhandler.fth │ │ ├── errormsgs.fth │ │ ├── fileio.fth │ │ ├── fileman.fth │ │ ├── init.fth │ │ ├── input.fth │ │ ├── invoke.fth │ │ ├── listman.fth │ │ ├── memman.fth │ │ ├── parser.fth │ │ ├── pass2.fth │ │ ├── preprocessor.fth │ │ ├── savesystem.fth │ │ ├── scanner.fth │ │ ├── shell.fth │ │ ├── strtab.fth │ │ ├── symboltable.fth │ │ ├── trns6502asm.fth │ │ ├── util-words.fth │ │ └── v-assembler.fth │ ├── cc64src1.d64 │ ├── cc64src1.fth │ ├── cc64src2.d64 │ ├── cc64src2.fth │ ├── peddi │ │ ├── ed-asm.fth │ │ ├── ed-frame.fth │ │ ├── ed-func.fth │ │ ├── peddi-main.fth │ │ └── peddi-shell.fth │ ├── peddi_src.d64 │ └── peddi_src.fth │ ├── tests │ ├── Makefile │ ├── add-test.c │ ├── add.golden │ ├── compile-in-vice.sh │ ├── compile.fth │ ├── debug-in-vice.sh │ ├── div-test.c │ ├── div.golden │ ├── do-test.c │ ├── do.golden │ ├── for-test.c │ ├── for.golden │ ├── forward-test.c │ ├── forward.golden │ ├── helloworld-test.c │ ├── helloworld.golden │ ├── helloworld3-test.c │ ├── helloworld3.golden │ ├── itoa-test.c │ ├── itoa.golden │ ├── mod-test.c │ ├── mod.golden │ ├── mult-test.c │ ├── mult.golden │ ├── partialfor-test.c │ ├── partialfor.golden │ ├── peddi │ │ ├── Makefile │ │ ├── editfile.before │ │ ├── editfile.golden │ │ ├── editfile.keybuf │ │ ├── helloworld.golden │ │ ├── helloworld.keybuf │ │ ├── run-peddi.sh │ │ ├── run-test.sh │ │ ├── widelines.before │ │ ├── widelines.golden │ │ └── widelines.keybuf │ ├── perform-suite.sh │ ├── run-test.sh │ ├── shift-test.c │ ├── shift.golden │ ├── sub-test.c │ ├── sub.golden │ ├── switch-test.c │ ├── switch.golden │ ├── test-in-vice.sh │ ├── test-main.h │ ├── test-setup.h │ ├── while-test.c │ └── while.golden │ ├── uF83-382-c64 │ ├── uF83-382-c64.T64 │ ├── uf-build-base │ ├── uf-build-base.T64 │ └── x11_sym_uf_de.vkm ├── autostart-c16 ├── cc64.T64 ├── cc64pe.T64 ├── peddi.T64 └── vf-build-base.T64 ├── autostart-c64 ├── cc64.T64 ├── cc64pe.T64 ├── cc64pftm.T64 ├── cc64prof.T64 ├── cc64time.T64 ├── devenv-uF83.T64 ├── peddi.T64 └── vf-build-base.T64 ├── bin-size-register ├── c16-cc64.sizes ├── c16-cc64pe.sizes ├── c16-peddi.sizes ├── c64-cc64.sizes ├── c64-cc64pe.sizes ├── c64-cc64pftm.sizes ├── c64-cc64prof.sizes ├── c64-cc64time.sizes ├── c64-peddi.sizes └── x16-cc64.sizes ├── c16files ├── c-charset ├── cc64 ├── cc64pe ├── ctype.h ├── helloworld-c16.c ├── helloworld-c64.c ├── helloworld-x16.c ├── kernal-io-c16.c ├── kernal-io-c64.c ├── libc-c16.h ├── libc-c16.i ├── libc-c16.o ├── libc-c64.c ├── libc-c64.h ├── libc-c64.i ├── libc-c64.o ├── libc-x16.h ├── libc-x16.i ├── libc-x16.o ├── peddi ├── rt-c16-10-7f.h ├── rt-c16-10-7f.i ├── rt-c16-10-7f.o ├── rt-c64-08-9f.h ├── rt-c64-08-9f.i ├── rt-c64-08-9f.o ├── rt-x16-08-9e.h ├── rt-x16-08-9e.i ├── rt-x16-08-9e.o ├── sieve-c64.c ├── stdio.h ├── stdlib.h ├── string.h ├── vccc2023-c16.c ├── vccc2023-c64.c ├── vccc2023-x16.c └── vf-build-base ├── c64-buckets.sizes ├── c64files ├── .cc64 ├── c-charset ├── cc64 ├── cc64pe ├── cc64pftm ├── cc64prof ├── cc64time ├── ctype.h ├── helloworld-c16.c ├── helloworld-c64.c ├── helloworld-x16.c ├── kernal-io-c16.c ├── kernal-io-c64.c ├── libc-c16.h ├── libc-c16.i ├── libc-c16.o ├── libc-c64.h ├── libc-c64.i ├── libc-c64.o ├── libc-x16.h ├── libc-x16.i ├── libc-x16.o ├── peddi ├── rt-c16-10-7f.h ├── rt-c16-10-7f.i ├── rt-c16-10-7f.o ├── rt-c64-08-9f.h ├── rt-c64-08-9f.i ├── rt-c64-08-9f.o ├── rt-x16-08-9e.h ├── rt-x16-08-9e.i ├── rt-x16-08-9e.o ├── sieve-c64.c ├── stdio.h ├── stdlib.h ├── string.h ├── vccc2023-c16.c ├── vccc2023-c64.c ├── vccc2023-x16.c └── vf-build-base ├── cc64-c16files.d64 ├── cc64-c16files.zip ├── cc64-c64files.d64 ├── cc64-c64files.zip ├── cc64-x16files-sdcard.zip ├── cc64-x16files.d64 ├── cc64-x16files.zip ├── doc └── recompile-readme ├── emulator ├── .gitignore ├── Makefile ├── basedir.shlib ├── build-binary.sh ├── c-char-rom-gen ├── compile-in-emu.sh ├── compile-lib.sh ├── copy-from-emu.sh ├── copy-to-emu.sh ├── copy-to-sd-img.sh ├── debug-in-vice.sh ├── mk-sdcard.sh ├── notdone ├── run-in-c16emu.sh ├── run-in-c64emu.sh ├── run-in-vice.sh ├── run-in-x16emu.sh ├── sdcard.sfdisk ├── which-vice.sh ├── which-x16emu-rom.sh ├── x11_sym_c16_vf_de.vkm └── x11_sym_c64_vf_de.vkm ├── forth ├── devenv-uF83 ├── update-forth.sh ├── v4th-c16+ ├── v4th-c64 └── v4th-x16 ├── lib ├── ctype.h ├── libc-c16.c ├── libc-c16.h ├── libc-c16.i ├── libc-c16.o ├── libc-c64.c ├── libc-c64.h ├── libc-c64.i ├── libc-c64.o ├── libc-x16.c ├── libc-x16.h ├── libc-x16.i ├── libc-x16.o ├── stdio.h ├── stdlib.h └── string.h ├── register-sizes.sh ├── runtime ├── lib-cio-c16.h ├── lib-cio-c16.i ├── lib-cio-c16.o ├── lib-cio-c64.h ├── lib-cio-c64.i ├── lib-cio-c64.o ├── lib-cio-x16.h ├── lib-cio-x16.i ├── lib-cio-x16.o ├── lib-cty-c16.h ├── lib-cty-c16.i ├── lib-cty-c16.o ├── lib-cty-c64.h ├── lib-cty-c64.i ├── lib-cty-c64.o ├── lib-cty-x16.h ├── lib-cty-x16.i ├── lib-cty-x16.o ├── rt-c16-10-7f.h ├── rt-c16-10-7f.i ├── rt-c16-10-7f.o ├── rt-c64-08-9f.h ├── rt-c64-08-9f.i ├── rt-c64-08-9f.o ├── rt-x16-08-9e.h ├── rt-x16-08-9e.i └── rt-x16-08-9e.o ├── src ├── cc64 │ ├── 2words.fth │ ├── cc64.fth │ ├── cc64pe.fth │ ├── cc64pftm.fth │ ├── cc64prof.fth │ ├── cc64size.fth │ ├── cc64time.fth │ ├── codegen.fth │ ├── codehandler.fth │ ├── enable-log.fth │ ├── errorhandler.fth │ ├── errormsgs.fth │ ├── fileio.fth │ ├── fileman.fth │ ├── init.fth │ ├── input.fth │ ├── invoke.fth │ ├── listman.fth │ ├── memman.fth │ ├── p2write-decl.fth │ ├── parser.fth │ ├── pass2.fth │ ├── preprocessor.fth │ ├── prof-metrics.fth │ ├── rt-ptrs.fth │ ├── scanner.fth │ ├── set-d000.fth │ ├── shell.fth │ ├── strings.fth │ ├── strtab.fth │ ├── symboltable.fth │ ├── util-words.fth │ └── v-assembler.fth ├── common │ ├── 6502asm.fth │ ├── 6526timer.fth │ ├── faketimer.fth │ ├── init-shell.fth │ ├── logtofile.fth │ ├── lowlevel.fth │ ├── mock32timer.fth │ ├── notmpheap.fth │ ├── profiler.fth │ ├── savesystem.fth │ ├── timertest.fth │ ├── tmp6502asm.fth │ ├── tmpheap.fth │ ├── tracer.fth │ ├── trns6502asm.fth │ ├── trnstmpheap.fth │ ├── version.fth │ ├── x16edit.fth │ ├── x16tmpheap.fth │ └── x16trnstmphp.fth ├── lib │ ├── 00internal.c │ ├── include │ │ ├── ctype.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ └── string.h │ ├── stdio │ │ └── defines.c │ ├── stdlib │ │ ├── abs.c │ │ └── atoi.c │ └── string │ │ ├── memchr.c │ │ ├── memcmp.c │ │ ├── memcpy.c │ │ ├── memmove.c │ │ ├── memset.c │ │ ├── strcat.c │ │ ├── strchr.c │ │ ├── strcmp.c │ │ ├── strcpy.c │ │ ├── strcspn.c │ │ ├── strlen.c │ │ ├── strncat.c │ │ ├── strncmp.c │ │ ├── strncpy.c │ │ ├── strpbrk.c │ │ ├── strrchr.c │ │ ├── strspn.c │ │ └── strstr.c ├── peddi │ ├── ed-asm.fth │ ├── ed-frame.fth │ ├── ed-func.fth │ ├── peddi-shell.fth │ └── peddi.fth ├── runtime │ ├── bas-c16-10-7f.a │ ├── bas-c64-08-9f.a │ ├── bas-x16-08-9e.a │ ├── c-char-rom-gen.a │ ├── c-charset-c16.a │ ├── c-charset-c64.a │ ├── c-charset-x16.a │ ├── ctype-petscii.a │ ├── extract_init_skip.awk │ ├── fileio.a │ ├── generate_runtime_h.awk │ ├── lib-cio-c16.a │ ├── lib-cio-c64.a │ ├── lib-cio-x16.a │ ├── lib-cty-c16.a │ ├── lib-cty-c64.a │ ├── lib-cty-x16.a │ ├── printf.a │ ├── rand.a │ ├── rt-c16-10-7f.a │ ├── rt-c64-08-9f.a │ ├── rt-core.a │ ├── rt-x16-08-9e.a │ └── statics.a └── samples │ ├── helloworld-c16.c │ ├── helloworld-c64.c │ ├── helloworld-x16.c │ ├── kernal-io-c16.c │ ├── kernal-io-c64.c │ ├── sieve-c64.c │ ├── vccc2023-c16.c │ ├── vccc2023-c64.c │ └── vccc2023-x16.c ├── tests ├── e2e │ ├── Makefile │ ├── add-test.c │ ├── add.golden │ ├── basedir.shlib │ ├── cc64-1.pfs │ ├── compile-in-emu.sh │ ├── compile-run-suite.sh │ ├── compile-run-test.sh │ ├── compound-test.c │ ├── compound.golden │ ├── concat-golden-silver.shlib │ ├── concat-suite.shlib │ ├── debug-in-vice.sh │ ├── div-test.c │ ├── div.golden │ ├── do-test.c │ ├── do.golden │ ├── evaluate-suite.shlib │ ├── for-test.c │ ├── for.golden │ ├── forward-test.c │ ├── forward.golden │ ├── helloworld-test.c │ ├── helloworld.golden │ ├── helloworld3-test.c │ ├── helloworld3.golden │ ├── itoa-test.c │ ├── itoa.golden │ ├── mod-test.c │ ├── mod.golden │ ├── mult-test.c │ ├── mult.golden │ ├── nextword.pfs │ ├── partialfor-test.c │ ├── partialfor.golden │ ├── profile-register │ │ ├── cc64-1-2021-03-26-2120-orig-list.profile │ │ ├── cc64-1-2021-03-26-2131-orig-nolist.profile │ │ ├── cc64-1-2021-03-28-0110-operq.profile │ │ ├── cc64-1-2021-03-28-1948-oper.profile │ │ ├── cc64-1-2021-03-28-2144-nextword.profile │ │ ├── cc64-1-2021-04-03-2337-thisword.profile │ │ ├── cc64-1-2021-04-04-0011-parser.profile │ │ ├── cc64-1-2021-04-04-0015-compound.profile │ │ ├── cc64-1-2021-04-16-0131-strings.profile │ │ ├── cc64-1-2021-04-17-0112-alphanum.profile │ │ ├── cc64-1-2021-04-23-1012-findstr2.profile │ │ ├── cc64-1-2021-04-23-2148-countstamps.profile │ │ ├── cc64-1-2021-04-25-1623-stringarray.profile │ │ ├── cc64-1-2021-05-27-2241-ansi.profile │ │ ├── cc64-1-2021-09-05-1630-pdclib.profile │ │ ├── cc64-1-2021-12-19-2317-fastcall.profile │ │ ├── cc64-1-2021-12-22-2348-v0.10.profile │ │ ├── cc64-1-2022-08-28-2221-v0.11.profile │ │ ├── cc64-1-2023-12-05-2002-v0.12.profile │ │ ├── cc64-1-2024-07-19-0014-v0.13.profile │ │ ├── nextword-2021-03-28-2144-nextword.profile │ │ ├── nextword-2021-04-03-2337-thisword.profile │ │ ├── nextword-2021-04-04-0011-parser.profile │ │ ├── nextword-2021-04-04-0015-compound.profile │ │ ├── nextword-2021-04-16-0131-strings.profile │ │ ├── nextword-2021-04-17-0112-alphanum.profile │ │ ├── nextword-2021-04-23-1012-findstr2.profile │ │ ├── nextword-2021-04-23-2148-countstamps.profile │ │ ├── nextword-2021-04-25-1623-stringarray.profile │ │ ├── nextword-2021-05-27-2241-ansi.profile │ │ ├── nextword-2021-09-05-1630-pdclib.profile │ │ ├── nextword-2021-12-19-2317-fastcall.profile │ │ ├── nextword-2021-12-22-2348-v0.10.profile │ │ ├── nextword-2022-08-28-2221-v0.11.profile │ │ ├── nextword-2023-12-05-2002-v0.12.profile │ │ ├── nextword-2024-07-19-0014-v0.13.profile │ │ ├── scanner1-2021-03-26-2120-orig-list.profile │ │ ├── scanner1-2021-03-26-2131-orig-nolist.profile │ │ ├── scanner1-2021-03-28-0110-operq.profile │ │ ├── scanner1-2021-03-28-1948-oper.profile │ │ ├── scanner1-2021-03-28-2144-nextword.profile │ │ ├── scanner1-2021-04-03-2337-thisword.profile │ │ ├── scanner1-2021-04-04-0011-parser.profile │ │ ├── scanner1-2021-04-04-0015-compound.profile │ │ ├── scanner1-2021-04-16-0131-strings.profile │ │ ├── scanner1-2021-04-17-0112-alphanum.profile │ │ ├── scanner1-2021-04-23-1012-findstr2.profile │ │ ├── scanner1-2021-04-23-2148-countstamps.profile │ │ ├── scanner1-2021-04-25-1623-stringarray.profile │ │ ├── scanner1-2021-05-27-2241-ansi.profile │ │ ├── scanner1-2021-09-05-1630-pdclib.profile │ │ ├── scanner1-2021-12-19-2317-fastcall.profile │ │ ├── scanner1-2021-12-22-2348-v0.10.profile │ │ ├── scanner1-2022-08-28-2221-v0.11.profile │ │ ├── scanner1-2023-12-05-2002-v0.12.profile │ │ ├── scanner1-2024-07-19-0014-v0.13.profile │ │ ├── scanner2-2021-03-26-2120-orig-list.profile │ │ ├── scanner2-2021-03-26-2131-orig-nolist.profile │ │ ├── scanner2-2021-03-28-0110-operq.profile │ │ ├── scanner2-2021-03-28-1948-oper.profile │ │ ├── scanner2-2021-03-28-2144-nextword.profile │ │ ├── scanner2-2021-04-03-2337-thisword.profile │ │ ├── scanner2-2021-04-04-0011-parser.profile │ │ ├── scanner2-2021-04-04-0015-compound.profile │ │ ├── scanner2-2021-04-16-0131-strings.profile │ │ ├── scanner2-2021-04-17-0112-alphanum.profile │ │ ├── scanner2-2021-04-23-1012-findstr2.profile │ │ ├── scanner2-2021-04-23-2148-countstamps.profile │ │ ├── scanner2-2021-04-25-1623-stringarray.profile │ │ ├── scanner2-2021-05-27-2241-ansi.profile │ │ ├── scanner2-2021-09-05-1630-pdclib.profile │ │ ├── scanner2-2021-12-19-2317-fastcall.profile │ │ ├── scanner2-2021-12-22-2348-v0.10.profile │ │ ├── scanner2-2022-08-28-2221-v0.11.profile │ │ ├── scanner2-2023-12-05-2002-v0.12.profile │ │ ├── scanner2-2024-07-19-0014-v0.13.profile │ │ ├── scanner3-2021-03-28-2144-nextword.profile │ │ ├── scanner3-2021-04-03-2337-thisword.profile │ │ ├── scanner3-2021-04-04-0011-parser.profile │ │ ├── scanner3-2021-04-04-0015-compound.profile │ │ ├── scanner3-2021-04-16-0131-strings.profile │ │ ├── scanner3-2021-04-17-0112-alphanum.profile │ │ ├── scanner3-2021-04-23-1012-findstr2.profile │ │ ├── scanner3-2021-04-23-2148-countstamps.profile │ │ ├── scanner3-2021-04-25-1623-stringarray.profile │ │ ├── scanner3-2021-05-27-2241-ansi.profile │ │ ├── scanner3-2021-09-05-1630-pdclib.profile │ │ ├── scanner3-2021-12-19-2317-fastcall.profile │ │ ├── scanner3-2021-12-22-2348-v0.10.profile │ │ ├── scanner3-2022-08-28-2221-v0.11.profile │ │ ├── scanner3-2023-12-05-2002-v0.12.profile │ │ ├── scanner3-2024-07-19-0014-v0.13.profile │ │ ├── suite-2021-03-26-2120-orig-list.profile │ │ ├── suite-2021-03-26-2131-orig-nolist.profile │ │ ├── suite-2021-03-28-0110-operq.profile │ │ ├── suite-2021-03-28-1948-oper.profile │ │ ├── suite-2021-03-28-2144-nextword.profile │ │ ├── suite-2021-04-03-2337-thisword.profile │ │ ├── suite-2021-04-04-0011-parser.profile │ │ ├── suite-2021-04-04-0015-compound.profile │ │ ├── suite-2021-04-16-0131-strings.profile │ │ ├── suite-2021-04-17-0112-alphanum.profile │ │ ├── suite-2021-04-23-1012-findstr2.profile │ │ ├── suite-2021-04-23-2148-countstamps.profile │ │ ├── suite-2021-04-25-1623-stringarray.profile │ │ ├── suite-2021-05-27-2241-ansi.profile │ │ ├── suite-2021-09-05-1630-pdclib.profile │ │ ├── suite-2021-12-19-2317-fastcall.profile │ │ ├── suite-2021-12-22-2348-v0.10.profile │ │ ├── suite-2022-08-28-2221-v0.11.profile │ │ ├── suite-2023-12-05-2002-v0.12.profile │ │ └── suite-2024-07-19-0014-v0.13.profile │ ├── profile-suite.sh │ ├── register-profiles.sh │ ├── run-in-emu.sh │ ├── scanner1.pfs │ ├── scanner2.pfs │ ├── scanner3.pfs │ ├── shift-test.c │ ├── shift.golden │ ├── sub-test.c │ ├── sub.golden │ ├── switch-test.c │ ├── switch.golden │ ├── test-main.h │ ├── test-setup-c16.h │ ├── test-setup-c64.h │ ├── test-setup-x16.h │ ├── while-test.c │ └── while.golden ├── integration │ ├── Makefile │ ├── basedir.shlib │ ├── compile-in-emu.sh │ ├── compile-lib.sh │ ├── libtest.c │ └── libtest.golden ├── lib │ ├── .gitignore │ ├── Makefile │ ├── basedir.shlib │ ├── compile-in-emu.sh │ ├── compile-run-suite.sh │ ├── concat-golden-silver.shlib │ ├── concat-outfile.shlib │ ├── concat-suite.shlib │ ├── ctype │ │ ├── fcallptr-test.c │ │ ├── include.h │ │ ├── isalnum-test.c │ │ ├── isalpha-test.c │ │ ├── isdigit-test.c │ │ ├── islower-test.c │ │ ├── isspace-test.c │ │ ├── isupper-test.c │ │ ├── tolower-test.c │ │ └── toupper-test.c │ ├── default.golden │ ├── evaluate-suite.shlib │ ├── include-libc-c16.h │ ├── include-libc-c64.h │ ├── include-libc-x16.h │ ├── printf │ │ ├── fprintf-test-src.c │ │ ├── include.h │ │ ├── printf-test-src.c │ │ ├── sprintf-test-src.c │ │ ├── xprintf-golden.src │ │ └── xprintf-test-inc.c │ ├── rand-oracle.c │ ├── rand-oracle.sh │ ├── run-in-emu.sh │ ├── stdio │ │ ├── allocfh-test.c │ │ ├── fgets-test.c │ │ ├── fopen-test.c │ │ ├── fopen.in2 │ │ ├── fopen.out1.golden │ │ ├── fopen.out2.golden │ │ ├── fopen.out3.golden │ │ ├── fputs-test.c │ │ ├── fputs.out1.golden │ │ ├── include.h │ │ ├── putchar-test.c │ │ ├── putchar.golden │ │ ├── puts-test.c │ │ ├── puts.golden │ │ └── remove-test.c │ ├── stdlib │ │ ├── abs-test.c │ │ ├── atoi-test.c │ │ ├── include.h │ │ ├── rand-expect.c │ │ └── rand-test.c │ ├── string │ │ ├── include.h │ │ ├── strcat-test.c │ │ ├── strchr-test.c │ │ ├── strcmp-test.c │ │ ├── strcpy-test.c │ │ ├── strcspn-test.c │ │ ├── strlen-test.c │ │ ├── strncat-test.c │ │ ├── strncmp-test.c │ │ ├── strncpy-test.c │ │ ├── strpbrk-test.c │ │ ├── strrchr-test.c │ │ ├── strspn-test.c │ │ └── strstr-test.c │ ├── strmem │ │ ├── include.h │ │ ├── memchr-test.c │ │ ├── memcmp-test.c │ │ ├── memcpy-test.c │ │ ├── memmove-test.c │ │ └── memset-test.c │ ├── test-main.h │ ├── test-setup-c16.h │ ├── test-setup-c64.h │ ├── test-setup-x16.h │ ├── xprintf-golden.awk │ └── xprintf-test.awk ├── peddi │ ├── Makefile │ ├── editfile.before │ ├── editfile.golden │ ├── editfile.keybuf │ ├── helloworld.golden │ ├── helloworld.keybuf │ ├── notdone │ ├── run-peddi.sh │ ├── run-test.sh │ ├── widelines.before │ ├── widelines.golden │ └── widelines.keybuf └── unit │ ├── Makefile │ ├── base-setup.fth │ ├── basedir.shlib │ ├── build-run-test.sh │ ├── fake-codeh.fth │ ├── fake-err-hdl.fth │ ├── fake-input.fth │ ├── fake-memheap.fth │ ├── fake-memsym.fth │ ├── fake-v-asm.fth │ ├── filter.awk │ ├── parser-setup.fth │ ├── profilertest.fth │ ├── prs-cgn-test.fth │ ├── prs-cgn-test.golden │ ├── prs-def-test.fth │ ├── prs-stm-test.fth │ ├── scan-setup.fth │ ├── scanner-test.fth │ ├── scanner-test.golden │ ├── strings-test.fth │ └── tester.fth ├── tools ├── .gitignore ├── Makefile ├── ascii2petscii.c ├── bin2p00.c ├── bin2t64.c ├── cheat.h ├── openfiles.c ├── openfiles.h ├── patch-c-charset.c ├── petscii.c ├── petscii.h ├── petscii2ascii.c ├── petscii_test.c ├── striploadaddress.c ├── testdata │ ├── testshadow.d64 │ ├── testshadow.fth │ ├── testsrc.d64 │ └── testsrc.fth ├── txt2s00.c └── ufscr2file.c └── x16files ├── c-charset ├── cc64 ├── ctype.h ├── helloworld-c16.c ├── helloworld-c64.c ├── helloworld-x16.c ├── kernal-io-c16.c ├── kernal-io-c64.c ├── libc-c16.h ├── libc-c16.i ├── libc-c16.o ├── libc-c64.h ├── libc-c64.i ├── libc-c64.o ├── libc-x16.h ├── libc-x16.i ├── libc-x16.o ├── rt-c16-10-7f.h ├── rt-c16-10-7f.i ├── rt-c16-10-7f.o ├── rt-c64-08-9f.h ├── rt-c64-08-9f.i ├── rt-c64-08-9f.o ├── rt-x16-08-9e.h ├── rt-x16-08-9e.i ├── rt-x16-08-9e.o ├── sieve-c64.c ├── stdio.h ├── stdlib.h ├── string.h ├── vccc2023-c16.c ├── vccc2023-c64.c ├── vccc2023-x16.c └── vf-build-base /.gitignore: -------------------------------------------------------------------------------- 1 | *.sizes 2 | kill-9.log 3 | -------------------------------------------------------------------------------- /archived/v03/README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | cc64 v03 is deprecated and buggy. Better not do anything with it. 4 | It is just here for reference; it was the first version I published, 5 | on 6-Oct-1994, then still without sources. 6 | -------------------------------------------------------------------------------- /archived/v03/cc64v03.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v03/cc64v03.zip -------------------------------------------------------------------------------- /archived/v04/README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | cc64 v04 is deprecated and buggy. Better not do anything with it. 4 | It is just here for reference; it was the second version I published, 5 | on 3-Nov-1995, then still without sources. 6 | -------------------------------------------------------------------------------- /archived/v04/cc64v04.prg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v04/cc64v04.prg -------------------------------------------------------------------------------- /archived/v04/cc64v04.txt: -------------------------------------------------------------------------------- 1 | 2 | Hello all, 3 | 4 | this is an intermediate version of the C64 C-compiler cc64. 5 | I've fixed the worst bugs, including the 'division bug'. V0.3 6 | calculates y/x if You write x/y and y%x instead of x%y. 7 | 8 | I hope a really good version will be ready soon. 9 | 10 | Have fun. Please send any bug reports or comments to me. 11 | 12 | Philip Zembrod 13 | zem@iwm.fhg.de 14 | -------------------------------------------------------------------------------- /archived/v04/cc64v04.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v04/cc64v04.zip -------------------------------------------------------------------------------- /archived/v04/cc64v04e.prg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v04/cc64v04e.prg -------------------------------------------------------------------------------- /archived/v04/char_asm.seq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v04/char_asm.seq -------------------------------------------------------------------------------- /archived/v04/charset.prg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v04/charset.prg -------------------------------------------------------------------------------- /archived/v04/peddi02.prg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v04/peddi02.prg -------------------------------------------------------------------------------- /archived/v05/.gitignore: -------------------------------------------------------------------------------- 1 | c-chargen 2 | -------------------------------------------------------------------------------- /archived/v05/build-cc64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | basedir="$(dirname "${BASH_SOURCE[0]}")" 5 | 6 | "${basedir}/build-in-vice.sh" \ 7 | "include cc64-main.fth\nsaveall cc64v05\n" 8 | -------------------------------------------------------------------------------- /archived/v05/build-cc64pe.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | basedir="$(dirname "${BASH_SOURCE[0]}")" 5 | 6 | "${basedir}/build-in-vice.sh" \ 7 | "include cc64pe-main.fth\nsaveall cc64v05pe\n" 8 | -------------------------------------------------------------------------------- /archived/v05/build-peddi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | basedir="$(dirname "${BASH_SOURCE[0]}")" 5 | 6 | "${basedir}/build-in-vice.sh" \ 7 | "include peddi-main.fth\nsaveall peddi03\n" 8 | -------------------------------------------------------------------------------- /archived/v05/build-uf-build-base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | make uF83-382-c64.T64 5 | 6 | rm -f uf-build-base 7 | 8 | keybuf="1 drive 1 load\n1 drive 130 load 132 load\nsavesystem uf-build-base\n" 9 | 10 | x64 \ 11 | -virtualdev \ 12 | +truedrive \ 13 | -drive8type 1541 \ 14 | -drive9type 1541 \ 15 | -fs8 . \ 16 | -9 ./src/cc64src1.d64 \ 17 | -autostart "./uF83-382-c64.T64" \ 18 | -keybuf "$keybuf" \ 19 | 20 | make uf-build-base.T64 21 | -------------------------------------------------------------------------------- /archived/v05/c-char-rom-gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c-char-rom-gen -------------------------------------------------------------------------------- /archived/v05/c-charset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c-charset -------------------------------------------------------------------------------- /archived/v05/c64files.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files.d64 -------------------------------------------------------------------------------- /archived/v05/c64files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files.zip -------------------------------------------------------------------------------- /archived/v05/c64files/c-charset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/c-charset -------------------------------------------------------------------------------- /archived/v05/c64files/cc64v05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/cc64v05 -------------------------------------------------------------------------------- /archived/v05/c64files/cc64v05pe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/cc64v05pe -------------------------------------------------------------------------------- /archived/v05/c64files/helloworld.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/helloworld.c -------------------------------------------------------------------------------- /archived/v05/c64files/kernal-io.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/kernal-io.c -------------------------------------------------------------------------------- /archived/v05/c64files/peddi03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/peddi03 -------------------------------------------------------------------------------- /archived/v05/c64files/rt-c64-0801.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0XFD 0XFB 0X801 0X824 0X9CE 0XA000 0XA000 RT-C64-0801 -------------------------------------------------------------------------------- /archived/v05/c64files/rt-c64-0801.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/rt-c64-0801.i -------------------------------------------------------------------------------- /archived/v05/c64files/rt-c64-0801.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/c64files/rt-c64-0801.o -------------------------------------------------------------------------------- /archived/v05/cc64v05.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/cc64v05.T64 -------------------------------------------------------------------------------- /archived/v05/cc64v05pe.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/cc64v05pe.T64 -------------------------------------------------------------------------------- /archived/v05/devenv-uF83: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/devenv-uF83 -------------------------------------------------------------------------------- /archived/v05/devenv-uF83.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/devenv-uF83.T64 -------------------------------------------------------------------------------- /archived/v05/helloworld.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt-c64-0801.h" 3 | 4 | extern putchar() *= 0xffd2 ; 5 | 6 | int puts(s) 7 | char *s; 8 | { 9 | while(*s != 0) 10 | putchar(*s++); 11 | } 12 | 13 | main() 14 | { 15 | int i; 16 | for(i=1;i<=4;++i) 17 | { 18 | puts("hello, world!\n"); 19 | } 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /archived/v05/notdone: -------------------------------------------------------------------------------- 1 | Flag file: 2 | Build or test processes running in VICE signal that they are done 3 | by scratching this file's copy from the c64files/ dir. 4 | Corresponding build bash scripts watch for the existence of this 5 | file in c64files/ and terminate VICE after the file disappeared. 6 | -------------------------------------------------------------------------------- /archived/v05/peddi03.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/peddi03.T64 -------------------------------------------------------------------------------- /archived/v05/rt-c64-0801.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0xfd 0xfb 0x801 0x824 0x9ce 0xa000 0xa000 rt-c64-0801 2 | -------------------------------------------------------------------------------- /archived/v05/rt-c64-0801.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/rt-c64-0801.i -------------------------------------------------------------------------------- /archived/v05/rt-c64-0801.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/rt-c64-0801.o -------------------------------------------------------------------------------- /archived/v05/run-cc64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Run cc64 in VICE emulator with charset adapted for use with C 3 | # as generated by c-char-rom-gen, namely including the chars 4 | # \^_{|}~ needed by C. 5 | 6 | set -e 7 | 8 | cc64="$1" 9 | if test -z "$cc64" 10 | then 11 | cc64="cc64v05" 12 | fi 13 | 14 | x64 \ 15 | -virtualdev \ 16 | +truedrive \ 17 | -drive8type 1541 \ 18 | -fs8 c64files \ 19 | -chargen c-chargen \ 20 | -symkeymap ./x11_sym_uf_de.vkm \ 21 | -keymap 2 \ 22 | -autostart "$cc64".T64 \ 23 | -------------------------------------------------------------------------------- /archived/v05/run-devenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Run ultraForth development environment aka uF with editor and tools, 3 | # in VICE emulator with charset adapted for use with C as generated 4 | # by c-char-rom-gen, namely including the chars \^_{|}~ needed by C. 5 | 6 | set -e 7 | 8 | x64 \ 9 | -virtualdev \ 10 | +truedrive \ 11 | -drive8type 1541 \ 12 | -drive9type 1541 \ 13 | -drive10type 1541 \ 14 | -drive11type 1541 \ 15 | -fs8 . \ 16 | -9 ./src/cc64src1.d64 \ 17 | -10 ./src/cc64src2.d64 \ 18 | -11 ./src/peddi_src.d64 \ 19 | -chargen c-chargen \ 20 | -symkeymap ./x11_sym_uf_de.vkm \ 21 | -keymap 2 \ 22 | -autostart devenv-uF83.T64 \ 23 | 24 | -------------------------------------------------------------------------------- /archived/v05/src/cc64/2words.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 129, Hexblock 81 2 | 3 | \ 2! 2@ 2variable 2constant clv12may94pz 4 | 5 | ~ Code 2! ( d adr --) 6 | tya setup jsr 3 # ldy 7 | [[ SP )Y lda N )Y sta dey 0< ?] 8 | 1 # ldy Poptwo jmp end-code 9 | 10 | ~ Code 2@ ( adr -- d) 11 | SP X) lda N sta SP )Y lda N 1+ sta 12 | SP 2dec 3 # ldy 13 | [[ N )Y lda SP )Y sta dey 0< ?] 14 | xyNext jmp end-code 15 | 16 | ~ : 2Variable ( --) Create 4 allot ; 17 | ( -- adr) 18 | 19 | ~ : 2Constant ( d --) Create , , 20 | Does> ( -- d) 2@ ; 21 | -------------------------------------------------------------------------------- /archived/v05/src/cc64/codeoutput.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 77, Hexblock 4d 2 | 3 | \ codeoutput: flushcode/static 11sep94pz 4 | 5 | make flushcode ( -- ) 6 | code-file fsetout 7 | code[ pc >codeadr over - fputs 8 | funset clearcode ; 9 | 10 | make flushstatic ( -- ) 11 | static-file fsetout 12 | static[ static> @ over - fputs 13 | static[ static> @ - static-offset +! 14 | funset clearstatic ; 15 | 16 | \ noch schlecht modularisiert: 17 | \ greift auf interne worte des 18 | \ codehandlers zurueck. 19 | -------------------------------------------------------------------------------- /archived/v05/src/cc64/init.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 10, Hexblock a 2 | 3 | \ init 18apr94pz 4 | 5 | | variable inits inits off 6 | 7 | ~ : init ( -- ) 8 | inits BEGIN @ ?dup WHILE 9 | dup 2+ perform REPEAT ; 10 | 11 | ~ : init: ( name ) 12 | inits BEGIN dup @ WHILE @ REPEAT 13 | here swap ! 0 , ' , ; 14 | -------------------------------------------------------------------------------- /archived/v05/src/cc64/savesystem.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 8, Hexblock 8 2 | 3 | \ savesystem 12apr20pz 4 | 5 | cr .( savesystem ) cr 6 | 7 | | : (savsys ( adr len -- ) 8 | [ Assembler ] Next [ Forth ] 9 | ['] pause dup push ! \ singletask 10 | i/o push i/o off bustype ; 11 | 12 | ~ : savesystem \ name muss folgen 13 | save dev 2 busopen 0 parse bustype 14 | " ,p,w" count bustype busoff 15 | dev 2 busout origin $17 - 16 | dup $100 u/mod swap bus! bus! 17 | here over - (savsys busoff 18 | dev 2 busclose 19 | 0 (drv ! derror? abort" save-error" ; 20 | -------------------------------------------------------------------------------- /archived/v05/src/cc64/strtab.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 9, Hexblock 9 2 | 3 | \ stringtabellen 30sep90pz 4 | 5 | | variable n 6 | | variable m 7 | 8 | ~ : x ( -- ) n @ 1 n +! constant ; 9 | ~ : x" ( -- ) here m @ ! here m ! 10 | 2 allot [compile] ," ; 11 | 12 | here 0 , | constant nil 13 | here nil , ," end of table" 14 | | constant void 15 | 16 | ~ : stringtab ( -- ) 17 | create here m ! 2 allot 0 n ! 18 | does> ( -- 1.adr ) @ ; 19 | ~ : endtab ( -- ) nil m @ ! ; 20 | 21 | ~ : >string ( adr -- str ) 2+ ; 22 | ~ : +string ( adr1 -- adr2/0 ) @ ; 23 | ~ : string[] ( tab n -- adr ) 24 | 0 ?DO +string ?dup 0= IF void THEN 25 | LOOP ; 26 | -------------------------------------------------------------------------------- /archived/v05/src/cc64/trns6502asm.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 120, Hexblock 78 2 | 3 | \ transient Assembler c09may94pz 4 | 5 | \ needs code 1 +load 6 | 7 | 8 | \ *** Block No. 121, Hexblock 79 9 | 10 | \ Forth-6502 Assembler 20sep94pz 11 | \ Basis: Forth Dimensions VOL III No. 5) 12 | 13 | cr .( transient forth assembler) cr 14 | 15 | here $800 hallot heap dp ! 16 | 17 | Onlyforth Assembler also definitions 18 | include 6502asm.fth \ 1 7 +thru 19 | 20 | \ : .blk ( -) blk @ ?dup 21 | \ IF ." Blk " u. ?cr THEN ; 22 | \ ' .blk Is .status 23 | 24 | \ : rr ." error in scr " scr @ . 25 | \ ." at position " r# @ . cr ; 26 | 27 | dp ! 28 | 29 | Onlyforth 30 | -------------------------------------------------------------------------------- /archived/v05/src/cc64src1.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/src/cc64src1.d64 -------------------------------------------------------------------------------- /archived/v05/src/cc64src2.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/src/cc64src2.d64 -------------------------------------------------------------------------------- /archived/v05/src/peddi_src.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/src/peddi_src.d64 -------------------------------------------------------------------------------- /archived/v05/tests/add.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /archived/v05/tests/compile.fth: -------------------------------------------------------------------------------- 1 | 2 | 3 | also shell 4 | 5 | cc helloworld.c 6 | 7 | dos s0:notdone 8 | -------------------------------------------------------------------------------- /archived/v05/tests/debug-in-vice.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | basedir="$(dirname "${BASH_SOURCE[0]}")" 5 | 6 | run="" 7 | if [ -n "$1" ] 8 | then 9 | autostart="${basedir}/$1.T64" 10 | run="-autostart $autostart" 11 | fi 12 | 13 | x64 \ 14 | -virtualdev \ 15 | +truedrive \ 16 | -drive8type 1541 \ 17 | -fs8 "${basedir}/c64files" \ 18 | -chargen "${basedir}/../c-chargen" \ 19 | -symkeymap "${basedir}/../x11_sym_uf_de.vkm" \ 20 | -keymap 2 \ 21 | $run 22 | -------------------------------------------------------------------------------- /archived/v05/tests/div.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /archived/v05/tests/do.golden: -------------------------------------------------------------------------------- 1 | Before false-condition do loop 2 | This should be printed once. 3 | After false-condition do loop 4 | Before 4-iteration do loop 5 | Iteration 4 6 | Iteration 3 7 | Iteration 2 8 | Iteration 1 9 | After 4-iteration do loop 10 | Before 3-2-iteration nested do loops 11 | Outer iteration 3 12 | Inner iteration 3 , 2 13 | Inner iteration 3 , 1 14 | Outer iteration 2 15 | Outer iteration 1 16 | Inner iteration 1 , 2 17 | After 3-2-iteration nested do loops 18 | No assert failed. 19 | -------------------------------------------------------------------------------- /archived/v05/tests/for.golden: -------------------------------------------------------------------------------- 1 | Before no-iteration for loop 2 | After no-iteration for loop 3 | Before 4-iteration for loop 4 | Iteration 5 5 | Iteration 6 6 | Iteration 7 7 | Iteration 8 8 | After 4-iteration backward for loop 9 | Before 3-iteration backward for loop 10 | Iteration -17 11 | Iteration -18 12 | Iteration -19 13 | After 3-iteration backward for loop 14 | Before 3-2-iteration nested for loops 15 | Outer iteration 1 16 | Inner iteration 1 , 2 17 | Inner iteration 1 , 8 18 | Outer iteration 3 19 | Outer iteration 5 20 | Inner iteration 5 , 2 21 | Inner iteration 5 , 8 22 | After 3-2-iteration nested for loops 23 | No assert failed. 24 | -------------------------------------------------------------------------------- /archived/v05/tests/forward-test.c: -------------------------------------------------------------------------------- 1 | 2 | extern forward_declared(); 3 | 4 | int prototype_address; 5 | int final_address; 6 | 7 | middle_function(i) 8 | int i; 9 | { 10 | prototype_address = forward_declared; 11 | forward_declared(i); 12 | } 13 | 14 | forward_declared(i) 15 | int i; 16 | { 17 | print("forward "); println(itoa(i)); 18 | } 19 | 20 | forward_test() 21 | { 22 | final_address = forward_declared; 23 | middle_function(1); 24 | forward_declared(2); 25 | 26 | assertTrue(prototype_address - middle_function < 0, 27 | "prototype function address < muddle function address"); 28 | assertTrue(final_address - middle_function > 0, 29 | "final function address > muddle function address"); 30 | 31 | evaluateAsserts(); 32 | } 33 | -------------------------------------------------------------------------------- /archived/v05/tests/forward.golden: -------------------------------------------------------------------------------- 1 | forward 1 2 | forward 2 3 | No assert failed. 4 | -------------------------------------------------------------------------------- /archived/v05/tests/helloworld-test.c: -------------------------------------------------------------------------------- 1 | 2 | helloworld_test() 3 | { 4 | println("hello, world!"); 5 | } 6 | -------------------------------------------------------------------------------- /archived/v05/tests/helloworld.golden: -------------------------------------------------------------------------------- 1 | hello, world! 2 | -------------------------------------------------------------------------------- /archived/v05/tests/helloworld3-test.c: -------------------------------------------------------------------------------- 1 | 2 | helloworld3_test() 3 | { 4 | int i; 5 | for(i=1;i<=3;++i) 6 | { 7 | println("hello, world!"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /archived/v05/tests/helloworld3.golden: -------------------------------------------------------------------------------- 1 | hello, world! 2 | hello, world! 3 | hello, world! 4 | -------------------------------------------------------------------------------- /archived/v05/tests/itoa-test.c: -------------------------------------------------------------------------------- 1 | 2 | itoa_test() 3 | { 4 | println(itoa(13)); 5 | println(itoa(0)); 6 | println(itoa(100)); 7 | println(itoa(-12345)); 8 | println(itoa(32767)); 9 | println(itoa(-32767)); 10 | println(itoa(-0)); 11 | println(itoa(-32768)); 12 | } 13 | -------------------------------------------------------------------------------- /archived/v05/tests/itoa.golden: -------------------------------------------------------------------------------- 1 | 13 2 | 0 3 | 100 4 | -12345 5 | 32767 6 | -32767 7 | 0 8 | -32768 9 | -------------------------------------------------------------------------------- /archived/v05/tests/mod.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /archived/v05/tests/mult.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /archived/v05/tests/partialfor.golden: -------------------------------------------------------------------------------- 1 | Before no-iteration for loop 2 | After no-iteration for loop 3 | Before for(;;) loop 4 | Iteration 3 5 | Iteration 2 6 | Iteration 1 7 | After for(;;) loop 8 | Before for(;;--i) loop 9 | Iteration 2 10 | Iteration 1 11 | Iteration 0 12 | After for(;;--i) loop 13 | Before for(;i;) loop 14 | Iteration 3 15 | Iteration 2 16 | Iteration 1 17 | After for(;i;) loop 18 | Before for(i = 3;;) loop 19 | Iteration 3 20 | Iteration 2 21 | Iteration 1 22 | After for(i = 3;;) loop 23 | No assert failed. 24 | -------------------------------------------------------------------------------- /archived/v05/tests/peddi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test_results = $(patsubst %.golden, %-result.txt,$(wildcard *.golden)) 3 | pe_test_results = $(patsubst %.golden, %-result-pe.txt,$(wildcard *.golden)) 4 | 5 | tests: separate-tests.result separate-pe-tests.result 6 | 7 | separate-tests.result: $(test_results) 8 | cat $^ >$@ 9 | 10 | separate-pe-tests.result: $(pe_test_results) 11 | cat $^ >$@ 12 | 13 | $(test_results) suite.result: ../../peddi03.T64 *.sh 14 | 15 | $(test_results): %-result.txt: %.keybuf %.golden 16 | ./run-test.sh $* 17 | 18 | $(pe_test_results): %-result-pe.txt: %.keybuf %.golden 19 | ./run-test.sh $* cc64v05pe 20 | mv $*-result.txt $*-result-pe.txt 21 | 22 | clean: 23 | rm -f c64files/* c64files/.??* 24 | rm -f separate-tests.result separate-pe-tests.result tmp.result 25 | rm -f *.out *-result.txt *-result-pe.txt 26 | -------------------------------------------------------------------------------- /archived/v05/tests/peddi/editfile.keybuf: -------------------------------------------------------------------------------- 1 | \x1d\x1d\x1d\x1d\x1d\x1d insert 2 | \x11\x11\x11\x11 3 | \x1d\x1d\x1d\x1d\x1d hello 4 | \x91\x91 5 | \x9d\x9d\x9d\x9d\x9d\x9d\x9d\x9d 6 | \x9d\x9d\x9d\x9d\x9d\x9d\x9d\x9d 7 | world 8 | \x11\x11\x11\x11\x11\x11\x11\x11 9 | \x14\x14\x14 10 | COL 11 | \x11\n 12 | \x88 13 | 20 lines down. 14 | \x91\x91\x91\x91\x91\x91\x91\x91\x91\x91\x91\x91 15 | \x1d\x1d\x1d\x1d 16 | . 17 | \x11\x01 18 | a 19 | \x05 20 | e 21 | \x8d\x85\x85 22 | \x11\x11\x11\x11\x11\x11\x11\x11 23 | \x04 24 | \x85\x88\x91\x91 25 | \x10 26 | \x91\x91 27 | \x94 28 | \x18 29 | -------------------------------------------------------------------------------- /archived/v05/tests/peddi/helloworld.golden: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | This is peddi. 3 | -------------------------------------------------------------------------------- /archived/v05/tests/peddi/helloworld.keybuf: -------------------------------------------------------------------------------- 1 | Hello, world!\n 2 | This is peddi.\x18 3 | -------------------------------------------------------------------------------- /archived/v05/tests/peddi/run-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run peddi with script 4 | rm -f c64files/"$1".txt "$1".txt 5 | if [ -f "$1.before" ] 6 | then 7 | ascii2petscii "$1.before" c64files/"$1".txt 8 | fi 9 | ./run-peddi.sh "$(printf "ed ${1}.txt\n\ 10 | $(sed -e 's/\\/\\\\/g' ${1}.keybuf | tr -d '\n')")" 11 | petscii2ascii c64files/"$1".txt "$1".out 12 | 13 | # Evaluate test output 14 | echo "Test: $1" > tmp.result 15 | diff "$1".golden "$1".out >> tmp.result 16 | result=$? 17 | test $result -eq 0 \ 18 | && echo "PASS: $1" >> tmp.result \ 19 | || echo "FAIL: $1" >> tmp.result 20 | cat tmp.result 21 | mv tmp.result "$1"-result.txt 22 | exit $result 23 | -------------------------------------------------------------------------------- /archived/v05/tests/peddi/widelines.keybuf: -------------------------------------------------------------------------------- 1 | \x18 2 | -------------------------------------------------------------------------------- /archived/v05/tests/run-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Build test binary 4 | echo "char *name(){ return \"$1.out,s,w\"; } test(){ ${1}_test (); }" \ 5 | | cat test-setup.h "$1"-test.c - test-main.h \ 6 | | tee "$1"-generated.c \ 7 | | ascii2petscii - c64files/"$1".c 8 | rm -f c64files/"$1" "$1".T64 9 | ./compile-in-vice.sh "cc "$1".c\ndos s0:notdone\n" 10 | bin2t64 c64files/"$1" "$1".T64 11 | 12 | # Run test binary 13 | rm -f c64files/"$1".out "$1".out 14 | ./test-in-vice.sh "$1" 15 | petscii2ascii c64files/"$1".out "$1".out 16 | 17 | # Evaluate test output 18 | echo "Test: $1" > tmp.result 19 | diff "$1".golden "$1".out >> tmp.result 20 | result=$? 21 | test $result -eq 0 \ 22 | && echo "PASS: $1" >> tmp.result \ 23 | || echo "FAIL: $1" >> tmp.result 24 | cat tmp.result 25 | mv tmp.result "$1"-result.txt 26 | exit $result 27 | -------------------------------------------------------------------------------- /archived/v05/tests/shift-test.c: -------------------------------------------------------------------------------- 1 | 2 | shift_test() { 3 | assertEq(1 << 0, 1, "1 << 0"); 4 | assertEq(1 >> 0, 1, "1 >> 0"); 5 | assertEq(-1 << 0, -1, "-1 << 0"); 6 | assertEq(-1 >> 0, -1, "-1 >> 0"); 7 | assertEq(1 << 1, 2, "1 << 1"); 8 | assertEq(1 >> 1, 0, "1 >> 1"); 9 | assertEq(-1 << 1, -2, "-1 << 1"); 10 | assertEq(-1 >> 1, -1, "-1 >> 1"); 11 | assertEq(2 << 1, 4, "2 << 1"); 12 | assertEq(2 >> 1, 1, "2 >> 1"); 13 | assertEq(-2 << 1, -4, "-2 << 1"); 14 | assertEq(-2 >> 1, -1, "-2 >> 1"); 15 | assertEq(10 << 5, 320, "10 << 5"); 16 | assertEq(320 >> 5, 10, "320 >> 5"); 17 | assertEq(-10 << 5, -320, "-10 << 5"); 18 | assertEq(-320 >> 5, -10, "-320 >> 5"); 19 | assertEq(1 << 14, 16384, "1 << 14"); 20 | assertEq(-1 << 14, -16384, "-1 << 14"); 21 | evaluateAsserts(); 22 | } 23 | -------------------------------------------------------------------------------- /archived/v05/tests/shift.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /archived/v05/tests/sub.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /archived/v05/tests/switch-test.c: -------------------------------------------------------------------------------- 1 | 2 | switch_test() { 3 | int i; 4 | 5 | for (i = 0; i < 10; ++i) { 6 | switch(i) { 7 | case 1: 8 | print(itoa(i)); 9 | println(": i is one."); 10 | break; 11 | case 3: 12 | print(itoa(i)); 13 | println(": i is three."); 14 | /* fall-through */ 15 | case 7: 16 | print(itoa(i)); 17 | println(": i is three or seven."); 18 | break; 19 | default: 20 | print(itoa(i)); 21 | println(": i is something else."); 22 | break; 23 | case 8: 24 | print(itoa(i)); 25 | println(": i is eight."); 26 | break; 27 | } 28 | } 29 | evaluateAsserts(); 30 | } 31 | -------------------------------------------------------------------------------- /archived/v05/tests/switch.golden: -------------------------------------------------------------------------------- 1 | 0: i is something else. 2 | 1: i is one. 3 | 2: i is something else. 4 | 3: i is three. 5 | 3: i is three or seven. 6 | 4: i is something else. 7 | 5: i is something else. 8 | 6: i is something else. 9 | 7: i is three or seven. 10 | 8: i is eight. 11 | 9: i is something else. 12 | No assert failed. 13 | -------------------------------------------------------------------------------- /archived/v05/tests/test-main.h: -------------------------------------------------------------------------------- 1 | 2 | main() 3 | { 4 | int i; 5 | _open(1,8,2, name()); 6 | _chkout(1); 7 | test(); 8 | if (failedAsserts) { 9 | println("Some test didn't evaluate its asserts."); 10 | } 11 | _clrchn(); 12 | _close(1); 13 | } 14 | -------------------------------------------------------------------------------- /archived/v05/tests/while.golden: -------------------------------------------------------------------------------- 1 | Before no-iteration while loop 2 | After no-iteration while loop 3 | Before 4-iteration while loop 4 | Iteration 4 5 | Iteration 3 6 | Iteration 2 7 | Iteration 1 8 | After 4-iteration while loop 9 | Before 3-2-iteration nested while loops 10 | Outer iteration 3 11 | Inner iteration 3 , 2 12 | Inner iteration 3 , 1 13 | Outer iteration 2 14 | Outer iteration 1 15 | Inner iteration 1 , 2 16 | After 3-2-iteration nested while loops 17 | No assert failed. 18 | -------------------------------------------------------------------------------- /archived/v05/uF83-382-c64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/uF83-382-c64 -------------------------------------------------------------------------------- /archived/v05/uF83-382-c64.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/uF83-382-c64.T64 -------------------------------------------------------------------------------- /archived/v05/uf-build-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/uf-build-base -------------------------------------------------------------------------------- /archived/v05/uf-build-base.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/archived/v05/uf-build-base.T64 -------------------------------------------------------------------------------- /autostart-c16/cc64.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c16/cc64.T64 -------------------------------------------------------------------------------- /autostart-c16/cc64pe.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c16/cc64pe.T64 -------------------------------------------------------------------------------- /autostart-c16/peddi.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c16/peddi.T64 -------------------------------------------------------------------------------- /autostart-c16/vf-build-base.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c16/vf-build-base.T64 -------------------------------------------------------------------------------- /autostart-c64/cc64.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/cc64.T64 -------------------------------------------------------------------------------- /autostart-c64/cc64pe.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/cc64pe.T64 -------------------------------------------------------------------------------- /autostart-c64/cc64pftm.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/cc64pftm.T64 -------------------------------------------------------------------------------- /autostart-c64/cc64prof.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/cc64prof.T64 -------------------------------------------------------------------------------- /autostart-c64/cc64time.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/cc64time.T64 -------------------------------------------------------------------------------- /autostart-c64/devenv-uF83.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/devenv-uF83.T64 -------------------------------------------------------------------------------- /autostart-c64/peddi.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/peddi.T64 -------------------------------------------------------------------------------- /autostart-c64/vf-build-base.T64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/autostart-c64/vf-build-base.T64 -------------------------------------------------------------------------------- /bin-size-register/c16-cc64.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2223 32374 c16files/cc64 v0.9 2 | 2021-05-08-2237 32379 c16files/cc64 bumped version v0.9 to v0.10-dev 3 | 2021-05-27-1901 32525 c16files/cc64 ANSI style function declarations plus some bug fixes. 4 | 2021-06-02-1439 32433 c16files/cc64 enabled non-constant initializers of non-static local vars 5 | 2021-06-18-1106 32558 c16files/cc64 added memory overflow check in pass2 6 | 2021-09-05-1621 32558 c16files/cc64 compiler fixes applied while porting pdclib 7 | 2021-12-19-2235 32600 c16files/cc64 fastcall declarations and function pointers implemented 8 | 2021-12-22-2332 32608 c16files/cc64 v0.10 release 9 | 2022-08-28-2139 32661 c16files/cc64 v0.11 release 10 | 2023-12-04-2255 32661 c16files/cc64 v0.12 release 11 | 2024-07-18-2201 32613 c16files/cc64 v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/c16-cc64pe.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2223 36116 c16files/cc64pe v0.9 2 | 2021-05-08-2238 36120 c16files/cc64pe bumped version v0.9 to v0.10-dev 3 | 2021-05-13-1823 36226 c16files/cc64pe ANSI style function declarations plus some bug fixes. 4 | 2021-06-02-1440 36174 c16files/cc64pe enabled non-constant initializers of non-static local vars 5 | 2021-06-18-1106 36300 c16files/cc64pe added memory overflow check in pass2 6 | 2021-09-05-1622 36300 c16files/cc64pe compiler fixes applied while porting pdclib 7 | 2021-12-19-2235 36340 c16files/cc64pe fastcall declarations and function pointers implemented 8 | 2021-12-22-2333 36348 c16files/cc64pe v0.10 release 9 | 2022-08-28-2140 36402 c16files/cc64pe v0.11 release 10 | 2023-12-04-2255 36402 c16files/cc64pe v0.12 release 11 | 2024-07-18-2202 36355 c16files/cc64pe v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/c16-peddi.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2223 18686 c16files/peddi v0.9 2 | 2021-05-08-2238 18691 c16files/peddi bumped version v0.9 to v0.10-dev 3 | 2021-05-08-2238 18691 c16files/peddi ANSI style function declarations plus some bug fixes. 4 | 2021-05-08-2238 18691 c16files/peddi enabled non-constant initializers of non-static local vars 5 | 2021-06-05-2251 18691 c16files/peddi added memory overflow check in pass2 6 | 2021-09-05-1622 18691 c16files/peddi compiler fixes applied while porting pdclib 7 | 2021-09-24-1009 18691 c16files/peddi fastcall declarations and function pointers implemented 8 | 2021-12-22-2333 18687 c16files/peddi v0.10 release 9 | 2022-08-28-2140 18736 c16files/peddi v0.11 release 10 | 2023-12-04-2255 18736 c16files/peddi v0.12 release 11 | 2024-07-18-2202 18732 c16files/peddi v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/c64-cc64.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2222 32306 c64files/cc64 v0.9 2 | 2021-05-08-2236 32311 c64files/cc64 bumped version v0.9 to v0.10-dev 3 | 2021-05-27-1856 32456 c64files/cc64 ANSI style function declarations plus some bug fixes. 4 | 2021-06-02-1423 32366 c64files/cc64 enabled non-constant initializers of non-static local vars 5 | 2021-06-18-1105 32486 c64files/cc64 added memory overflow check in pass2 6 | 2021-09-05-1621 32486 c64files/cc64 compiler fixes applied while porting pdclib 7 | 2021-12-19-2234 32526 c64files/cc64 fastcall declarations and function pointers implemented 8 | 2021-12-22-2332 32539 c64files/cc64 v0.10 release 9 | 2022-08-28-2139 32571 c64files/cc64 v0.11 release 10 | 2023-12-04-2253 32571 c64files/cc64 v0.12 release 11 | 2024-07-18-2201 32527 c64files/cc64 v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/c64-cc64pe.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2222 36050 c64files/cc64pe v0.9 2 | 2021-05-08-2236 36054 c64files/cc64pe bumped version v0.9 to v0.10-dev 3 | 2021-05-13-1822 36156 c64files/cc64pe ANSI style function declarations plus some bug fixes. 4 | 2021-06-02-1439 36110 c64files/cc64pe enabled non-constant initializers of non-static local vars 5 | 2021-06-18-1105 36229 c64files/cc64pe added memory overflow check in pass2 6 | 2021-09-05-1621 36229 c64files/cc64pe compiler fixes applied while porting pdclib 7 | 2021-12-19-2234 36270 c64files/cc64pe fastcall declarations and function pointers implemented 8 | 2021-12-22-2332 36282 c64files/cc64pe v0.10 release 9 | 2022-08-28-2139 36314 c64files/cc64pe v0.11 release 10 | 2023-12-04-2254 36314 c64files/cc64pe v0.12 release 11 | 2024-07-18-2201 36270 c64files/cc64pe v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/c64-cc64pftm.sizes: -------------------------------------------------------------------------------- 1 | 2021-09-05-1301 36225 c64files/cc64pftm compiler fixes applied while porting pdclib 2 | 2021-12-19-0013 36398 c64files/cc64pftm fastcall declarations and function pointers implemented 3 | 2021-12-21-1615 36368 c64files/cc64pftm v0.10 release 4 | 2022-08-28-2050 36399 c64files/cc64pftm v0.11 release 5 | 2023-12-04-2254 36374 c64files/cc64pftm v0.12 release 6 | 2024-07-18-2216 36529 c64files/cc64pftm v0.13 release 7 | -------------------------------------------------------------------------------- /bin-size-register/c64-cc64prof.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2222 35945 c64files/cc64prof v0.9 2 | 2021-05-08-2237 35950 c64files/cc64prof bumped version v0.9 to v0.10-dev 3 | 2021-05-13-1823 36054 c64files/cc64prof ANSI style function declarations plus some bug fixes. 4 | 2021-06-02-1439 36007 c64files/cc64prof enabled non-constant initializers of non-static local vars 5 | 2021-06-18-1105 36127 c64files/cc64prof added memory overflow check in pass2 6 | 2021-09-05-1620 36211 c64files/cc64prof compiler fixes applied while porting pdclib 7 | 2021-12-19-2237 36339 c64files/cc64prof fastcall declarations and function pointers implemented 8 | 2021-12-22-2334 36349 c64files/cc64prof v0.10 release 9 | 2022-08-28-2152 36382 c64files/cc64prof v0.11 release 10 | 2023-12-04-2254 36352 c64files/cc64prof v0.12 release 11 | 2024-07-18-2202 36517 c64files/cc64prof v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/c64-cc64time.sizes: -------------------------------------------------------------------------------- 1 | 2021-09-05-1143 32675 c64files/cc64time compiler fixes applied while porting pdclib 2 | 2021-12-19-0012 32755 c64files/cc64time fastcall declarations and function pointers implemented 3 | 2021-12-21-1614 32726 c64files/cc64time v0.10 release 4 | 2022-08-28-2050 32755 c64files/cc64time v0.11 release 5 | 2023-12-04-2254 32755 c64files/cc64time v0.12 release 6 | 2024-07-18-2216 32848 c64files/cc64time v0.13 release 7 | -------------------------------------------------------------------------------- /bin-size-register/c64-peddi.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2222 18618 c64files/peddi v0.9 2 | 2021-05-08-2236 18623 c64files/peddi bumped version v0.9 to v0.10-dev 3 | 2021-05-08-2236 18623 c64files/peddi ANSI style function declarations plus some bug fixes. 4 | 2021-05-08-2236 18623 c64files/peddi enabled non-constant initializers of non-static local vars 5 | 2021-06-05-2250 18623 c64files/peddi added memory overflow check in pass2 6 | 2021-09-05-1621 18623 c64files/peddi compiler fixes applied while porting pdclib 7 | 2021-09-24-1008 18623 c64files/peddi fastcall declarations and function pointers implemented 8 | 2021-12-22-2332 18619 c64files/peddi v0.10 release 9 | 2022-08-28-2139 18651 c64files/peddi v0.11 release 10 | 2023-12-04-2254 18651 c64files/peddi v0.12 release 11 | 2024-07-18-2202 18647 c64files/peddi v0.13 release 12 | -------------------------------------------------------------------------------- /bin-size-register/x16-cc64.sizes: -------------------------------------------------------------------------------- 1 | 2021-05-08-2224 32380 x16files/cc64 v0.9 2 | 2021-05-08-2238 32385 x16files/cc64 bumped version v0.9 to v0.10-dev 3 | 2021-05-13-1822 32486 x16files/cc64 ANSI style function declarations plus some bug fixes. 4 | 2021-06-02-1440 32441 x16files/cc64 enabled non-constant initializers of non-static local vars 5 | 2021-06-18-1107 32562 x16files/cc64 added memory overflow check in pass2 6 | 2021-09-05-1623 32565 x16files/cc64 compiler fixes applied while porting pdclib 7 | 2021-12-19-2236 32601 x16files/cc64 fastcall declarations and function pointers implemented 8 | 2021-12-22-2334 32611 x16files/cc64 v0.10 release 9 | 2022-08-28-2141 32560 x16files/cc64 v0.11 release 10 | 2023-12-04-2256 32562 x16files/cc64 v0.12 release 11 | 2024-07-18-2200 32463 x16files/cc64 v0.13 release 12 | -------------------------------------------------------------------------------- /c16files/c-charset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/c-charset -------------------------------------------------------------------------------- /c16files/cc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/cc64 -------------------------------------------------------------------------------- /c16files/cc64pe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/cc64pe -------------------------------------------------------------------------------- /c16files/ctype.h: -------------------------------------------------------------------------------- 1 | EXTERN _FASTCALL INT ISDIGIT(INT C); EXTERN _FASTCALL INT ISALNUM(INT C); EXTERN _FASTCALL INT ISALPHA(INT C); EXTERN _FASTCALL INT ISSPACE(INT C); EXTERN _FASTCALL INT ISLOWER(INT C); EXTERN _FASTCALL INT ISUPPER(INT C); EXTERN _FASTCALL INT TOLOWER(INT C); EXTERN _FASTCALL INT TOUPPER(INT C); -------------------------------------------------------------------------------- /c16files/helloworld-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/helloworld-c16.c -------------------------------------------------------------------------------- /c16files/helloworld-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/helloworld-c64.c -------------------------------------------------------------------------------- /c16files/helloworld-x16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/helloworld-x16.c -------------------------------------------------------------------------------- /c16files/kernal-io-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/kernal-io-c16.c -------------------------------------------------------------------------------- /c16files/kernal-io-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/kernal-io-c64.c -------------------------------------------------------------------------------- /c16files/libc-c16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c16.h -------------------------------------------------------------------------------- /c16files/libc-c16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c16.i -------------------------------------------------------------------------------- /c16files/libc-c16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c16.o -------------------------------------------------------------------------------- /c16files/libc-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c64.c -------------------------------------------------------------------------------- /c16files/libc-c64.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c64.h -------------------------------------------------------------------------------- /c16files/libc-c64.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c64.i -------------------------------------------------------------------------------- /c16files/libc-c64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-c64.o -------------------------------------------------------------------------------- /c16files/libc-x16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-x16.h -------------------------------------------------------------------------------- /c16files/libc-x16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-x16.i -------------------------------------------------------------------------------- /c16files/libc-x16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/libc-x16.o -------------------------------------------------------------------------------- /c16files/peddi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/peddi -------------------------------------------------------------------------------- /c16files/rt-c16-10-7f.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0X22 0X24 0X1001 0X1040 0X11EE 0X7FFE 0X8000 RT-C16-10-7F -------------------------------------------------------------------------------- /c16files/rt-c16-10-7f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/rt-c16-10-7f.i -------------------------------------------------------------------------------- /c16files/rt-c16-10-7f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/rt-c16-10-7f.o -------------------------------------------------------------------------------- /c16files/rt-c64-08-9f.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0XFD 0XFB 0X801 0X840 0X9EE 0X9FFE 0XA000 RT-C64-08-9F -------------------------------------------------------------------------------- /c16files/rt-c64-08-9f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/rt-c64-08-9f.i -------------------------------------------------------------------------------- /c16files/rt-c64-08-9f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/rt-c64-08-9f.o -------------------------------------------------------------------------------- /c16files/rt-x16-08-9e.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0X40 0X42 0X801 0X83D 0X9EB 0X9EFE 0X9F00 RT-X16-08-9E -------------------------------------------------------------------------------- /c16files/rt-x16-08-9e.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/rt-x16-08-9e.i -------------------------------------------------------------------------------- /c16files/rt-x16-08-9e.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/rt-x16-08-9e.o -------------------------------------------------------------------------------- /c16files/sieve-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/sieve-c64.c -------------------------------------------------------------------------------- /c16files/stdio.h: -------------------------------------------------------------------------------- 1 | EXTERN INT FOPEN(CHAR* FILENAME, CHAR* MODE); EXTERN _FASTCALL INT FCLOSE(INT FH); EXTERN _FASTCALL INT FGETC(INT FH); EXTERN INT FPUTC(INT C, INT FH); EXTERN CHAR* FGETS(CHAR* STR, INT COUNT, INT FH); EXTERN INT FPUTS(CHAR* STR, INT FH); EXTERN _FASTCALL INT PUTCHAR(INT C); EXTERN _FASTCALL INT PUTS(CHAR* STR); EXTERN _FASTCALL INT REMOVE(CHAR* FILENAME); EXTERN INT PRINTF(); /* (CHAR* FMTSTR, ...); */ EXTERN INT FPRINTF(); /* (INT FH, CHAR* FMTSTR, ...); */ EXTERN INT SPRINTF(); /* (CHAR* BUFFER, CHAR* FMTSTR, ...); */ -------------------------------------------------------------------------------- /c16files/stdlib.h: -------------------------------------------------------------------------------- 1 | EXTERN INT ABS(INT J); EXTERN INT ATOI(CHAR *S); EXTERN _FASTCALL INT RAND(); EXTERN _FASTCALL INT SRAND(INT SEED); -------------------------------------------------------------------------------- /c16files/string.h: -------------------------------------------------------------------------------- 1 | EXTERN CHAR *MEMCHR(CHAR *S, INT C, INT N); EXTERN INT MEMCMP(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *MEMCPY(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR MEMMOVE(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *MEMSET(CHAR* S, INT C, INT N); EXTERN CHAR *STRCAT(CHAR *S1, CHAR *S2); EXTERN CHAR *STRCHR(CHAR *S, INT C); EXTERN INT STRCMP(CHAR *S1, CHAR *S2); EXTERN CHAR *STRCPY(CHAR *S1, CHAR *S2); EXTERN INT STRCSPN(CHAR *S1, CHAR *S2); EXTERN INT STRLEN(CHAR *S); EXTERN CHAR *STRNCAT(CHAR *S1, CHAR *S2, INT N); EXTERN INT STRNCMP(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *STRNCPY(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *STRPBRK(CHAR *S1, CHAR *S2); EXTERN CHAR *STRRCHR(CHAR *S, INT C); EXTERN INT STRSPN(CHAR *S1, CHAR *S2); EXTERN CHAR *STRSTR(CHAR *S1, CHAR *S2); -------------------------------------------------------------------------------- /c16files/vccc2023-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/vccc2023-c16.c -------------------------------------------------------------------------------- /c16files/vccc2023-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/vccc2023-c64.c -------------------------------------------------------------------------------- /c16files/vccc2023-x16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/vccc2023-x16.c -------------------------------------------------------------------------------- /c16files/vf-build-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c16files/vf-build-base -------------------------------------------------------------------------------- /c64files/.cc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/.cc64 -------------------------------------------------------------------------------- /c64files/c-charset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/c-charset -------------------------------------------------------------------------------- /c64files/cc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/cc64 -------------------------------------------------------------------------------- /c64files/cc64pe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/cc64pe -------------------------------------------------------------------------------- /c64files/cc64pftm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/cc64pftm -------------------------------------------------------------------------------- /c64files/cc64prof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/cc64prof -------------------------------------------------------------------------------- /c64files/cc64time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/cc64time -------------------------------------------------------------------------------- /c64files/ctype.h: -------------------------------------------------------------------------------- 1 | EXTERN _FASTCALL INT ISDIGIT(INT C); EXTERN _FASTCALL INT ISALNUM(INT C); EXTERN _FASTCALL INT ISALPHA(INT C); EXTERN _FASTCALL INT ISSPACE(INT C); EXTERN _FASTCALL INT ISLOWER(INT C); EXTERN _FASTCALL INT ISUPPER(INT C); EXTERN _FASTCALL INT TOLOWER(INT C); EXTERN _FASTCALL INT TOUPPER(INT C); -------------------------------------------------------------------------------- /c64files/helloworld-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/helloworld-c16.c -------------------------------------------------------------------------------- /c64files/helloworld-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/helloworld-c64.c -------------------------------------------------------------------------------- /c64files/helloworld-x16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/helloworld-x16.c -------------------------------------------------------------------------------- /c64files/kernal-io-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/kernal-io-c16.c -------------------------------------------------------------------------------- /c64files/kernal-io-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/kernal-io-c64.c -------------------------------------------------------------------------------- /c64files/libc-c16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-c16.h -------------------------------------------------------------------------------- /c64files/libc-c16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-c16.i -------------------------------------------------------------------------------- /c64files/libc-c16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-c16.o -------------------------------------------------------------------------------- /c64files/libc-c64.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-c64.h -------------------------------------------------------------------------------- /c64files/libc-c64.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-c64.i -------------------------------------------------------------------------------- /c64files/libc-c64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-c64.o -------------------------------------------------------------------------------- /c64files/libc-x16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-x16.h -------------------------------------------------------------------------------- /c64files/libc-x16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-x16.i -------------------------------------------------------------------------------- /c64files/libc-x16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/libc-x16.o -------------------------------------------------------------------------------- /c64files/peddi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/peddi -------------------------------------------------------------------------------- /c64files/rt-c16-10-7f.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0X22 0X24 0X1001 0X1040 0X11EE 0X7FFE 0X8000 RT-C16-10-7F -------------------------------------------------------------------------------- /c64files/rt-c16-10-7f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/rt-c16-10-7f.i -------------------------------------------------------------------------------- /c64files/rt-c16-10-7f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/rt-c16-10-7f.o -------------------------------------------------------------------------------- /c64files/rt-c64-08-9f.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0XFD 0XFB 0X801 0X840 0X9EE 0X9FFE 0XA000 RT-C64-08-9F -------------------------------------------------------------------------------- /c64files/rt-c64-08-9f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/rt-c64-08-9f.i -------------------------------------------------------------------------------- /c64files/rt-c64-08-9f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/rt-c64-08-9f.o -------------------------------------------------------------------------------- /c64files/rt-x16-08-9e.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0X40 0X42 0X801 0X83D 0X9EB 0X9EFE 0X9F00 RT-X16-08-9E -------------------------------------------------------------------------------- /c64files/rt-x16-08-9e.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/rt-x16-08-9e.i -------------------------------------------------------------------------------- /c64files/rt-x16-08-9e.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/rt-x16-08-9e.o -------------------------------------------------------------------------------- /c64files/sieve-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/sieve-c64.c -------------------------------------------------------------------------------- /c64files/stdio.h: -------------------------------------------------------------------------------- 1 | EXTERN INT FOPEN(CHAR* FILENAME, CHAR* MODE); EXTERN _FASTCALL INT FCLOSE(INT FH); EXTERN _FASTCALL INT FGETC(INT FH); EXTERN INT FPUTC(INT C, INT FH); EXTERN CHAR* FGETS(CHAR* STR, INT COUNT, INT FH); EXTERN INT FPUTS(CHAR* STR, INT FH); EXTERN _FASTCALL INT PUTCHAR(INT C); EXTERN _FASTCALL INT PUTS(CHAR* STR); EXTERN _FASTCALL INT REMOVE(CHAR* FILENAME); EXTERN INT PRINTF(); /* (CHAR* FMTSTR, ...); */ EXTERN INT FPRINTF(); /* (INT FH, CHAR* FMTSTR, ...); */ EXTERN INT SPRINTF(); /* (CHAR* BUFFER, CHAR* FMTSTR, ...); */ -------------------------------------------------------------------------------- /c64files/stdlib.h: -------------------------------------------------------------------------------- 1 | EXTERN INT ABS(INT J); EXTERN INT ATOI(CHAR *S); EXTERN _FASTCALL INT RAND(); EXTERN _FASTCALL INT SRAND(INT SEED); -------------------------------------------------------------------------------- /c64files/string.h: -------------------------------------------------------------------------------- 1 | EXTERN CHAR *MEMCHR(CHAR *S, INT C, INT N); EXTERN INT MEMCMP(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *MEMCPY(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR MEMMOVE(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *MEMSET(CHAR* S, INT C, INT N); EXTERN CHAR *STRCAT(CHAR *S1, CHAR *S2); EXTERN CHAR *STRCHR(CHAR *S, INT C); EXTERN INT STRCMP(CHAR *S1, CHAR *S2); EXTERN CHAR *STRCPY(CHAR *S1, CHAR *S2); EXTERN INT STRCSPN(CHAR *S1, CHAR *S2); EXTERN INT STRLEN(CHAR *S); EXTERN CHAR *STRNCAT(CHAR *S1, CHAR *S2, INT N); EXTERN INT STRNCMP(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *STRNCPY(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *STRPBRK(CHAR *S1, CHAR *S2); EXTERN CHAR *STRRCHR(CHAR *S, INT C); EXTERN INT STRSPN(CHAR *S1, CHAR *S2); EXTERN CHAR *STRSTR(CHAR *S1, CHAR *S2); -------------------------------------------------------------------------------- /c64files/vccc2023-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/vccc2023-c16.c -------------------------------------------------------------------------------- /c64files/vccc2023-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/vccc2023-c64.c -------------------------------------------------------------------------------- /c64files/vccc2023-x16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/vccc2023-x16.c -------------------------------------------------------------------------------- /c64files/vf-build-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/c64files/vf-build-base -------------------------------------------------------------------------------- /cc64-c16files.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-c16files.d64 -------------------------------------------------------------------------------- /cc64-c16files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-c16files.zip -------------------------------------------------------------------------------- /cc64-c64files.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-c64files.d64 -------------------------------------------------------------------------------- /cc64-c64files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-c64files.zip -------------------------------------------------------------------------------- /cc64-x16files-sdcard.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-x16files-sdcard.zip -------------------------------------------------------------------------------- /cc64-x16files.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-x16files.d64 -------------------------------------------------------------------------------- /cc64-x16files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/cc64-x16files.zip -------------------------------------------------------------------------------- /doc/recompile-readme: -------------------------------------------------------------------------------- 1 | To recompile cc64 from sources without using the main Makefile, 2 | copy the content of this archive onto a disk, 3 | a disk or card image or into a dir mapped to an emulator drive. 4 | 5 | Load v4th-c64, v4th-c16+ or v4th-x16, depending on the platform, 6 | run it, and then type 7 | 8 | ``` 9 | include cc64-main.fth 10 | saveall cc64 11 | ``` 12 | 13 | to compile a new cc64 binary, or likewise for cc64pe and peddi. 14 | Note that peddi only runs on the C64 and C16, not on the X16. 15 | -------------------------------------------------------------------------------- /emulator/.gitignore: -------------------------------------------------------------------------------- 1 | c16-c-kernal 2 | c64-c-chargen 3 | x16-c-rom.bin 4 | -------------------------------------------------------------------------------- /emulator/Makefile: -------------------------------------------------------------------------------- 1 | 2 | sdcard.img: sdcard.sfdisk mk-sdcard.sh 3 | ./mk-sdcard.sh sdcard.sfdisk $@ 4 | 5 | clean: 6 | rm -f sdcard.img 7 | -------------------------------------------------------------------------------- /emulator/basedir.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")" 4 | -------------------------------------------------------------------------------- /emulator/c-char-rom-gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/emulator/c-char-rom-gen -------------------------------------------------------------------------------- /emulator/compile-in-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | program="${1}" 5 | 6 | test -n "${CC64HOST}" || export CC64HOST=c64 7 | test -n "${OUTFILES}" || export OUTFILES="${program} ${program}.log" 8 | 9 | emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 10 | source "${emulatordir}/basedir.shlib" 11 | hostfiles="$(realpath --relative-to="$PWD" "${basedir}/${CC64HOST}files")" 12 | 13 | rm -f "${hostfiles}/${program}.log" 14 | keybuf="logfile ${program}.log\ncc ${program}.c\nlogclose\ndos s0:notdone" 15 | 16 | export CBMFILES="${hostfiles}" 17 | "${emulatordir}/run-in-${CC64HOST}emu.sh" cc64 "${keybuf}" 18 | -------------------------------------------------------------------------------- /emulator/copy-from-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | src="$1" 6 | dst="$2" 7 | 8 | if [[ "${src}" =~ \.[io]$ ]]; then 9 | cp -p "${src}" "${dst}" 10 | exit 0 11 | fi 12 | 13 | if [[ "${src}" =~ \.[ch]$ ]] || [[ "${src}" =~ \.fth$ ]] 14 | then 15 | petscii2ascii "${src}" "${dst}" 16 | touch -r "${src}" "${dst}" 17 | exit 0 18 | fi 19 | 20 | echo "$0: Don't know how to copy ${src}" 1>&2 21 | exit 1 22 | -------------------------------------------------------------------------------- /emulator/copy-to-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | src="$1" 6 | dst="$2" 7 | dstdir="$(dirname "${dst}")" 8 | 9 | test -d "${dstdir}" || mkdir "${dstdir}" 10 | 11 | if [[ "${src}" =~ \.[io]$ ]]; then 12 | cp -p "${src}" "${dst}" 13 | exit 0 14 | fi 15 | 16 | if [[ "${src}" =~ \.[ch]$ ]] || [[ "${src}" =~ \.fth$ ]] 17 | then 18 | ascii2petscii "${src}" "${dst}" 19 | touch -r "${src}" "${dst}" 20 | exit 0 21 | fi 22 | 23 | echo "$0: Don't know how to copy ${src}" 1>&2 24 | exit 1 25 | -------------------------------------------------------------------------------- /emulator/copy-to-sd-img.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | sdcard_img="$1" 5 | shift 6 | x16dir_files=$@ 7 | 8 | emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 9 | source "${emulatordir}/basedir.shlib" 10 | x16filesdir="$(realpath --relative-to="$PWD" "${basedir}/x16files")" 11 | 12 | for asciifile in ${x16dir_files}; do 13 | # Convert base filename to PETSCII, remove trailing CR. 14 | asciibasename="$(basename "${asciifile}")" 15 | petsciifile="$(echo ${asciibasename} | ascii2petscii - |tr -d '\r')" 16 | mcopy -i "${sdcard_img}" "${asciifile}" "::${petsciifile}" 17 | done 18 | -------------------------------------------------------------------------------- /emulator/debug-in-vice.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script runs VICE in the foreground so that the VICE monitor 3 | # works which doesn't work if VICE runs in the background. 4 | set -e 5 | 6 | test -n "$PLATFORM" || export PLATFORM=c64 7 | emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 8 | source "${emulatordir}/basedir.shlib" 9 | autostartdir="$(realpath --relative-to="$PWD" "${basedir}/autostart-${PLATFORM}")" 10 | cbmfiles="$(realpath --relative-to="$PWD" "${basedir}/${PLATFORM}files")" 11 | 12 | emulator="$("${emulatordir}/which-vice.sh" "${PLATFORM}")" 13 | 14 | autostart="" 15 | if [ -n "$1" ] 16 | then 17 | autostart="-autostart ${autostartdir}/${1}.T64" 18 | fi 19 | 20 | ${emulator} \ 21 | -virtualdev \ 22 | +truedrive \ 23 | -drive8type 1541 \ 24 | -fs8 "${basedir}/${cbmfiles}" \ 25 | $autostart 26 | -------------------------------------------------------------------------------- /emulator/mk-sdcard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | sfdisk="${1}" 5 | img="${2}" 6 | 7 | rm -f "${img}" "${img}.tmp" 8 | dd if=/dev/zero of="${img}.tmp" count=64 bs=1M 9 | sfdisk -w always -W always "${img}.tmp" < "${sfdisk}" 10 | mformat -i "${img}.tmp" -F 11 | mv "${img}.tmp" "${img}" 12 | -------------------------------------------------------------------------------- /emulator/notdone: -------------------------------------------------------------------------------- 1 | Flag file: 2 | Build or test processes running in VICE signal that they are done 3 | by scratching this file's copy from the c64files/ dir. 4 | Corresponding build bash scripts watch for the existence of this 5 | file in c64files/ and terminate VICE after the file disappeared. 6 | -------------------------------------------------------------------------------- /emulator/run-in-c16emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 5 | 6 | PLATFORM=c16 "${emulatordir}/run-in-vice.sh" "$1" "$2" 7 | -------------------------------------------------------------------------------- /emulator/run-in-c64emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 5 | 6 | PLATFORM=c64 "${emulatordir}/run-in-vice.sh" "$1" "$2" 7 | -------------------------------------------------------------------------------- /emulator/sdcard.sfdisk: -------------------------------------------------------------------------------- 1 | label: dos 2 | label-id: 0x00000000 3 | device: emulator/my-image.fat 4 | unit: sectors 5 | 6 | emulator/my-image.fat1 : start= 1, size= 131040, type=c, bootable 7 | -------------------------------------------------------------------------------- /emulator/which-vice.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | emulatordir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" 5 | 6 | platform="$1" 7 | case "$platform" in 8 | "c64") 9 | echo x64 -chargen ${emulatordir}/c64-c-chargen \ 10 | -symkeymap ${emulatordir}/x11_sym_c64_vf_de.vkm -keymap 2 11 | ;; 12 | "c16") 13 | echo xplus4 -kernal ${emulatordir}/c16-c-kernal \ 14 | -symkeymap ${emulatordir}/x11_sym_c16_vf_de.vkm -keymap 2 15 | ;; 16 | *) 17 | echo "Unknown platform '$platform'" 1>&2 18 | echo "xunknown-emulator" 19 | exit 1 20 | ;; 21 | esac 22 | -------------------------------------------------------------------------------- /emulator/which-x16emu-rom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 5 | source "${emulatordir}/basedir.shlib" 6 | 7 | x16emu_name="$(which x16emu)" 8 | x16emu_binary="$(realpath "--relative-to=$PWD" "${x16emu_name}")" 9 | x16emu_dir="$(dirname "${x16emu_binary}")" 10 | x16emu_rom="${x16emu_dir}/rom.bin" 11 | echo "${x16emu_rom}" 12 | -------------------------------------------------------------------------------- /forth/devenv-uF83: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/forth/devenv-uF83 -------------------------------------------------------------------------------- /forth/update-forth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cc64forthdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 5 | volksforthcbmdir="$(realpath --relative-to="$PWD" "${cc64forthdir}/../../VolksForth/6502/C64/cbmfiles")" 6 | 7 | cp -p "${volksforthcbmdir}/v4th-c64" "${cc64forthdir}/" 8 | cp -p "${volksforthcbmdir}/v4th-c16+" "${cc64forthdir}/" 9 | cp -p "${volksforthcbmdir}/v4th-x16" "${cc64forthdir}/" 10 | -------------------------------------------------------------------------------- /forth/v4th-c16+: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/forth/v4th-c16+ -------------------------------------------------------------------------------- /forth/v4th-c64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/forth/v4th-c64 -------------------------------------------------------------------------------- /forth/v4th-x16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/forth/v4th-x16 -------------------------------------------------------------------------------- /lib/ctype.h: -------------------------------------------------------------------------------- 1 | 2 | extern _fastcall int isdigit(int c); 3 | extern _fastcall int isalnum(int c); 4 | extern _fastcall int isalpha(int c); 5 | extern _fastcall int isspace(int c); 6 | extern _fastcall int islower(int c); 7 | extern _fastcall int isupper(int c); 8 | extern _fastcall int tolower(int c); 9 | extern _fastcall int toupper(int c); 10 | -------------------------------------------------------------------------------- /lib/libc-c16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/lib/libc-c16.i -------------------------------------------------------------------------------- /lib/libc-c16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/lib/libc-c16.o -------------------------------------------------------------------------------- /lib/libc-c64.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/lib/libc-c64.i -------------------------------------------------------------------------------- /lib/libc-c64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/lib/libc-c64.o -------------------------------------------------------------------------------- /lib/libc-x16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/lib/libc-x16.i -------------------------------------------------------------------------------- /lib/libc-x16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/lib/libc-x16.o -------------------------------------------------------------------------------- /lib/stdio.h: -------------------------------------------------------------------------------- 1 | 2 | extern int fopen(char* filename, char* mode); 3 | extern _fastcall int fclose(int fh); 4 | extern _fastcall int fgetc(int fh); 5 | extern int fputc(int c, int fh); 6 | extern char* fgets(char* str, int count, int fh); 7 | extern int fputs(char* str, int fh); 8 | extern _fastcall int putchar(int c); 9 | extern _fastcall int puts(char* str); 10 | extern _fastcall int remove(char* filename); 11 | 12 | extern int printf(); /* (char* fmtstr, ...); */ 13 | extern int fprintf(); /* (int fh, char* fmtstr, ...); */ 14 | extern int sprintf(); /* (char* buffer, char* fmtstr, ...); */ 15 | -------------------------------------------------------------------------------- /lib/stdlib.h: -------------------------------------------------------------------------------- 1 | 2 | extern int abs(int j); 3 | extern int atoi(char *s); 4 | extern _fastcall int rand(); 5 | extern _fastcall int srand(int seed); 6 | -------------------------------------------------------------------------------- /lib/string.h: -------------------------------------------------------------------------------- 1 | 2 | extern char *memchr(char *s, int c, int n); 3 | extern int memcmp(char *s1, char *s2, int n); 4 | extern char *memcpy(char *s1, char *s2, int n); 5 | extern char memmove(char *s1, char *s2, int n); 6 | extern char *memset(char* s, int c, int n); 7 | 8 | extern char *strcat(char *s1, char *s2); 9 | extern char *strchr(char *s, int c); 10 | extern int strcmp(char *s1, char *s2); 11 | extern char *strcpy(char *s1, char *s2); 12 | extern int strcspn(char *s1, char *s2); 13 | extern int strlen(char *s); 14 | extern char *strncat(char *s1, char *s2, int n); 15 | extern int strncmp(char *s1, char *s2, int n); 16 | extern char *strncpy(char *s1, char *s2, int n); 17 | extern char *strpbrk(char *s1, char *s2); 18 | extern char *strrchr(char *s, int c); 19 | extern int strspn(char *s1, char *s2); 20 | extern char *strstr(char *s1, char *s2); 21 | -------------------------------------------------------------------------------- /register-sizes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | description="$@" 6 | 7 | sizes=$(echo *.sizes|sort) 8 | 9 | for s in ${sizes}; do 10 | echo "${s}" 11 | echo "$(tail -1 "${s}") ${description}" >> "./bin-size-register/${s}" 12 | done 13 | -------------------------------------------------------------------------------- /runtime/lib-cio-c16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cio-c16.i -------------------------------------------------------------------------------- /runtime/lib-cio-c16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cio-c16.o -------------------------------------------------------------------------------- /runtime/lib-cio-c64.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cio-c64.i -------------------------------------------------------------------------------- /runtime/lib-cio-c64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cio-c64.o -------------------------------------------------------------------------------- /runtime/lib-cio-x16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cio-x16.i -------------------------------------------------------------------------------- /runtime/lib-cio-x16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cio-x16.o -------------------------------------------------------------------------------- /runtime/lib-cty-c16.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0x22 0x24 0x1001 0x1040 0x12fc 0x7ffa 0x8000 lib-cty-c16 2 | _fastcall int tolower() *= 0x1259; 3 | _fastcall int isalpha() *= 0x120a; 4 | _fastcall int isdigit() *= 0x11ee; 5 | _fastcall int rand() *= 0x128e; 6 | _fastcall int isalnum() *= 0x11fc; 7 | _fastcall int islower() *= 0x1235; 8 | _fastcall int toupper() *= 0x1270; 9 | _fastcall int isspace() *= 0x1223; 10 | _fastcall int srand() *= 0x127f; 11 | _fastcall int isupper() *= 0x1243; 12 | -------------------------------------------------------------------------------- /runtime/lib-cty-c16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cty-c16.i -------------------------------------------------------------------------------- /runtime/lib-cty-c16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cty-c16.o -------------------------------------------------------------------------------- /runtime/lib-cty-c64.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0xfd 0xfb 0x801 0x840 0xafc 0x9ffa 0xa000 lib-cty-c64 2 | _fastcall int tolower() *= 0xa59; 3 | _fastcall int isalpha() *= 0xa0a; 4 | _fastcall int isdigit() *= 0x9ee; 5 | _fastcall int rand() *= 0xa8e; 6 | _fastcall int isalnum() *= 0x9fc; 7 | _fastcall int islower() *= 0xa35; 8 | _fastcall int toupper() *= 0xa70; 9 | _fastcall int isspace() *= 0xa23; 10 | _fastcall int srand() *= 0xa7f; 11 | _fastcall int isupper() *= 0xa43; 12 | -------------------------------------------------------------------------------- /runtime/lib-cty-c64.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cty-c64.i -------------------------------------------------------------------------------- /runtime/lib-cty-c64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cty-c64.o -------------------------------------------------------------------------------- /runtime/lib-cty-x16.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0x40 0x42 0x801 0x83d 0xaf9 0x9efa 0x9f00 lib-cty-x16 2 | _fastcall int tolower() *= 0xa56; 3 | _fastcall int isalpha() *= 0xa07; 4 | _fastcall int isdigit() *= 0x9eb; 5 | _fastcall int rand() *= 0xa8b; 6 | _fastcall int isalnum() *= 0x9f9; 7 | _fastcall int islower() *= 0xa32; 8 | _fastcall int toupper() *= 0xa6d; 9 | _fastcall int isspace() *= 0xa20; 10 | _fastcall int srand() *= 0xa7c; 11 | _fastcall int isupper() *= 0xa40; 12 | -------------------------------------------------------------------------------- /runtime/lib-cty-x16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cty-x16.i -------------------------------------------------------------------------------- /runtime/lib-cty-x16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/lib-cty-x16.o -------------------------------------------------------------------------------- /runtime/rt-c16-10-7f.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0x22 0x24 0x1001 0x1040 0x11ee 0x7ffe 0x8000 rt-c16-10-7f 2 | -------------------------------------------------------------------------------- /runtime/rt-c16-10-7f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/rt-c16-10-7f.i -------------------------------------------------------------------------------- /runtime/rt-c16-10-7f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/rt-c16-10-7f.o -------------------------------------------------------------------------------- /runtime/rt-c64-08-9f.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0xfd 0xfb 0x801 0x840 0x9ee 0x9ffe 0xa000 rt-c64-08-9f 2 | -------------------------------------------------------------------------------- /runtime/rt-c64-08-9f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/rt-c64-08-9f.i -------------------------------------------------------------------------------- /runtime/rt-c64-08-9f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/rt-c64-08-9f.o -------------------------------------------------------------------------------- /runtime/rt-x16-08-9e.h: -------------------------------------------------------------------------------- 1 | #pragma cc64 0x40 0x42 0x801 0x83d 0x9eb 0x9efe 0x9f00 rt-x16-08-9e 2 | -------------------------------------------------------------------------------- /runtime/rt-x16-08-9e.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/rt-x16-08-9e.i -------------------------------------------------------------------------------- /runtime/rt-x16-08-9e.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/runtime/rt-x16-08-9e.o -------------------------------------------------------------------------------- /src/cc64/2words.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 129, Hexblock 81 2 | 3 | \ 2! 2@ 4 | 5 | ~ Code 2! ( d adr --) 6 | tya setup jsr 3 # ldy 7 | [[ SP )Y lda N )Y sta dey 0< ?] 8 | 1 # ldy Poptwo jmp end-code 9 | 10 | ~ Code 2@ ( adr -- d) 11 | SP X) lda N sta SP )Y lda N 1+ sta 12 | SP 2dec 3 # ldy 13 | [[ N )Y lda SP )Y sta dey 0< ?] 14 | xyNext jmp end-code 15 | -------------------------------------------------------------------------------- /src/cc64/cc64pftm.fth: -------------------------------------------------------------------------------- 1 | 2 | (64 | ' noop alias \time immediate C) 3 | (64 | ' noop alias \prof immediate C) 4 | (64 | ' noop alias \6526 immediate C) 5 | \prof cr .( timing the profiler on c64 ) cr 6 | 7 | include cc64.fth 8 | -------------------------------------------------------------------------------- /src/cc64/cc64prof.fth: -------------------------------------------------------------------------------- 1 | 2 | (64 | ' noop alias \prof immediate C) 3 | (64 | ' noop alias \6526 immediate C) 4 | \prof cr .( profiling cc64 on c64 ) cr 5 | 6 | include cc64.fth 7 | -------------------------------------------------------------------------------- /src/cc64/cc64size.fth: -------------------------------------------------------------------------------- 1 | 2 | | ' noop alias \prof immediate 3 | cr .( profile bucket sizes cc64 on c64 ) cr 4 | 5 | include cc64.fth 6 | -------------------------------------------------------------------------------- /src/cc64/cc64time.fth: -------------------------------------------------------------------------------- 1 | 2 | (64 | ' noop alias \time immediate C) 3 | (64 | ' noop alias \6526 immediate C) 4 | \time cr .( cc64 with time display on c64 ) cr 5 | 6 | include cc64.fth 7 | -------------------------------------------------------------------------------- /src/cc64/enable-log.fth: -------------------------------------------------------------------------------- 1 | 2 | ' noop alias \log immediate 3 | 4 | include logtofile.fth 5 | -------------------------------------------------------------------------------- /src/cc64/init.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 10, Hexblock a 2 | 3 | \ init 18apr94pz 4 | 5 | \prof profiler-bucket [memman-init] 6 | 7 | || variable inits inits off 8 | 9 | ~ : init ( -- ) 10 | inits BEGIN @ ?dup WHILE 11 | dup 2+ perform REPEAT ; 12 | 13 | ~ : init: ( name ) 14 | inits BEGIN dup @ WHILE @ REPEAT 15 | here swap ! 0 , ' , ; 16 | 17 | \prof [memman-init] end-bucket 18 | -------------------------------------------------------------------------------- /src/cc64/p2write-decl.fth: -------------------------------------------------------------------------------- 1 | 2 | ~ : (write-decl ( name val type -- ) 3 | %extern isn't? IF 2drop drop exit THEN 4 | %function %l-value %pointer + + isn't? 5 | IF drop " #define " str! swap str! hex! cr! exit THEN 6 | " extern " str! 7 | %fastcall is? IF " _fastcall " str! THEN 8 | is-char? IF " char " 9 | ELSE " int " THEN str! 10 | %function %l-value + isn't? >r 11 | %pointer is? r> and 12 | IF drop swap str! " [] *=" str! hex! 13 | ELSE %pointer is? IF ascii * fputc THEN 14 | %function is? 15 | IF %l-value isn't? 16 | IF rot str! ELSE " (*" str! 17 | rot str! ascii ) fputc THEN 18 | " ()" str! ELSE rot str! THEN 19 | " *=" str! drop hex! THEN 20 | " ;" str! cr! ; 21 | -------------------------------------------------------------------------------- /src/cc64/rt-ptrs.fth: -------------------------------------------------------------------------------- 1 | 2 | ~ variable >frame 3 | ~ variable >zp 4 | ~ variable >runtime 5 | -------------------------------------------------------------------------------- /src/cc64/set-d000.fth: -------------------------------------------------------------------------------- 1 | 2 | : relocate-tasks ( newUP -- ) 3 | up@ dup BEGIN 1+ under @ 2dup - 4 | WHILE rot drop REPEAT 2drop ! ; 5 | 6 | : abs-relocate ( s0 r0/limit -- ) 7 | dup ['] limit >body ! 8 | origin $A + ! \ r0 9 | dup relocate-tasks 10 | up@ 1+ @ origin 1+ ! \ task 11 | 6 - origin 8 + ! cold ; \ s0 12 | 13 | $cc00 $d000 abs-relocate 14 | -------------------------------------------------------------------------------- /src/common/faketimer.fth: -------------------------------------------------------------------------------- 1 | 2 | ~ create prevTime 4 allot 3 | ~ create deltaTime 4 allot 4 | ~ variable timerActrl 5 | 6 | ~ ' noop alias reset-32bit-timer ( -- ) 7 | ~ : read-32bit-timer ( -- ud ) 0. ; 8 | ~ ' noop alias reset-50ms-timer ( -- ) 9 | ~ ' 0 alias read-50ms-timer ( -- u ) 10 | 11 | ~ : ms. ( u -- ) 12 | drop ." -- ms" ; 13 | 14 | current @ context @ 15 | Assembler also definitions 16 | 17 | ~ ' noop alias calcTime 18 | ~ ' noop alias setPrevTime 19 | 20 | toss context ! current ! 21 | -------------------------------------------------------------------------------- /src/common/init-shell.fth: -------------------------------------------------------------------------------- 1 | 2 | | : init-shell ( -- ) 3 | only shell ; 4 | 5 | ' init-shell IS 'cold 6 | 7 | 8 | | : .logo ( -- ) 9 | $e con! \ switch to lowercase charset 10 | ." running" cr 11 | .binary-name .version cr 12 | ." 2024 by Philip Zembrod" cr 13 | c-charset-present? 14 | IF c-charset ." C charset in use" cr THEN ; 15 | 16 | ' .logo IS 'restart 17 | -------------------------------------------------------------------------------- /src/common/logtofile.fth: -------------------------------------------------------------------------------- 1 | 2 | create log-dev 8 c, 3 | create log-2nd 9 c, 4 | : log-dev-2nd@ log-dev c@ log-2nd c@ ; 5 | 6 | : log-emit 7 | dup c64emit log-dev-2nd@ busout bus! busoff ; 8 | 9 | : log-cr 10 | c64cr log-dev-2nd@ busout #cr bus! busoff ; 11 | 12 | : log-type 13 | 2dup c64type log-dev-2nd@ busout bustype busoff ; 14 | 15 | Output: alsologtofile 16 | log-emit log-cr log-type c64del c64page 17 | c64at c64at? ; 18 | 19 | : logopen 20 | bl parse 2dup type 21 | log-dev-2nd@ busopen 22 | bustype " ,s,w" count bustype busoff 23 | i/o-status? IF c64cr log-dev c@ dos-error abort THEN 24 | alsologtofile ; 25 | 26 | : logclose 27 | cr display log-dev-2nd@ busclose ; 28 | -------------------------------------------------------------------------------- /src/common/lowlevel.fth: -------------------------------------------------------------------------------- 1 | 2 | ~ Code c-charset 3 | (64 $cbfd jsr C) (16 $f804 jsr C) (CX $0400 jsr C) 4 | xyNext jmp end-code 5 | 6 | ~ : c-charset-present? ( -- f ) 7 | (64 $cbf9 C) (16 $f800 C) (CX $0403 C) 2@ $65021103. d= ; 8 | 9 | 10 | ~ Code >lo ( u -- lo ) 11 | txa SP )y sta Next jmp end-code 12 | 13 | ~ Code >hi ( u -- hi ) 14 | SP )y lda SP x) sta txa SP )y sta Next jmp end-code 15 | -------------------------------------------------------------------------------- /src/common/mock32timer.fth: -------------------------------------------------------------------------------- 1 | 2 | || ' noop alias reset-32bit-timer 3 | 4 | || create timerActrl 1 allot 5 | -------------------------------------------------------------------------------- /src/common/notmpheap.fth: -------------------------------------------------------------------------------- 1 | 2 | \ When no tmpheap mechanism is needed, i.e. all temporary names 3 | \ of a project fit onto the regular heap at once, then this zero-cost 4 | \ implementation can be used which directs all tmpheap definitions 5 | \ to the regular heap. 6 | 7 | ~ ' | alias || 8 | ~ ' |on alias ||on 9 | ~ ' |off alias ||off 10 | 11 | ~ ' noop alias tmp-clear 12 | -------------------------------------------------------------------------------- /src/common/savesystem.fth: -------------------------------------------------------------------------------- 1 | \ *** Block No. 8, Hexblock 8 2 | 3 | \ savesystem 12apr20pz 4 | 5 | cr .( savesystem ) cr 6 | 7 | | : (savsys ( adr len -- ) 8 | [ Assembler ] Next [ Forth ] 9 | ['] pause dup push ! \ singletask 10 | i/o push i/o off bustype ; 11 | 12 | ~ : savesystem \ name muss folgen 13 | save dev 2 busopen 0 parse bustype 14 | " ,p,w" count bustype busoff 15 | dev 2 busout origin $17 - 16 | dup $100 u/mod swap bus! bus! 17 | here over - (savsys busoff 18 | dev 2 busclose 19 | 0 (drv ! derror? abort" save-error" ; 20 | -------------------------------------------------------------------------------- /src/common/timertest.fth: -------------------------------------------------------------------------------- 1 | 2 | \ with build log: 3 | \ ' noop alias \log 4 | \ without build log: 5 | ' \ alias \log 6 | 7 | \log include logtofile.fth 8 | \log logopen timertest.log 9 | 10 | | ' noop alias ~ 11 | | ' |on alias ~on 12 | | ' |off alias ~off 13 | 14 | include notmpheap.fth 15 | 16 | onlyforth decimal 17 | \ | : include include base push hex cr here u. heap u. up@ u. ; 18 | 19 | include util-words.fth 20 | 21 | Onlyforth Assembler also definitions 22 | include 6502asm.fth 23 | Onlyforth 24 | include lowlevel.fth 25 | include 6526timer.fth 26 | include profiler.fth 27 | 28 | : test1 reset-32bit-timer ; 29 | : test2 begin read-32bit-timer cr d. key? until ; 30 | 31 | : test3 reset-50ms-timer ; 32 | : test4 begin read-50ms-timer cr dup u. ms. key? until ; 33 | 34 | \log logclose 35 | -------------------------------------------------------------------------------- /src/common/tmp6502asm.fth: -------------------------------------------------------------------------------- 1 | 2 | cr .( tmpheap transient forth assembler) cr 3 | 4 | here $800 tmp-hallot dp ! 5 | 6 | include 6502asm.fth 7 | 8 | dp ! 9 | -------------------------------------------------------------------------------- /src/common/trns6502asm.fth: -------------------------------------------------------------------------------- 1 | 2 | cr .( heap transient forth assembler) cr 3 | 4 | here $800 hallot heap dp ! 5 | 6 | include 6502asm.fth 7 | 8 | dp ! 9 | -------------------------------------------------------------------------------- /src/common/version.fth: -------------------------------------------------------------------------------- 1 | 2 | ~ : .version ." V0.13" 3 | \prof ." profiling" 4 | ; 5 | -------------------------------------------------------------------------------- /src/common/x16edit.fth: -------------------------------------------------------------------------------- 1 | 2 | $0001 || constant RomBank 3 | 4 | || Code (xed? ( -- n ) 5 | $c000 lda pha $c003 lda Push jmp end-code 6 | 7 | || Code (xed ( -- ) 8 | 2 # ldx $ff # ldy 9 | $4 lda 0= ?[ $c000 jsr ][ $c003 jsr ]? 10 | xyNext jmp end-code 11 | 12 | ~ : xed ( -- ) 13 | bl word count $4 c! $2 ! 14 | RomBank c@ 13 RomBank c! 15 | (xed? $4c4c = IF (xed RomBank c! 16 | ELSE RomBank c! ." no x16edit" THEN ; 17 | -------------------------------------------------------------------------------- /src/lib/00internal.c: -------------------------------------------------------------------------------- 1 | 2 | #define NULL 0 3 | #define INT_MAX 32767 4 | #define INT_MIN -32768 5 | #define RAND_MAX 32767 6 | -------------------------------------------------------------------------------- /src/lib/include/ctype.h: -------------------------------------------------------------------------------- 1 | 2 | extern _fastcall int isdigit(int c); 3 | extern _fastcall int isalnum(int c); 4 | extern _fastcall int isalpha(int c); 5 | extern _fastcall int isspace(int c); 6 | extern _fastcall int islower(int c); 7 | extern _fastcall int isupper(int c); 8 | extern _fastcall int tolower(int c); 9 | extern _fastcall int toupper(int c); 10 | -------------------------------------------------------------------------------- /src/lib/include/stdio.h: -------------------------------------------------------------------------------- 1 | 2 | extern int fopen(char* filename, char* mode); 3 | extern _fastcall int fclose(int fh); 4 | extern _fastcall int fgetc(int fh); 5 | extern int fputc(int c, int fh); 6 | extern char* fgets(char* str, int count, int fh); 7 | extern int fputs(char* str, int fh); 8 | extern _fastcall int putchar(int c); 9 | extern _fastcall int puts(char* str); 10 | extern _fastcall int remove(char* filename); 11 | 12 | extern int printf(); /* (char* fmtstr, ...); */ 13 | extern int fprintf(); /* (int fh, char* fmtstr, ...); */ 14 | extern int sprintf(); /* (char* buffer, char* fmtstr, ...); */ 15 | -------------------------------------------------------------------------------- /src/lib/include/stdlib.h: -------------------------------------------------------------------------------- 1 | 2 | extern int abs(int j); 3 | extern int atoi(char *s); 4 | extern _fastcall int rand(); 5 | extern _fastcall int srand(int seed); 6 | -------------------------------------------------------------------------------- /src/lib/stdio/defines.c: -------------------------------------------------------------------------------- 1 | 2 | #define EOF -1 3 | -------------------------------------------------------------------------------- /src/lib/stdlib/abs.c: -------------------------------------------------------------------------------- 1 | 2 | int abs(int j) { 3 | return ((j >= 0) ? j : -j); 4 | } 5 | -------------------------------------------------------------------------------- /src/lib/string/memchr.c: -------------------------------------------------------------------------------- 1 | 2 | char *memchr(char *s, int c, int n) { 3 | static char *p; p = s; 4 | 5 | while (n--) { 6 | if (*p == c) { 7 | return p; 8 | } 9 | ++p; 10 | } 11 | return NULL; 12 | } 13 | -------------------------------------------------------------------------------- /src/lib/string/memcmp.c: -------------------------------------------------------------------------------- 1 | 2 | int memcmp(char *s1, char *s2, int n) { 3 | static char *p1; 4 | static char *p2; 5 | p1 = s1; 6 | p2 = s2; 7 | 8 | while ( n-- ) { 9 | if ( *p1 != *p2 ) { 10 | return *p1 - *p2; 11 | } 12 | ++p1; 13 | ++p2; 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/lib/string/memcpy.c: -------------------------------------------------------------------------------- 1 | 2 | char *memcpy(char *s1, char *s2, int n) { 3 | static char *dest; 4 | static char *src; 5 | dest = s1; 6 | src = s2; 7 | 8 | while ( n-- ) { 9 | *dest++ = *src++; 10 | } 11 | 12 | return s1; 13 | } 14 | -------------------------------------------------------------------------------- /src/lib/string/memmove.c: -------------------------------------------------------------------------------- 1 | 2 | char memmove(char *s1, char *s2, int n) { 3 | static char *dest; 4 | static char *src; 5 | dest = s1; 6 | src = s2; 7 | 8 | if (dest <= src) { 9 | while (n--) { 10 | *dest++ = *src++; 11 | } 12 | } 13 | else { 14 | src += n; 15 | dest += n; 16 | 17 | while (n--) { 18 | *--dest = *--src; 19 | } 20 | } 21 | 22 | return s1; 23 | } 24 | -------------------------------------------------------------------------------- /src/lib/string/memset.c: -------------------------------------------------------------------------------- 1 | 2 | char *memset(char* s, int c, int n) { 3 | char *p; p = s; 4 | 5 | while (n--) { 6 | *p++ = c; 7 | } 8 | 9 | return s; 10 | } 11 | -------------------------------------------------------------------------------- /src/lib/string/strcat.c: -------------------------------------------------------------------------------- 1 | 2 | char *strcat(char *s1, char *s2) { 3 | static char *rc; rc = s1; 4 | 5 | if ( *s1 ) { 6 | while (*++s1) {} 7 | } 8 | 9 | while ((*s1++ = *s2++)) {} 10 | 11 | return rc; 12 | } 13 | -------------------------------------------------------------------------------- /src/lib/string/strchr.c: -------------------------------------------------------------------------------- 1 | 2 | char *strchr(char *s, int c) { 3 | do { 4 | if (*s == c) { 5 | return s; 6 | } 7 | } while (*s++); 8 | 9 | return NULL; 10 | } 11 | -------------------------------------------------------------------------------- /src/lib/string/strcmp.c: -------------------------------------------------------------------------------- 1 | 2 | int strcmp(char *s1, char *s2) { 3 | while ((*s1) && (*s1 == *s2)) { 4 | ++s1; 5 | ++s2; 6 | } 7 | 8 | return (*s1 - *s2); 9 | } 10 | -------------------------------------------------------------------------------- /src/lib/string/strcpy.c: -------------------------------------------------------------------------------- 1 | 2 | char *strcpy(char *s1, char *s2) { 3 | static char *rc; rc = s1; 4 | 5 | while ((*s1++ = *s2++)) {} 6 | 7 | return rc; 8 | } 9 | -------------------------------------------------------------------------------- /src/lib/string/strcspn.c: -------------------------------------------------------------------------------- 1 | 2 | int strcspn(char *s1, char *s2) { 3 | static int len; 4 | static char *p; 5 | len = 0; 6 | 7 | while ( s1[len] ) { 8 | p = s2; 9 | 10 | while (*p) { 11 | if (s1[len] == *p++) { 12 | return len; 13 | } 14 | } 15 | 16 | ++len; 17 | } 18 | 19 | return len; 20 | } 21 | -------------------------------------------------------------------------------- /src/lib/string/strlen.c: -------------------------------------------------------------------------------- 1 | 2 | int strlen(char *s) { 3 | static int rc; rc = 0; 4 | 5 | while (s[rc]) { 6 | ++rc; 7 | } 8 | 9 | return rc; 10 | } 11 | -------------------------------------------------------------------------------- /src/lib/string/strncat.c: -------------------------------------------------------------------------------- 1 | 2 | char *strncat(char *s1, char *s2, int n) { 3 | static char *rc; rc = s1; 4 | 5 | while (*s1) { 6 | ++s1; 7 | } 8 | 9 | while (n && (*s1++ = *s2++)) { 10 | --n; 11 | } 12 | 13 | if (n == 0) { 14 | *s1 = '\0'; 15 | } 16 | 17 | return rc; 18 | } 19 | -------------------------------------------------------------------------------- /src/lib/string/strncmp.c: -------------------------------------------------------------------------------- 1 | 2 | int strncmp(char *s1, char *s2, int n) { 3 | while (n && *s1 && (*s1 == *s2)) { 4 | ++s1; 5 | ++s2; 6 | --n; 7 | } 8 | 9 | if (n == 0) { 10 | return 0; 11 | } 12 | else { 13 | return (*s1 - *s2); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/lib/string/strncpy.c: -------------------------------------------------------------------------------- 1 | 2 | char *strncpy(char *s1, char *s2, int n) { 3 | static char *rc; rc = s1; 4 | 5 | while (n && (*s1++ = *s2++)) { 6 | /* Note: In the original PDCLib code, n is size_t which cc64 does 7 | not have. */ 8 | /* Cannot do "n--" in the conditional as size_t is unsigned and we have 9 | to check it again for >0 in the next loop below, so we must not risk 10 | underflow. 11 | */ 12 | --n; 13 | } 14 | 15 | /* Checking against 1 as we missed the last --n in the loop above. */ 16 | while (n-- > 1) { 17 | *s1++ = '\0'; 18 | } 19 | 20 | return rc; 21 | } 22 | -------------------------------------------------------------------------------- /src/lib/string/strpbrk.c: -------------------------------------------------------------------------------- 1 | 2 | char *strpbrk(char *s1, char *s2) { 3 | static char *p1; 4 | static char *p2; 5 | p1 = s1; 6 | 7 | while (*p1) { 8 | p2 = s2; 9 | 10 | while (*p2) { 11 | if (*p1 == *p2++) { 12 | return p1; 13 | } 14 | } 15 | 16 | ++p1; 17 | } 18 | 19 | return NULL; 20 | } 21 | -------------------------------------------------------------------------------- /src/lib/string/strrchr.c: -------------------------------------------------------------------------------- 1 | 2 | char *strrchr(char *s, int c) { 3 | static int i; i = 0; 4 | 5 | while (s[i++]) {} 6 | 7 | do { 8 | if (s[--i] == c) { 9 | return s + i; 10 | } 11 | } while (i); 12 | 13 | return NULL; 14 | } 15 | -------------------------------------------------------------------------------- /src/lib/string/strspn.c: -------------------------------------------------------------------------------- 1 | 2 | int strspn(char *s1, char *s2) { 3 | static int len; 4 | static char *p; 5 | len = 0; 6 | 7 | while (s1[len]) { 8 | p = s2; 9 | 10 | while (*p) { 11 | if (s1[len] == *p) { 12 | break; 13 | } 14 | 15 | ++p; 16 | } 17 | 18 | if (! *p) { 19 | return len; 20 | } 21 | 22 | ++len; 23 | } 24 | 25 | return len; 26 | } 27 | -------------------------------------------------------------------------------- /src/lib/string/strstr.c: -------------------------------------------------------------------------------- 1 | 2 | char *strstr(char *s1, char *s2) { 3 | static char *p1; 4 | static char *p2; 5 | p1 = s1; 6 | 7 | while (*s1) { 8 | p2 = s2; 9 | 10 | while (*p2 && (*p1 == *p2)) { 11 | ++p1; 12 | ++p2; 13 | } 14 | 15 | if (! *p2) { 16 | return s1; 17 | } 18 | 19 | ++s1; 20 | p1 = s1; 21 | } 22 | 23 | return NULL; 24 | } 25 | -------------------------------------------------------------------------------- /src/runtime/lib-cio-c16.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 runtime module including ctype.a as basis for libc 3 | ; to run on c16/plus4 at $1001-$8000 4 | 5 | !source "statics.a" 6 | 7 | !source "bas-c16-10-7f.a" 8 | 9 | !source "rt-core.a" 10 | 11 | !source "ctype-petscii.a" 12 | 13 | !source "rand.a" 14 | 15 | !source "fileio.a" 16 | 17 | !source "printf.a" 18 | 19 | cc64_lib_end 20 | -------------------------------------------------------------------------------- /src/runtime/lib-cio-c64.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 runtime module including ctype.a as basis for libc 3 | ; to run on c64 at $0801-$a000 4 | 5 | !source "statics.a" 6 | 7 | !source "bas-c64-08-9f.a" 8 | 9 | !source "rt-core.a" 10 | 11 | !source "ctype-petscii.a" 12 | 13 | !source "rand.a" 14 | 15 | !source "fileio.a" 16 | 17 | !source "printf.a" 18 | 19 | cc64_lib_end 20 | -------------------------------------------------------------------------------- /src/runtime/lib-cio-x16.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 runtime module including ctype.a as basis for libc 3 | ; to run on Commander X16 at $0801-$9f00 4 | 5 | !source "statics.a" 6 | 7 | !source "bas-x16-08-9e.a" 8 | 9 | !source "rt-core.a" 10 | 11 | !source "ctype-petscii.a" 12 | 13 | !source "rand.a" 14 | 15 | !source "fileio.a" 16 | 17 | !source "printf.a" 18 | 19 | cc64_lib_end 20 | -------------------------------------------------------------------------------- /src/runtime/lib-cty-c16.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 runtime module including ctype.a as basis for libc 3 | ; to run on c16/plus4 at $1001-$8000 4 | 5 | !source "statics.a" 6 | 7 | !source "bas-c16-10-7f.a" 8 | 9 | !source "rt-core.a" 10 | 11 | !source "ctype-petscii.a" 12 | 13 | !source "rand.a" 14 | 15 | cc64_lib_end 16 | -------------------------------------------------------------------------------- /src/runtime/lib-cty-c64.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 runtime module including ctype.a as basis for libc 3 | ; to run on c64 at $0801-$a000 4 | 5 | !source "statics.a" 6 | 7 | !source "bas-c64-08-9f.a" 8 | 9 | !source "rt-core.a" 10 | 11 | !source "ctype-petscii.a" 12 | 13 | !source "rand.a" 14 | 15 | cc64_lib_end 16 | -------------------------------------------------------------------------------- /src/runtime/lib-cty-x16.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 runtime module including ctype.a as basis for libc 3 | ; to run on Commander X16 at $0801-$9f00 4 | 5 | !source "statics.a" 6 | 7 | !source "bas-x16-08-9e.a" 8 | 9 | !source "rt-core.a" 10 | 11 | !source "ctype-petscii.a" 12 | 13 | !source "rand.a" 14 | 15 | cc64_lib_end 16 | -------------------------------------------------------------------------------- /src/runtime/rt-c16-10-7f.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 minimal runtime module 3 | ; to run on c16/plus4 at $1001-$8000 4 | 5 | !ct pet ; use PETSCII for char constants - important e.g. for printf.a 6 | 7 | !source "statics.a" 8 | 9 | !source "bas-c16-10-7f.a" 10 | 11 | !source "rt-core.a" 12 | 13 | cc64_lib_end 14 | -------------------------------------------------------------------------------- /src/runtime/rt-c64-08-9f.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 minimal runtime module 3 | ; to run on c64 at $0801-$a000 4 | 5 | !ct pet ; use PETSCII for char constants - important e.g. for printf.a 6 | 7 | !source "statics.a" 8 | 9 | !source "bas-c64-08-9f.a" 10 | 11 | !source "rt-core.a" 12 | 13 | cc64_lib_end 14 | -------------------------------------------------------------------------------- /src/runtime/rt-x16-08-9e.a: -------------------------------------------------------------------------------- 1 | 2 | ; cc64 minimal runtime module 3 | ; to run on Commander X16 at $0801-$9f00 4 | 5 | !ct pet ; use PETSCII for char constants - important e.g. for printf.a 6 | 7 | !source "statics.a" 8 | 9 | !source "bas-x16-08-9e.a" 10 | 11 | !source "rt-core.a" 12 | 13 | cc64_lib_end 14 | -------------------------------------------------------------------------------- /src/samples/helloworld-c16.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt-c16-10-7f.h" 3 | 4 | extern _fastcall putchar() *= 0xffd2 ; 5 | 6 | int puts(s) 7 | char *s; 8 | { 9 | while(*s != 0) 10 | putchar(*s++); 11 | } 12 | 13 | main() 14 | { 15 | int i; 16 | for(i=1;i<=4;++i) 17 | { 18 | puts("hello, world!\n"); 19 | } 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/samples/helloworld-c64.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt-c64-08-9f.h" 3 | 4 | extern _fastcall putchar() *= 0xffd2 ; 5 | 6 | int puts(s) 7 | char *s; 8 | { 9 | while(*s != 0) 10 | putchar(*s++); 11 | } 12 | 13 | main() 14 | { 15 | int i; 16 | for(i=1;i<=4;++i) 17 | { 18 | puts("hello, world!\n"); 19 | } 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/samples/helloworld-x16.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt-x16-08-9e.h" 3 | 4 | extern _fastcall putchar() *= 0xffd2 ; 5 | 6 | int puts(s) 7 | char *s; 8 | { 9 | while(*s != 0) 10 | putchar(*s++); 11 | } 12 | 13 | main() 14 | { 15 | int i; 16 | for(i=1;i<=4;++i) 17 | { 18 | puts("hello, world!\n"); 19 | } 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/samples/vccc2023-c16.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | extern _fastcall putchar() *= 0xffd2 ; 5 | 6 | int main() { 7 | static int i, j, x, y, dx, dy; 8 | for (i=0, y=3, dy=1; i<19; ++i, y+=dy) { 9 | dy=(y==0?1:y==3?-1:dy); 10 | for (j=0, x=0, dx=1; j<19; ++j, x+=dx) { 11 | dx=(x==0?1:x==3?-1:dx); 12 | putchar(x==y?'*':' '); 13 | } 14 | putchar('\n'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/samples/vccc2023-c64.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | extern _fastcall putchar() *= 0xffd2 ; 5 | 6 | int main() { 7 | static int i, j; 8 | for (i=3;i<22;++i) { 9 | for (j=0;j<19;++j) { 10 | putchar((i+j)%6&&(i-j)%6?' ':'*'); 11 | } 12 | putchar('\n'); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/samples/vccc2023-x16.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt-x16-08-9e.h" 3 | 4 | extern _fastcall putchar() *= 0xffd2 ; 5 | 6 | int main() { 7 | static int j; 8 | for (j=0;j<380;++j) 9 | putchar(j%20-19?(j/20+j%20+3)%6&&(j/20-j%20+3)%6?' ':'*':'\n'); 10 | } 11 | -------------------------------------------------------------------------------- /tests/e2e/add.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/e2e/basedir.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | basedir="$(realpath --relative-to="$PWD" "${testdir}/../..")" 4 | -------------------------------------------------------------------------------- /tests/e2e/cc64-1.pfs: -------------------------------------------------------------------------------- 1 | 2 | profile-cc64-1 3 | cc suite.c 4 | profile2file cc64-1.profile 5 | -------------------------------------------------------------------------------- /tests/e2e/compile-in-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | test -n "${CC64HOST}" || export CC64HOST=c64 5 | test -n "${OUTFILES}" || export OUTFILES="" 6 | 7 | testname="${1}" 8 | cc64="${2}" 9 | test -n "${cc64}" || cc64="cc64" 10 | 11 | testdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 12 | source "${testdir}/basedir.shlib" 13 | emulatordir="$(realpath --relative-to="$PWD" "${basedir}/emulator")" 14 | hostfiles="$(realpath --relative-to="$PWD" "${testdir}/${CC64HOST}files")" 15 | 16 | rm -f "${hostfiles}/${testname}.log" 17 | keybuf="logfile ${testname}.log\ncc ${testname}.c\nlogclose\ndos s0:notdone" 18 | 19 | export CBMFILES="${hostfiles}" 20 | "${emulatordir}/run-in-${CC64HOST}emu.sh" "${cc64}" "${keybuf}" 21 | -------------------------------------------------------------------------------- /tests/e2e/compound-test.c: -------------------------------------------------------------------------------- 1 | 2 | compound_test() { 3 | { 4 | println("in compound"); 5 | } 6 | println("after compound"); 7 | } 8 | -------------------------------------------------------------------------------- /tests/e2e/compound.golden: -------------------------------------------------------------------------------- 1 | in compound 2 | after compound 3 | -------------------------------------------------------------------------------- /tests/e2e/concat-golden-silver.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | # imput: 4 | # $tests 5 | 6 | # Build golden (and silver) file. 7 | # It is not named suite.golden so the make rules depending on *.golden 8 | # don't trigger on this generated golden file being new. 9 | rm -f suite.joined-golden suite.joined-silver 10 | touch suite.joined-golden suite.joined-silver 11 | for t in $tests; do 12 | echo "${t}-test:" >> suite.joined-golden 13 | cat ${t}.golden >> suite.joined-golden 14 | # joined-silver doesn't contain test sections, so diffing against it 15 | # will highlight the test sections as well as actuall output diffs. 16 | cat ${t}.golden >> suite.joined-silver 17 | done 18 | -------------------------------------------------------------------------------- /tests/e2e/concat-suite.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | # imput: 4 | # $target $hostfiles $tests 5 | 6 | # Build test binary 7 | ( 8 | cat "test-setup-${target}.h" 9 | echo "char *name(){ return \"suite.out,s,w\"; }" 10 | for t in $tests; do 11 | cat ${t}-test.c 12 | done 13 | echo "test(){" 14 | for t in $tests; do 15 | echo " println(\"${t}-test:\");" 16 | echo " ${t}_test();" 17 | done 18 | echo "}" 19 | cat test-main.h 20 | ) | tee suite-generated.c | ascii2petscii - "${hostfiles}/suite.c" 21 | -------------------------------------------------------------------------------- /tests/e2e/debug-in-vice.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | testdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 5 | source "${testdir}/basedir.shlib" 6 | emulatordir="$(realpath --relative-to="$PWD" "${basedir}/emulator")" 7 | c64files="$(realpath --relative-to="$PWD" "${testdir}/c64files")" 8 | 9 | run="" 10 | if [ -n "$1" ] 11 | then 12 | autostart="${testdir}/$1.T64" 13 | run="-autostart $autostart" 14 | fi 15 | 16 | x64 \ 17 | -virtualdev \ 18 | +truedrive \ 19 | -drive8type 1541 \ 20 | -fs8 "${c64files}" \ 21 | -chargen "${emulatordir}/c-chargen" \ 22 | $run 23 | -------------------------------------------------------------------------------- /tests/e2e/div.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/e2e/do.golden: -------------------------------------------------------------------------------- 1 | Before false-condition do loop 2 | This should be printed once. 3 | After false-condition do loop 4 | Before 4-iteration do loop 5 | Iteration 4 6 | Iteration 3 7 | Iteration 2 8 | Iteration 1 9 | After 4-iteration do loop 10 | Before 3-2-iteration nested do loops 11 | Outer iteration 3 12 | Inner iteration 3 , 2 13 | Inner iteration 3 , 1 14 | Outer iteration 2 15 | Outer iteration 1 16 | Inner iteration 1 , 2 17 | After 3-2-iteration nested do loops 18 | No assert failed. 19 | -------------------------------------------------------------------------------- /tests/e2e/evaluate-suite.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | # imput: 4 | # $suitename 5 | 6 | # output: 7 | # $result 8 | 9 | rm -f "${suitename}.result" 10 | set +e 11 | diff suite.joined-golden "${suitename}.out" 12 | result=$? 13 | set -e 14 | test $result -eq 0 \ 15 | && echo "${suitename} PASS" > "${suitename}.result" \ 16 | || diff suite.joined-silver "${suitename}.out" > "${suitename}.result" 17 | # diff with suite.silver will additionally show test sections as diff. 18 | cat "${suitename}.result" 19 | -------------------------------------------------------------------------------- /tests/e2e/for.golden: -------------------------------------------------------------------------------- 1 | Before no-iteration for loop 2 | After no-iteration for loop 3 | Before 4-iteration for loop 4 | Iteration 5 5 | Iteration 6 6 | Iteration 7 7 | Iteration 8 8 | After 4-iteration backward for loop 9 | Before 3-iteration backward for loop 10 | Iteration -17 11 | Iteration -18 12 | Iteration -19 13 | After 3-iteration backward for loop 14 | Before 3-2-iteration nested for loops 15 | Outer iteration 1 16 | Inner iteration 1 , 2 17 | Inner iteration 1 , 8 18 | Outer iteration 3 19 | Outer iteration 5 20 | Inner iteration 5 , 2 21 | Inner iteration 5 , 8 22 | After 3-2-iteration nested for loops 23 | No assert failed. 24 | -------------------------------------------------------------------------------- /tests/e2e/forward-test.c: -------------------------------------------------------------------------------- 1 | 2 | extern forward_declared(); 3 | 4 | int prototype_address; 5 | int final_address; 6 | 7 | middle_function(i) 8 | int i; 9 | { 10 | prototype_address = forward_declared; 11 | forward_declared(i); 12 | } 13 | 14 | forward_declared(int i) 15 | { 16 | print("forward "); println(itoa(i)); 17 | } 18 | 19 | forward_test() 20 | { 21 | final_address = forward_declared; 22 | middle_function(1); 23 | forward_declared(2); 24 | 25 | assertTrue(prototype_address - middle_function < 0, 26 | "prototype function address < muddle function address"); 27 | assertTrue(final_address - middle_function > 0, 28 | "final function address > muddle function address"); 29 | 30 | evaluateAsserts(); 31 | } 32 | -------------------------------------------------------------------------------- /tests/e2e/forward.golden: -------------------------------------------------------------------------------- 1 | forward 1 2 | forward 2 3 | No assert failed. 4 | -------------------------------------------------------------------------------- /tests/e2e/helloworld-test.c: -------------------------------------------------------------------------------- 1 | 2 | helloworld_test() 3 | { 4 | println("hello, world!"); 5 | } 6 | -------------------------------------------------------------------------------- /tests/e2e/helloworld.golden: -------------------------------------------------------------------------------- 1 | hello, world! 2 | -------------------------------------------------------------------------------- /tests/e2e/helloworld3-test.c: -------------------------------------------------------------------------------- 1 | 2 | helloworld3_test() 3 | { 4 | int i; 5 | for(i=1;i<=3;++i) 6 | { 7 | println("hello, world!"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/e2e/helloworld3.golden: -------------------------------------------------------------------------------- 1 | hello, world! 2 | hello, world! 3 | hello, world! 4 | -------------------------------------------------------------------------------- /tests/e2e/itoa-test.c: -------------------------------------------------------------------------------- 1 | 2 | itoa_test() 3 | { 4 | println(itoa(13)); 5 | println(itoa(0)); 6 | println(itoa(100)); 7 | println(itoa(-12345)); 8 | println(itoa(32767)); 9 | println(itoa(-32767)); 10 | println(itoa(-0)); 11 | println(itoa(-32768)); 12 | } 13 | -------------------------------------------------------------------------------- /tests/e2e/itoa.golden: -------------------------------------------------------------------------------- 1 | 13 2 | 0 3 | 100 4 | -12345 5 | 32767 6 | -32767 7 | 0 8 | -32768 9 | -------------------------------------------------------------------------------- /tests/e2e/mod.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/e2e/mult.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/e2e/nextword.pfs: -------------------------------------------------------------------------------- 1 | 2 | profile-scanner-nextword 3 | cc suite.c 4 | profile2file nextword.profile 5 | -------------------------------------------------------------------------------- /tests/e2e/partialfor.golden: -------------------------------------------------------------------------------- 1 | Before no-iteration for loop 2 | After no-iteration for loop 3 | Before for(;;) loop 4 | Iteration 3 5 | Iteration 2 6 | Iteration 1 7 | After for(;;) loop 8 | Before for(;;--i) loop 9 | Iteration 2 10 | Iteration 1 11 | Iteration 0 12 | After for(;;--i) loop 13 | Before for(;i;) loop 14 | Iteration 3 15 | Iteration 2 16 | Iteration 1 17 | After for(;i;) loop 18 | Before for(i = 3;;) loop 19 | Iteration 3 20 | Iteration 2 21 | Iteration 1 22 | After for(i = 3;;) loop 23 | No assert failed. 24 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-03-26-2120-orig-list.profile: -------------------------------------------------------------------------------- 1 | 2021-03-26T21:20:39+01:00 2 | Original version with src list during compile 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 919.522.732 1.078.906.060 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15887 65535 475419 52822277 (etc) 11 | 1 19318 21455 1037243 114416784 [MEMMAN-ETC] 12 | 2 21459 22678 1384162 153154008 [FILE-HANDLING] 13 | 3 22682 23339 797224 122822197 [INPUT] 14 | 4 23343 25749 2695157 299076306 [SCANNER] 15 | 5 25753 27129 153639 17403250 [SYMTAB] 16 | 6 27133 35110 1826434 197679185 [PARSER] 17 | 7 35114 36672 1100491 121509788 [PASS2] 18 | 8 36815 37565 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-03-26-2131-orig-nolist.profile: -------------------------------------------------------------------------------- 1 | 2021-03-26T21:31:18+01:00 2 | Original version without src list during compile 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 830.786.988 989.908.172 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15887 65535 475419 52854657 (etc) 11 | 1 19318 21455 1035458 114210370 [MEMMAN-ETC] 12 | 2 21459 22678 1384162 153117590 [FILE-HANDLING] 13 | 3 22682 23339 313708 34373231 [INPUT] 14 | 4 23343 25749 2695157 299094501 [SCANNER] 15 | 5 25753 27129 153639 17396511 [SYMTAB] 16 | 6 27133 35110 1826434 197594285 [PARSER] 17 | 7 35114 36672 1100491 121235385 [PASS2] 18 | 8 36815 37565 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-03-28-0110-operq.profile: -------------------------------------------------------------------------------- 1 | 2021-03-28T01:10:29+01:00 2 | operator? in scanner optimized for speed, no more loop 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 728.681.644 887.934.157 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 475431 52874525 (etc) 11 | 1 19316 21453 1035478 114299050 [MEMMAN-ETC] 12 | 2 21457 22676 1384214 153217916 [FILE-HANDLING] 13 | 3 22680 23337 313708 34400869 [INPUT] 14 | 4 23341 25905 1750140 196516875 [SCANNER] 15 | 5 25909 27285 153639 17400568 [SYMTAB] 16 | 6 27289 35263 1826434 197743285 [PARSER] 17 | 7 35267 36825 1100611 121544654 [PASS2] 18 | 8 36968 37719 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-03-28-1948-oper.profile: -------------------------------------------------------------------------------- 1 | 2021-03-28T19:48:20+02:00 2 | operator optimized for speed, too, after operator? 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 724.749.484 884.001.997 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 475431 52856950 (etc) 11 | 1 19316 21453 1038030 114537078 [MEMMAN-ETC] 12 | 2 21457 22676 1384214 153200867 [FILE-HANDLING] 13 | 3 22680 23337 313708 34374813 [INPUT] 14 | 4 23341 25905 1713684 192370861 [SCANNER] 15 | 5 25909 27285 153639 17406319 [SYMTAB] 16 | 6 27289 35263 1826434 197768726 [PARSER] 17 | 7 35267 36825 1100611 121532616 [PASS2] 18 | 8 36968 37719 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-03-28-2144-nextword.profile: -------------------------------------------------------------------------------- 1 | 2021-03-28T21:44:31+02:00 2 | more detailed profiles of scanner exposing usage of nextword 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 724.815.020 883.936.461 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 475479 52862071 (etc) 11 | 1 19316 21453 1038110 114573443 [MEMMAN-ETC] 12 | 2 21457 22676 1384422 153186858 [FILE-HANDLING] 13 | 3 22680 23337 313708 34349430 [INPUT] 14 | 4 23341 26113 1713684 192260377 [SCANNER] 15 | 5 26117 27493 153639 17412410 [SYMTAB] 16 | 6 27497 35472 1826434 198032869 [PARSER] 17 | 7 35476 37034 1101091 121328995 [PASS2] 18 | 8 37177 37927 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-03-2337-thisword.profile: -------------------------------------------------------------------------------- 1 | 2021-04-03T23:37:17+02:00 2 | nextword/backword replaced by thisword/accept 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 635.227.308 794.348.749 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 497891 55192602 (etc) 11 | 1 19316 21453 939654 103578004 [MEMMAN-ETC] 12 | 2 21457 22676 1384422 153259960 [FILE-HANDLING] 13 | 3 22680 23337 313716 34378460 [INPUT] 14 | 4 23341 26062 1019251 113532446 [SCANNER] 15 | 5 26066 27442 153639 17411979 [SYMTAB] 16 | 6 27446 35465 1805554 195706591 [PARSER] 17 | 7 35469 37027 1101091 121325306 [PASS2] 18 | 8 37170 37920 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-04-0011-parser.profile: -------------------------------------------------------------------------------- 1 | 2021-04-04T00:11:31+02:00 2 | smaller parser code, common snippets extracted, case? replaced by tables 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 639.684.012 799.132.876 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 497825 55193807 (etc) 11 | 1 19047 21184 939544 103535790 [MEMMAN-ETC] 12 | 2 21188 22407 1384136 153433132 [FILE-HANDLING] 13 | 3 22411 23069 313716 34332998 [INPUT] 14 | 4 23073 25793 1019251 113561580 [SCANNER] 15 | 5 25797 27173 153639 17404624 [SYMTAB] 16 | 6 27177 34979 1846111 200060753 [PARSER] 17 | 7 34983 36541 1100431 121572943 [PASS2] 18 | 8 36684 37434 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-04-0015-compound.profile: -------------------------------------------------------------------------------- 1 | 2021-04-04T00:15:14+02:00 2 | same compacted parser code, but with extra compound test in test suite 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 644.861.356 805.555.404 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 501416 55569437 (etc) 11 | 1 19047 21184 947268 104440768 [MEMMAN-ETC] 12 | 2 21188 22407 1396439 154831260 [FILE-HANDLING] 13 | 3 22411 23069 316896 34682755 [INPUT] 14 | 4 23073 25793 1027858 114523479 [SCANNER] 15 | 5 25797 27173 155294 17592184 [SYMTAB] 16 | 6 27177 34979 1858844 201359581 [PARSER] 17 | 7 34983 36541 1109557 122555828 [PASS2] 18 | 8 36684 37434 0 0 [SHELL] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-16-0131-strings.profile: -------------------------------------------------------------------------------- 1 | 2021-04-16T01:31:47+02:00 2 | strcmp/spy/cat and alpha/num/alphanum moved to strings.fth 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 644.730.028 805.359.052 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 216494 22948435 (etc) 11 | 1 18921 19116 480396 56645293 [STRINGS] 12 | 2 19128 21266 947278 104421341 [MEMMAN-ETC] 13 | 3 21270 22490 1396465 154541959 [FILE-HANDLING] 14 | 4 22494 23151 316896 34711112 [INPUT] 15 | 5 23155 25816 832390 90610649 [SCANNER] 16 | 6 25820 27196 155294 17603763 [SYMTAB] 17 | 7 27200 35003 1858844 201343115 [PARSER] 18 | 8 35007 36565 1109617 122555758 [PASS2] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-17-0112-alphanum.profile: -------------------------------------------------------------------------------- 1 | 2021-04-17T01:12:41+02:00 2 | alpha? num? alphanum? ported to assembly 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 621.071.532 781.438.412 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 216494 22931496 (etc) 11 | 1 18921 19129 284928 32796137 [STRINGS] 12 | 2 19141 21278 947278 104463375 [MEMMAN-ETC] 13 | 3 21282 22501 1396465 154563720 [FILE-HANDLING] 14 | 4 22505 23163 316896 34718023 [INPUT] 15 | 5 23167 25826 832390 90769071 [SCANNER] 16 | 6 25830 27206 155294 17584803 [SYMTAB] 17 | 7 27210 35013 1858844 201386042 [PARSER] 18 | 8 35017 36575 1109617 122256703 [PASS2] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-23-1012-findstr2.profile: -------------------------------------------------------------------------------- 1 | 2021-04-23T10:12:41+02:00 2 | string-length indexed string search in string tabs. 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 579.980.460 740.543.948 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 216506 22950222 (etc) 11 | 1 18921 19129 114310 12976436 [STRINGS] 12 | 2 19141 21392 742175 83029931 [MEMMAN-ETC] 13 | 3 21396 22616 1396517 154575151 [FILE-HANDLING] 14 | 4 22620 23277 316896 34740882 [INPUT] 15 | 5 23281 25976 832390 90869725 [SCANNER] 16 | 6 25980 27372 155294 17623890 [SYMTAB] 17 | 7 27376 35180 1858844 201608564 [PARSER] 18 | 8 35184 36735 1109737 122235615 [PASS2] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-23-2148-countstamps.profile: -------------------------------------------------------------------------------- 1 | 2021-04-23T21:48:00+02:00 2 | added deterministic countstamps. fixed timestamps low word random bug 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 579.731.026 740.298.316 7 | countstamps 8 | 5.290.027 6.743.516 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15885 65535 216585 22962235 (etc) 13 | 1 19222 19430 114310 12967362 [STRINGS] 14 | 2 19443 21696 742255 82442808 [MEMMAN-ETC] 15 | 3 21700 22919 1396725 154817330 [FILE-HANDLING] 16 | 4 22923 23581 316896 34709753 [INPUT] 17 | 5 23585 26282 832390 90931471 [SCANNER] 18 | 6 26286 27678 155294 17579470 [SYMTAB] 19 | 7 27682 35485 1858844 201521741 [PARSER] 20 | 8 35489 37040 1110217 122366024 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-04-25-1623-stringarray.profile: -------------------------------------------------------------------------------- 1 | 2021-04-25T16:23:23+02:00 2 | stringtab switched from linked list to array. length index formalized. 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 579.700.575 740.468.880 7 | countstamps 8 | 5.291.411 6.744.798 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15885 65535 216579 22974429 (etc) 13 | 1 19222 19430 114310 12968193 [STRINGS] 14 | 2 19443 21684 743629 83032569 [MEMMAN-ETC] 15 | 3 21688 22907 1396699 154557722 [FILE-HANDLING] 16 | 4 22911 23569 316896 34747986 [INPUT] 17 | 5 23573 26242 832390 90765063 [SCANNER] 18 | 6 26246 27631 155294 17596849 [SYMTAB] 19 | 7 27635 35436 1858844 201523105 [PARSER] 20 | 8 35440 36991 1110157 122302842 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-05-27-2241-ansi.profile: -------------------------------------------------------------------------------- 1 | 2021-05-27T22:41:16+02:00 2 | ansi-style function defs added, test suite migratged, some bugfixes 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 578.131.731 738.913.886 7 | countstamps 8 | 5.277.772 6.731.159 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15742 65535 216332 22922983 (etc) 13 | 1 19079 19287 112526 12753566 [STRINGS] 14 | 2 19299 21538 742680 82661819 [MEMMAN-ETC] 15 | 3 21542 22761 1394433 154278990 [FILE-HANDLING] 16 | 4 22765 23423 314520 34460427 [INPUT] 17 | 5 23427 26096 827801 90355819 [SCANNER] 18 | 6 26100 27485 153896 17449103 [SYMTAB] 19 | 7 27489 35439 1858814 201415283 [PARSER] 20 | 8 35443 36994 1110157 122615774 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-09-05-1630-pdclib.profile: -------------------------------------------------------------------------------- 1 | 2021-09-05T16:30:51+02:00 2 | compiler fixes applied while porting pdclib 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 587.165.946 749.372.106 7 | countstamps 8 | 5.308.043 6.762.509 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15742 65535 216356 23182209 (etc) 13 | 1 19171 19379 112526 12889109 [STRINGS] 14 | 2 19391 21655 742739 83365477 [MEMMAN-ETC] 15 | 3 21659 22878 1394605 156134459 [FILE-HANDLING] 16 | 4 22882 23539 314552 34788194 [INPUT] 17 | 5 23543 26213 827791 91226606 [SCANNER] 18 | 6 26217 27608 153929 17614240 [SYMTAB] 19 | 7 27612 35464 1888988 206551832 [PARSER] 20 | 8 35468 37110 1111023 123619859 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-12-19-2317-fastcall.profile: -------------------------------------------------------------------------------- 1 | 2021-12-19T23:17:38+01:00 2 | fastcall declarations and function pointers implemented 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 587.081.446 749.594.535 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15742 65535 216848 23255415 (etc) 13 | 1 19259 19467 113486 12971420 [STRINGS] 14 | 2 19479 21698 744114 83580348 [MEMMAN-ETC] 15 | 3 21702 22922 1396466 156440776 [FILE-HANDLING] 16 | 4 22926 23583 315320 34958368 [INPUT] 17 | 5 23587 26274 829111 91606152 [SCANNER] 18 | 6 26278 27669 153929 17618048 [SYMTAB] 19 | 7 27673 35588 1875549 205369624 [PARSER] 20 | 8 35592 37238 1112813 123794263 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2021-12-22-2348-v0.10.profile: -------------------------------------------------------------------------------- 1 | 2021-12-22T23:48:32+01:00 2 | v0.10 release 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 586.199.900 748.748.739 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15742 65535 216848 23218175 (etc) 13 | 1 19259 19467 113486 12990881 [STRINGS] 14 | 2 19479 21712 744114 83543700 [MEMMAN-ETC] 15 | 3 21716 22935 1396466 156070883 [FILE-HANDLING] 16 | 4 22939 23596 315320 34885778 [INPUT] 17 | 5 23600 26287 829111 91386340 [SCANNER] 18 | 6 26291 27682 153929 17606028 [SYMTAB] 19 | 7 27686 35602 1875549 205230504 [PARSER] 20 | 8 35606 37252 1112813 123816329 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2022-08-28-2221-v0.11.profile: -------------------------------------------------------------------------------- 1 | 2022-08-28T22:21:05+02:00 2 | v0.11 release 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 587.297.513 750.750.962 7 | countstamps 8 | 5.300.211 6.757.840 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15775 65535 216860 23222960 (etc) 13 | 1 19292 19500 113486 12985190 [STRINGS] 14 | 2 19512 21745 744134 83680381 [MEMMAN-ETC] 15 | 3 21749 22968 1396518 157713167 [FILE-HANDLING] 16 | 4 22972 23629 315320 34867060 [INPUT] 17 | 5 23633 26321 829111 91360472 [SCANNER] 18 | 6 26325 27716 153929 17619323 [SYMTAB] 19 | 7 27720 35635 1875549 205471200 [PARSER] 20 | 8 35639 37285 1112933 123831088 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2023-12-05-2002-v0.12.profile: -------------------------------------------------------------------------------- 1 | 2023-12-05T20:02:50+01:00 2 | 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 586.660.866 750.057.207 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15775 65535 216848 23215222 (etc) 13 | 1 19262 19470 113486 13003574 [STRINGS] 14 | 2 19482 21715 744114 83529188 [MEMMAN-ETC] 15 | 3 21719 22938 1396466 157416098 [FILE-HANDLING] 16 | 4 22942 23599 315320 34892882 [INPUT] 17 | 5 23603 26290 829111 91355130 [SCANNER] 18 | 6 26294 27685 153929 17605918 [SYMTAB] 19 | 7 27689 35605 1875549 205231046 [PARSER] 20 | 8 35609 37255 1112813 123808028 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/cc64-1-2024-07-19-0014-v0.13.profile: -------------------------------------------------------------------------------- 1 | 2024-07-19T00:14:30+02:00 2 | 3 | 4 | profiler report PROFILE-CC64-1 5 | timestamps 6 | 587.446.630 751.075.942 7 | countstamps 8 | 5.300.451 6.759.271 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 3D9B FFFF 223974 24592903 (etc) 13 | 1 4A08 4ADA 113486 12978357 [STRINGS] 14 | 2 4AE6 542B 744244 83546841 [MEMMAN-ETC] 15 | 3 542F 5973 1397684 157468603 [FILE-HANDLING] 16 | 4 5977 5C0B 315320 34994881 [INPUT] 17 | 5 5C0F 66AF 829111 91293991 [SCANNER] 18 | 6 66CC 6978 146878 16830034 [SYMTAB] 19 | 7 6C58 8C0B 1875549 205476233 [PARSER] 20 | 8 8C0F 921E 1113025 123893978 [PASS2] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-03-28-2144-nextword.profile: -------------------------------------------------------------------------------- 1 | 2021-03-28T21:44:31+02:00 2 | more detailed profiles of scanner exposing usage of nextword 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 725.142.700 884.460.749 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 7162208 789492144 (etc) 11 | 1 25608 25652 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25656 25738 476000 53392834 [SCANNER-NEXTWORD-CORE] 13 | 3 25742 25798 344610 39090310 [SCANNER-NEXTWORD-BACKWORD] 14 | 4 25802 25840 6477 716030 [SCANNER-NEXTWORD-MARK] 15 | 5 25844 25891 17272 1817512 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-04-03-2337-thisword.profile: -------------------------------------------------------------------------------- 1 | 2021-04-03T23:37:17+02:00 2 | nextword/backword replaced by thisword/accept 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 635.423.916 794.807.501 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 7065330 778562120 (etc) 11 | 1 25608 25648 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25652 25714 41092 4523890 [SCANNER-FETCHWORD] 13 | 3 25718 25751 85047 9205894 [SCANNER-THISWORD] 14 | 4 25755 25793 6477 711890 [SCANNER-NEXTWORD-MARK] 15 | 5 25797 25844 17272 1824100 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-04-04-0011-parser.profile: -------------------------------------------------------------------------------- 1 | 2021-04-04T00:11:31+02:00 2 | smaller parser code, common snippets extracted, case? replaced by tables 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 639.946.156 799.657.164 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 7104765 783352437 (etc) 11 | 1 25339 25379 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25383 25445 41092 4539839 [SCANNER-FETCHWORD] 13 | 3 25449 25482 85047 9202876 [SCANNER-THISWORD] 14 | 4 25486 25524 6477 713775 [SCANNER-NEXTWORD-MARK] 15 | 5 25528 25575 17272 1821540 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-04-04-0015-compound.profile: -------------------------------------------------------------------------------- 1 | 2021-04-04T00:15:14+02:00 2 | same compacted parser code, but with extra compound test in test suite 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 645.123.500 806.276.300 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 7162570 789862400 (etc) 11 | 1 25339 25379 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25383 25445 41378 4564296 [SCANNER-FETCHWORD] 13 | 3 25449 25482 85677 9274954 [SCANNER-THISWORD] 14 | 4 25486 25524 6531 716487 [SCANNER-NEXTWORD-MARK] 15 | 5 25528 25575 17416 1839717 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-04-16-0131-strings.profile: -------------------------------------------------------------------------------- 1 | 2021-04-16T01:31:47+02:00 2 | strcmp/spy/cat and alpha/num/alphanum moved to strings.fth 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 644.926.636 805.752.268 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 7162672 789423856 (etc) 11 | 1 25362 25402 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25406 25468 41378 4556485 [SCANNER-FETCHWORD] 13 | 3 25472 25505 85677 9285933 [SCANNER-THISWORD] 14 | 4 25509 25547 6531 718081 [SCANNER-NEXTWORD-MARK] 15 | 5 25551 25598 17416 1833785 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-04-17-0112-alphanum.profile: -------------------------------------------------------------------------------- 1 | 2021-04-17T01:12:41+02:00 2 | alpha? num? alphanum? ported to assembly 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 621.268.140 781.766.092 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 6967204 765429279 (etc) 11 | 1 25372 25412 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25416 25478 41378 4549285 [SCANNER-FETCHWORD] 13 | 3 25482 25515 85677 9291539 [SCANNER-THISWORD] 14 | 4 25519 25557 6531 715377 [SCANNER-NEXTWORD-MARK] 15 | 5 25561 25608 17416 1853952 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-04-23-1012-findstr2.profile: -------------------------------------------------------------------------------- 1 | 2021-04-23T10:12:41+02:00 2 | string-length indexed string search in string tabs. 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 580.242.604 741.133.772 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 6591667 724768559 (etc) 11 | 1 25522 25562 0 0 [SCANNER-NEXTWORD-VARS] 12 | 2 25566 25628 41378 4596294 [SCANNER-FETCHWORD] 13 | 3 25632 25665 85677 9294071 [SCANNER-THISWORD] 14 | 4 25669 25707 6531 717783 [SCANNER-NEXTWORD-MARK] 15 | 5 25711 25758 17416 1833906 [SCANNER-NEXTWORD-ADVANCED?] 16 | 6 65535 65535 0 0 17 | 7 65535 65535 0 0 18 | 8 65535 65535 0 0 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2021-12-22-2348-v0.10.profile: -------------------------------------------------------------------------------- 1 | 2021-12-22T23:48:32+01:00 2 | v0.10 release 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 586.521.921 749.314.289 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15742 65535 6606743 732759365 (etc) 13 | 1 25833 25873 0 0 [SCANNER-NEXTWORD-VARS] 14 | 2 25877 25939 41158 4589122 [SCANNER-FETCHWORD] 15 | 3 25943 25976 85788 9385420 [SCANNER-THISWORD] 16 | 4 25980 26018 6531 726108 [SCANNER-NEXTWORD-MARK] 17 | 5 26022 26069 17416 1854153 [SCANNER-NEXTWORD-ADVANCED?] 18 | 6 65535 65535 0 0 19 | 7 65535 65535 0 0 20 | 8 65535 65535 0 0 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2022-08-28-2221-v0.11.profile: -------------------------------------------------------------------------------- 1 | 2022-08-28T22:21:05+02:00 2 | v0.11 release 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 587.560.152 751.242.079 7 | countstamps 8 | 5.300.211 6.757.840 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15775 65535 6606947 734645932 (etc) 13 | 1 25867 25907 0 0 [SCANNER-NEXTWORD-VARS] 14 | 2 25911 25973 41158 4616230 [SCANNER-FETCHWORD] 15 | 3 25977 26010 85788 9397698 [SCANNER-THISWORD] 16 | 4 26014 26052 6531 728889 [SCANNER-NEXTWORD-MARK] 17 | 5 26056 26103 17416 1853209 [SCANNER-NEXTWORD-ADVANCED?] 18 | 6 65535 65535 0 0 19 | 7 65535 65535 0 0 20 | 8 65535 65535 0 0 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2023-12-05-2002-v0.12.profile: -------------------------------------------------------------------------------- 1 | 2023-12-05T20:02:50+01:00 2 | 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 586.985.829 750.695.029 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15775 65535 6606743 734101874 (etc) 13 | 1 25836 25876 0 0 [SCANNER-NEXTWORD-VARS] 14 | 2 25880 25942 41158 4617548 [SCANNER-FETCHWORD] 15 | 3 25946 25979 85788 9391499 [SCANNER-THISWORD] 16 | 4 25983 26021 6531 726050 [SCANNER-NEXTWORD-MARK] 17 | 5 26025 26072 17416 1857937 [SCANNER-NEXTWORD-ADVANCED?] 18 | 6 65535 65535 0 0 19 | 7 65535 65535 0 0 20 | 8 65535 65535 0 0 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/nextword-2024-07-19-0014-v0.13.profile: -------------------------------------------------------------------------------- 1 | 2024-07-19T00:14:30+02:00 2 | 3 | 4 | profiler report PROFILE-SCANNER-NEXTWORD 5 | timestamps 6 | 587.876.956 751.720.029 7 | countstamps 8 | 5.300.451 6.759.271 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 3D9B FFFF 6608378 735172732 (etc) 13 | 1 64DD 6507 0 0 [SCANNER-NEXTWORD-VARS] 14 | 2 650B 654B 41158 4581727 [SCANNER-FETCHWORD] 15 | 3 654F 6572 85788 9392041 [SCANNER-THISWORD] 16 | 4 6576 659E 6531 725104 [SCANNER-NEXTWORD-MARK] 17 | 5 65A2 65D3 17416 1848304 [SCANNER-NEXTWORD-ADVANCED?] 18 | 6 FFFF FFFF 0 0 19 | 7 FFFF FFFF 0 0 20 | 8 FFFF FFFF 0 0 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner1-2021-04-17-0112-alphanum.profile: -------------------------------------------------------------------------------- 1 | 2021-04-17T01:12:41+02:00 2 | alpha? num? alphanum? ported to assembly 3 | 4 | profiler report PROFILE-SCANNER1 5 | timestamps 6 | 621.202.604 781.766.092 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 6436832 707492868 (etc) 11 | 1 23187 23232 54266 5724423 [SCANNER-ALPHANUM] 12 | 2 23236 23517 2352 237456 [SCANNER-KEYWORD] 13 | 3 23521 23676 66969 7213777 [SCANNER-IDENTIFIER] 14 | 4 23680 24264 94351 10070185 [SCANNER-OPERATOR] 15 | 5 24268 24508 27320 3480745 [SCANNER-NUMBER] 16 | 6 24512 25025 240309 26368044 [SCANNER-CHAR/STRING] 17 | 7 25029 25189 151636 16028241 [SCANNER-(NEXTWORD] 18 | 8 25193 25339 44171 5214794 [SCANNER-COMMENT] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner1-2023-12-05-2002-v0.12.profile: -------------------------------------------------------------------------------- 1 | 2023-12-05T20:02:50+01:00 2 | 3 | 4 | profiler report PROFILE-SCANNER1 5 | timestamps 6 | 587.070.264 750.807.409 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15775 65535 6079432 675999743 (etc) 13 | 1 23623 23668 54064 5761224 [SCANNER-ALPHANUM] 14 | 2 23672 23984 2334 258742 [SCANNER-KEYWORD] 15 | 3 23988 24143 66807 7272796 [SCANNER-IDENTIFIER] 16 | 4 24147 24727 94045 10143455 [SCANNER-OPERATOR] 17 | 5 24731 24971 27340 3514750 [SCANNER-NUMBER] 18 | 6 24975 25489 238983 26512182 [SCANNER-CHAR/STRING] 19 | 7 25493 25653 150680 16095273 [SCANNER-(NEXTWORD] 20 | 8 25657 25803 43951 5249123 [SCANNER-COMMENT] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner1-2024-07-19-0014-v0.13.profile: -------------------------------------------------------------------------------- 1 | 2024-07-19T00:14:30+02:00 2 | 3 | 4 | profiler report PROFILE-SCANNER1 5 | timestamps 6 | 587.829.895 751.686.239 7 | countstamps 8 | 5.300.451 6.759.271 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 3D9B FFFF 6081067 676939311 (etc) 13 | 1 5C25 5C54 54064 5764364 [SCANNER-ALPHANUM] 14 | 2 5C58 5D92 2334 255676 [SCANNER-KEYWORD] 15 | 3 5D96 5E33 66807 7280949 [SCANNER-IDENTIFIER] 16 | 4 5E37 607E 94045 10151965 [SCANNER-OPERATOR] 17 | 5 6082 6174 27340 3510784 [SCANNER-NUMBER] 18 | 6 6178 637C 238983 26458150 [SCANNER-CHAR/STRING] 19 | 7 6380 6422 150680 16081451 [SCANNER-(NEXTWORD] 20 | 8 6426 64BA 43951 5243468 [SCANNER-COMMENT] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner2-2021-04-17-0112-alphanum.profile: -------------------------------------------------------------------------------- 1 | 2021-04-17T01:12:41+02:00 2 | alpha? num? alphanum? ported to assembly 3 | 4 | profiler report PROFILE-SCANNER2 5 | timestamps 6 | 621.333.676 781.897.164 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 6439170 707828080 (etc) 11 | 1 23187 23232 54266 5727810 [SCANNER-ALPHANUM] 12 | 2 23521 23676 66969 7227164 [SCANNER-IDENTIFIER] 13 | 3 23680 24264 94351 10070169 [SCANNER-OPERATOR] 14 | 4 24268 24508 27320 3489144 [SCANNER-NUMBER] 15 | 5 24512 25025 240309 26351319 [SCANNER-CHAR/STRING] 16 | 6 25029 25189 151636 16029215 [SCANNER-(NEXTWORD] 17 | 7 25193 25339 44171 5224767 [SCANNER-COMMENT] 18 | 8 25612 25826 14 1551 [SCANNER-REST] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner2-2023-12-05-2002-v0.12.profile: -------------------------------------------------------------------------------- 1 | 2023-12-05T20:02:50+01:00 2 | 3 | 4 | profiler report PROFILE-SCANNER2 5 | timestamps 6 | 587.018.128 750.663.581 7 | countstamps 8 | 5.300.211 6.757.636 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 15775 65535 6081752 676147667 (etc) 13 | 1 23623 23668 54064 5758182 [SCANNER-ALPHANUM] 14 | 2 23988 24143 66807 7281999 [SCANNER-IDENTIFIER] 15 | 3 24147 24727 94045 10135294 [SCANNER-OPERATOR] 16 | 4 24731 24971 27340 3513776 [SCANNER-NUMBER] 17 | 5 24975 25489 238983 26495879 [SCANNER-CHAR/STRING] 18 | 6 25493 25653 150680 16090426 [SCANNER-(NEXTWORD] 19 | 7 25657 25803 43951 5238629 [SCANNER-COMMENT] 20 | 8 26076 26290 14 1608 [SCANNER-REST] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner2-2024-07-19-0014-v0.13.profile: -------------------------------------------------------------------------------- 1 | 2024-07-19T00:14:30+02:00 2 | 3 | 4 | profiler report PROFILE-SCANNER2 5 | timestamps 6 | 587.787.844 751.604.260 7 | countstamps 8 | 5.300.451 6.759.271 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 3D9B FFFF 6083387 677110497 (etc) 13 | 1 5C25 5C54 54064 5757756 [SCANNER-ALPHANUM] 14 | 2 5D96 5E33 66807 7277969 [SCANNER-IDENTIFIER] 15 | 3 5E37 607E 94045 10136248 [SCANNER-OPERATOR] 16 | 4 6082 6174 27340 3513266 [SCANNER-NUMBER] 17 | 5 6178 637C 238983 26470250 [SCANNER-CHAR/STRING] 18 | 6 6380 6422 150680 16094733 [SCANNER-(NEXTWORD] 19 | 7 6426 64BA 43951 5241898 [SCANNER-COMMENT] 20 | 8 65D7 66AF 14 1522 [SCANNER-REST] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner3-2021-04-17-0112-alphanum.profile: -------------------------------------------------------------------------------- 1 | 2021-04-17T01:12:41+02:00 2 | alpha? num? alphanum? ported to assembly 3 | 4 | profiler report PROFILE-SCANNER3 5 | timestamps 6 | 621.333.676 781.897.164 7 | 8 | buckets 9 | b# addr[ ]addr nextcounts clockticks name 10 | 0 15885 65535 6315488 694901193 (etc) 11 | 1 23187 23232 54266 5732275 [SCANNER-ALPHANUM] 12 | 2 23521 23676 66969 7210038 [SCANNER-IDENTIFIER] 13 | 3 23680 24264 94351 10072662 [SCANNER-OPERATOR] 14 | 4 24512 25025 240309 26347195 [SCANNER-CHAR/STRING] 15 | 5 25029 25189 151636 16028905 [SCANNER-(NEXTWORD] 16 | 6 25193 25339 44171 5230705 [SCANNER-COMMENT] 17 | 7 25343 25608 151002 16411159 [SCANNER-NEXTWORD] 18 | 8 25612 25826 14 1723 [SCANNER-REST] 19 | 20 | -------------------------------------------------------------------------------- /tests/e2e/profile-register/scanner3-2024-07-19-0014-v0.13.profile: -------------------------------------------------------------------------------- 1 | 2024-07-19T00:14:30+02:00 2 | 3 | 4 | profiler report PROFILE-SCANNER3 5 | timestamps 6 | 587.856.246 751.687.232 7 | countstamps 8 | 5.300.451 6.759.271 9 | 10 | buckets 11 | b# addr[ ]addr nextcounts clockticks name 12 | 0 3D9B FFFF 5959834 664150672 (etc) 13 | 1 5C25 5C54 54064 5756326 [SCANNER-ALPHANUM] 14 | 2 5D96 5E33 66807 7281649 [SCANNER-IDENTIFIER] 15 | 3 5E37 607E 94045 10143614 [SCANNER-OPERATOR] 16 | 4 6178 637C 238983 26473636 [SCANNER-CHAR/STRING] 17 | 5 6380 6422 150680 16087776 [SCANNER-(NEXTWORD] 18 | 6 6426 64BA 43951 5243626 [SCANNER-COMMENT] 19 | 7 64BE 65D3 150893 16548119 [SCANNER-NEXTWORD] 20 | 8 65D7 66AF 14 1693 [SCANNER-REST] 21 | 22 | -------------------------------------------------------------------------------- /tests/e2e/register-profiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | name="$1" 6 | shift 7 | description="$@" 8 | 9 | e2e_dir="$(dirname "${BASH_SOURCE[0]}")" 10 | cd "${e2e_dir}" 11 | 12 | date_full="$(date -Iseconds)" 13 | date_name="$(date -d "${date_full}" +%F-%H%M)" 14 | 15 | profiles=$(echo *.profile|sort) 16 | 17 | echo "name=name-${date_name}-${name}" 18 | echo "${date_full}" 19 | echo "description=y${description}y" 20 | echo "profiles=${profiles}" 21 | 22 | for p in ${profiles}; do 23 | echo $p 24 | p_base="$(basename -s .profile "${p}")" 25 | ( echo "${date_full}" 26 | echo "${description}" 27 | cat "${p}" 28 | ) > "./profile-register/${p_base}-${date_name}-${name}.profile" 29 | done 30 | -------------------------------------------------------------------------------- /tests/e2e/run-in-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | test -n "${CC64TARGET}" || export CC64TARGET=c64 5 | 6 | testbinary="${1}" 7 | test -n "${testbinary}" || exit 1 8 | 9 | testdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 10 | source "${testdir}/basedir.shlib" 11 | emulatordir="$(realpath --relative-to="$PWD" "${basedir}/emulator")" 12 | targetfiles="$(realpath --relative-to="$PWD" "${testdir}/${CC64TARGET}files")" 13 | 14 | keybuf='open1,8,15,"s0:notdone":close1' 15 | 16 | export OUTFILES="${testbinary}.out" 17 | export CBMFILES="${targetfiles}" 18 | export AUTOSTARTDIR="${targetfiles}" 19 | "${emulatordir}/run-in-${CC64TARGET}emu.sh" "${testbinary}" "${keybuf}" 20 | -------------------------------------------------------------------------------- /tests/e2e/scanner1.pfs: -------------------------------------------------------------------------------- 1 | 2 | profile-scanner1 3 | cc suite.c 4 | profile2file scanner1.profile 5 | -------------------------------------------------------------------------------- /tests/e2e/scanner2.pfs: -------------------------------------------------------------------------------- 1 | 2 | profile-scanner2 3 | cc suite.c 4 | profile2file scanner2.profile 5 | -------------------------------------------------------------------------------- /tests/e2e/scanner3.pfs: -------------------------------------------------------------------------------- 1 | 2 | profile-scanner3 3 | cc suite.c 4 | profile2file scanner3.profile 5 | -------------------------------------------------------------------------------- /tests/e2e/shift-test.c: -------------------------------------------------------------------------------- 1 | 2 | shift_test() { 3 | assertEq(1 << 0, 1, "1 << 0"); 4 | assertEq(1 >> 0, 1, "1 >> 0"); 5 | assertEq(-1 << 0, -1, "-1 << 0"); 6 | assertEq(-1 >> 0, -1, "-1 >> 0"); 7 | assertEq(1 << 1, 2, "1 << 1"); 8 | assertEq(1 >> 1, 0, "1 >> 1"); 9 | assertEq(-1 << 1, -2, "-1 << 1"); 10 | assertEq(-1 >> 1, -1, "-1 >> 1"); 11 | assertEq(2 << 1, 4, "2 << 1"); 12 | assertEq(2 >> 1, 1, "2 >> 1"); 13 | assertEq(-2 << 1, -4, "-2 << 1"); 14 | assertEq(-2 >> 1, -1, "-2 >> 1"); 15 | assertEq(10 << 5, 320, "10 << 5"); 16 | assertEq(320 >> 5, 10, "320 >> 5"); 17 | assertEq(-10 << 5, -320, "-10 << 5"); 18 | assertEq(-320 >> 5, -10, "-320 >> 5"); 19 | assertEq(1 << 14, 16384, "1 << 14"); 20 | assertEq(-1 << 14, -16384, "-1 << 14"); 21 | evaluateAsserts(); 22 | } 23 | -------------------------------------------------------------------------------- /tests/e2e/shift.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/e2e/sub.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/e2e/switch-test.c: -------------------------------------------------------------------------------- 1 | 2 | switch_test() { 3 | int i; 4 | 5 | for (i = 0; i < 10; ++i) { 6 | switch(i) { 7 | case 1: 8 | print(itoa(i)); 9 | println(": i is one."); 10 | break; 11 | case 3: 12 | print(itoa(i)); 13 | println(": i is three."); 14 | /* fall-through */ 15 | case 7: 16 | print(itoa(i)); 17 | println(": i is three or seven."); 18 | break; 19 | default: 20 | print(itoa(i)); 21 | println(": i is something else."); 22 | break; 23 | case 8: 24 | print(itoa(i)); 25 | println(": i is eight."); 26 | break; 27 | } 28 | } 29 | evaluateAsserts(); 30 | } 31 | -------------------------------------------------------------------------------- /tests/e2e/switch.golden: -------------------------------------------------------------------------------- 1 | 0: i is something else. 2 | 1: i is one. 3 | 2: i is something else. 4 | 3: i is three. 5 | 3: i is three or seven. 6 | 4: i is something else. 7 | 5: i is something else. 8 | 6: i is something else. 9 | 7: i is three or seven. 10 | 8: i is eight. 11 | 9: i is something else. 12 | No assert failed. 13 | -------------------------------------------------------------------------------- /tests/e2e/test-main.h: -------------------------------------------------------------------------------- 1 | 2 | main() 3 | { 4 | int i; 5 | _open(1,8,2, name()); 6 | _chkout(1); 7 | test(); 8 | if (failedAsserts) { 9 | println("Some test didn't evaluate its asserts."); 10 | } 11 | _clrchn(); 12 | _close(1); 13 | } 14 | -------------------------------------------------------------------------------- /tests/e2e/while.golden: -------------------------------------------------------------------------------- 1 | Before no-iteration while loop 2 | After no-iteration while loop 3 | Before 4-iteration while loop 4 | Iteration 4 5 | Iteration 3 6 | Iteration 2 7 | Iteration 1 8 | After 4-iteration while loop 9 | Before 3-2-iteration nested while loops 10 | Outer iteration 3 11 | Inner iteration 3 , 2 12 | Inner iteration 3 , 1 13 | Outer iteration 2 14 | Outer iteration 1 15 | Inner iteration 1 , 2 16 | After 3-2-iteration nested while loops 17 | No assert failed. 18 | -------------------------------------------------------------------------------- /tests/integration/basedir.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | basedir="$(realpath --relative-to="$PWD" "${testdir}/../..")" 4 | -------------------------------------------------------------------------------- /tests/integration/compile-in-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | test -n "${CC64HOST}" || export CC64HOST=c64 5 | test -n "${OUTFILES}" || export OUTFILES="" 6 | 7 | testname="${1}" 8 | cc64="${2}" 9 | test -n "${cc64}" || cc64="cc64" 10 | 11 | testdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 12 | source "${testdir}/basedir.shlib" 13 | emulatordir="$(realpath --relative-to="$PWD" "${basedir}/emulator")" 14 | hostfiles="$(realpath --relative-to="$PWD" "${testdir}/${CC64HOST}files")" 15 | 16 | keybuf="cc ${testname}.c\ndos s0:notdone" 17 | 18 | export CBMFILES="${hostfiles}" 19 | "${emulatordir}/run-in-${CC64HOST}emu.sh" "${cc64}" "${keybuf}" 20 | -------------------------------------------------------------------------------- /tests/integration/libtest.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt-c64-08-9f.h" 3 | 4 | extern up *= 0xfb; 5 | static vp *= 0xfd; 6 | 7 | int i, x; 8 | char *p; 9 | int a[5]; 10 | 11 | static int s; 12 | 13 | char f(g) 14 | int g; 15 | { 16 | return 'x'; 17 | } 18 | -------------------------------------------------------------------------------- /tests/integration/libtest.golden: -------------------------------------------------------------------------------- 1 | 2 | #pragma cc64 0xFD 0xFB 0x801 0x840 0x9F4 0x9FEC 0xA000 libtest 3 | 4 | extern int a[] *= 0x9FEE ; 5 | extern char f() *= 0x9EE ; 6 | extern int i *= 0x9FFC ; 7 | extern char *p *= 0x9FF8 ; 8 | extern int x *= 0x9FFA ; 9 | extern int up *= 0xFB ; 10 | -------------------------------------------------------------------------------- /tests/lib/.gitignore: -------------------------------------------------------------------------------- 1 | rand-oracle 2 | -------------------------------------------------------------------------------- /tests/lib/basedir.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | basedir="$(realpath --relative-to="$PWD" "${testdir}/../..")" 4 | -------------------------------------------------------------------------------- /tests/lib/compile-in-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | test -n "${CC64HOST}" || export CC64HOST=c64 5 | test -n "${OUTFILES}" || export OUTFILES="" 6 | 7 | testname="${1}" 8 | 9 | testdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 10 | source "${testdir}/basedir.shlib" 11 | emulatordir="$(realpath --relative-to="$PWD" "${basedir}/emulator")" 12 | hostfiles="$(realpath --relative-to="$PWD" "${testdir}/${CC64HOST}files")" 13 | 14 | rm -f "${hostfiles}/${testname}.log" 15 | keybuf="logfile ${testname}.log\ncc ${testname}.c\nlogclose\ndos s0:notdone" 16 | 17 | export CBMFILES="${hostfiles}" 18 | "${emulatordir}/run-in-${CC64HOST}emu.sh" cc64 "${keybuf}" 19 | -------------------------------------------------------------------------------- /tests/lib/concat-outfile.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | # input: 4 | # $targetfiles 5 | # $suitename 6 | # $suiteshort 7 | # $out_files 8 | 9 | petscii2ascii "${targetfiles}/${suiteshort}.out" "${suitename}.out" 10 | for out in $out_files; do 11 | petscii2ascii "${targetfiles}/${out}" "${out}" 12 | echo "${out}:" >> "${suitename}.out" 13 | cat "${out}" >> "${suitename}.out" 14 | done 15 | -------------------------------------------------------------------------------- /tests/lib/ctype/include.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/lib/ctype/isalnum-test.c: -------------------------------------------------------------------------------- 1 | 2 | isalnum_test() { 3 | assertTrue(isalnum('a'), "isalnum('a')"); 4 | assertTrue(isalnum('z'), "isalnum('z')"); 5 | assertTrue(isalnum('A'), "isalnum('A')"); 6 | assertTrue(isalnum('Z'), "isalnum('Z')"); 7 | assertTrue(isalnum('0'), "isalnum('0')"); 8 | assertTrue(isalnum('9'), "isalnum('9')"); 9 | assertTrue(isalnum('_'), "isalnum('_')"); 10 | assertTrue(!isalnum(' '), "!isalnum(' ')"); 11 | assertTrue(!isalnum('\n'), "!isalnum('\n')"); 12 | assertTrue(!isalnum('@'), "!isalnum('@')"); 13 | 14 | evaluateAsserts(); 15 | } 16 | -------------------------------------------------------------------------------- /tests/lib/ctype/isalpha-test.c: -------------------------------------------------------------------------------- 1 | 2 | isalpha_test() { 3 | assertTrue(isalpha('a'), "isalpha('a')"); 4 | assertTrue(isalpha('z'), "isalpha('z')"); 5 | assertTrue(isalpha('A'), "isalpha('A')"); 6 | assertTrue(isalpha('Z'), "isalpha('Z')"); 7 | assertTrue(isalpha('_'), "isalpha('_')"); 8 | assertTrue(!isalpha(' '), "!isalpha(' ')"); 9 | assertTrue(!isalpha('1'), "!isalpha('1')"); 10 | assertTrue(!isalpha('@'), "!isalpha('@')"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/ctype/isdigit-test.c: -------------------------------------------------------------------------------- 1 | 2 | isdigit_test() { 3 | assertTrue(isdigit('0'), "isdigit('0')"); 4 | assertTrue(isdigit('9'), "isdigit('9')"); 5 | assertTrue(!isdigit(' '), "!isdigit(' ')"); 6 | assertTrue(!isdigit('a'), "!isdigit('a')"); 7 | assertTrue(!isdigit('@'), "!isdigit('@')"); 8 | 9 | evaluateAsserts(); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lib/ctype/islower-test.c: -------------------------------------------------------------------------------- 1 | 2 | islower_test() { 3 | assertTrue(islower('a'), "islower('a')"); 4 | assertTrue(islower('z'), "islower('z')"); 5 | assertTrue(!islower('A'), "!islower('A')"); 6 | assertTrue(!islower('Z'), "!islower('Z')"); 7 | assertTrue(!islower(' '), "!islower(' ')"); 8 | assertTrue(!islower('@'), "!islower('@')"); 9 | assertTrue(!islower(0), "!islower(0)"); 10 | assertTrue(!islower(256), "!islower(256)"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/ctype/isspace-test.c: -------------------------------------------------------------------------------- 1 | 2 | isspace_test() { 3 | assertTrue(isspace(' '), "isspace(' ')"); 4 | assertTrue(isspace('\f'), "isspace('\f')"); 5 | assertTrue(isspace('\n'), "isspace('\n')"); 6 | assertTrue(isspace('\r'), "isspace('\r')"); 7 | assertTrue(isspace('\t'), "isspace('\t')"); 8 | /* assertTrue(isspace('\v'), "isspace('\v')"); no \v in cc64 yet */ 9 | assertTrue(!isspace('a'), "!isspace('a')"); 10 | assertTrue(!isspace(256), "!isspace(256)"); 11 | assertTrue(!isspace(0), "!isspace(0)"); 12 | assertTrue(!isspace(8), "!isspace(8)"); 13 | 14 | evaluateAsserts(); 15 | } 16 | -------------------------------------------------------------------------------- /tests/lib/ctype/isupper-test.c: -------------------------------------------------------------------------------- 1 | 2 | isupper_test() { 3 | assertTrue(isupper('A'), "!isupper('A')"); 4 | assertTrue(isupper('Z'), "!isupper('Z')"); 5 | assertTrue(!isupper('a'), "isupper('a')"); 6 | assertTrue(!isupper('z'), "isupper('z')"); 7 | assertTrue(!isupper(' '), "!isupper(' ')"); 8 | assertTrue(!isupper('@'), "!isupper('@')"); 9 | assertTrue(!isupper(0), "!isupper(0)"); 10 | assertTrue(!isupper(256), "!isupper(256)"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/ctype/tolower-test.c: -------------------------------------------------------------------------------- 1 | 2 | tolower_test() { 3 | assertEq(tolower('A'), 'a', "tolower('A')"); 4 | assertEq(tolower('Z'), 'z', "tolower('Z')"); 5 | assertEq(tolower('a'), 'a', "tolower('a')"); 6 | assertEq(tolower('z'), 'z', "tolower('z')"); 7 | assertEq(tolower('@'), '@', "tolower('@')"); 8 | assertEq(tolower('['), '[', "tolower('[')"); 9 | assertEq(tolower(0), 0, "tolower(0)"); 10 | assertEq(tolower(256), 256, "tolower(256)"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/ctype/toupper-test.c: -------------------------------------------------------------------------------- 1 | 2 | toupper_test() { 3 | assertEq(toupper('a'), 'A', "toupper('a')"); 4 | assertEq(toupper('z'), 'Z', "toupper('z')"); 5 | assertEq(toupper('A'), 'A', "toupper('A')"); 6 | assertEq(toupper('Z'), 'Z', "toupper('Z')"); 7 | assertEq(toupper('@'), '@', "toupper('@')"); 8 | assertEq(toupper('['), '[', "toupper('[')"); 9 | assertEq(toupper(0), 0, "toupper(0)"); 10 | assertEq(toupper(256), 256, "toupper(256)"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/default.golden: -------------------------------------------------------------------------------- 1 | No assert failed. 2 | -------------------------------------------------------------------------------- /tests/lib/evaluate-suite.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | # imput: 4 | # $suitename 5 | 6 | # output: 7 | # $result 8 | 9 | rm -f "${suitename}.result" 10 | set +e 11 | diff suite.joined-golden "${suitename}.out" 12 | result=$? 13 | set -e 14 | test $result -eq 0 \ 15 | && echo "${suitename} PASS" > "${suitename}.result" \ 16 | || diff suite.joined-silver "${suitename}.out" > "${suitename}.result" 17 | # diff with suite.silver will additionally show test sections as diff. 18 | cat "${suitename}.result" 19 | -------------------------------------------------------------------------------- /tests/lib/include-libc-c16.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /tests/lib/include-libc-c64.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /tests/lib/include-libc-x16.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /tests/lib/printf/fprintf-test-src.c: -------------------------------------------------------------------------------- 1 | 2 | static char fprintf_file[] = "fprintf.out1"; 3 | int fh; 4 | 5 | fp(int len) { 6 | fprintf(fh, "%d\n", len); 7 | } 8 | 9 | fprintf_test1() { 10 | INCLUDE 11 | } 12 | 13 | fprintf_test() { 14 | fnunit = 8; 15 | 16 | assertEq(remove(fprintf_file), 0, "remove(fprintf_file)"); 17 | 18 | assertTrue((fh = fopen(fprintf_file, ",s,w")) != 0, 19 | "fopen(fprintf_file, \",s,w\")"); 20 | fprintf_test1(); 21 | /* golden file generation produces the "No assert failed." line. */ 22 | fprintf(fh, "No assert failed.\n"); 23 | fclose(fh); 24 | 25 | evaluateAsserts(); 26 | } 27 | -------------------------------------------------------------------------------- /tests/lib/printf/include.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/lib/printf/printf-test-src.c: -------------------------------------------------------------------------------- 1 | 2 | p(int len) { 3 | printf("%d\n", len); 4 | } 5 | 6 | printf_test() { 7 | tst_chkout(tst_file_no); 8 | INCLUDE 9 | tst_clrchn(); 10 | 11 | evaluateAsserts(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/lib/printf/sprintf-test-src.c: -------------------------------------------------------------------------------- 1 | 2 | char s[256]; 3 | 4 | sp(int len) { 5 | printf("%s%d\n", s, len); 6 | } 7 | 8 | sprintf_test() { 9 | tst_chkout(tst_file_no); 10 | INCLUDE 11 | tst_clrchn(); 12 | 13 | evaluateAsserts(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/lib/rand-oracle.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | unsigned int next = 1; 6 | 7 | int myrand( void ) { 8 | next = next * 1103515245 + 12345; 9 | next &= 0xffffffff; 10 | return (int) (next >> 16) & 0x7fff; 11 | } 12 | 13 | void mysrand(int seed) { 14 | next = seed; 15 | } 16 | 17 | int main(int argc, char *argv[]) { 18 | int count = argc >= 2 ? atoi(argv[1]) : 5; 19 | if (argc >= 3) { mysrand(atoi(argv[2])); } 20 | char *expected = argc >= 4 ? argv[3] : "rand_expected"; 21 | printf("int %s[] = {", expected); 22 | for (int i = 0; i < count - 1; ++i) { 23 | printf("%d, ", myrand()); 24 | } 25 | printf("%d};\n", myrand()); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /tests/lib/rand-oracle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | rand_expect_c="$1" 6 | 7 | ./rand-oracle 6 > "${rand_expect_c}" 8 | ./rand-oracle 6 17 rand_expected_17 >> "${rand_expect_c}" 9 | ./rand-oracle 6 32767 rand_expected_32767 >> "${rand_expect_c}" 10 | ./rand-oracle 6 0 rand_expected_0 >> "${rand_expect_c}" 11 | -------------------------------------------------------------------------------- /tests/lib/run-in-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | test -n "${CC64TARGET}" || export CC64TARGET=c64 5 | 6 | testbinary="${1}" 7 | shift 8 | extra_outfiles=$@ 9 | test -n "${testbinary}" || exit 1 10 | 11 | testdir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")" 12 | source "${testdir}/basedir.shlib" 13 | emulatordir="$(realpath --relative-to="$PWD" "${basedir}/emulator")" 14 | targetfiles="$(realpath --relative-to="$PWD" "${testdir}/${CC64TARGET}files")" 15 | 16 | keybuf='open1,8,15,"s0:notdone":close1' 17 | 18 | export OUTFILES="${testbinary}.out ${extra_outfiles}" 19 | export CBMFILES="${targetfiles}" 20 | export AUTOSTARTDIR="${targetfiles}" 21 | "${emulatordir}/run-in-${CC64TARGET}emu.sh" "${testbinary}" "${keybuf}" 22 | -------------------------------------------------------------------------------- /tests/lib/stdio/fopen.in2: -------------------------------------------------------------------------------- 1 | 2 | test-input file 3 | another line 4 | 5 | 0 6 | 1 7 | 2 8 | 9 | -------------------------------------------------------------------------------- /tests/lib/stdio/fopen.out1.golden: -------------------------------------------------------------------------------- 1 | @ 2 | fputs-teststring 3 | -------------------------------------------------------------------------------- /tests/lib/stdio/fopen.out2.golden: -------------------------------------------------------------------------------- 1 | 2 | test-input file 3 | another line 4 | 5 | 0 6 | 1 7 | 2 8 | 9 | -------------------------------------------------------------------------------- /tests/lib/stdio/fopen.out3.golden: -------------------------------------------------------------------------------- 1 | 2 | test-input file 3 | another line 4 | 5 | 0 6 | 1 7 | 2 8 | 9 | fputs-appendstring 10 | -------------------------------------------------------------------------------- /tests/lib/stdio/fputs-test.c: -------------------------------------------------------------------------------- 1 | 2 | fputs_test() { 3 | char message[] = "SUCCESS testing fputs()\n"; 4 | int fh; 5 | char filename[] = "fputs.out1"; 6 | 7 | fnunit = 8; 8 | 9 | assertEq(remove(filename), 0, "remove(filename)"); 10 | 11 | fh = fopen(filename, ",s,w"); 12 | assertTrue(fh != NULL, "fopen(fputs.out1) != NULL"); 13 | assertTrue(fputs(message, fh) >= 0, "fputs(message, fh) >= 0"); 14 | assertEq(fclose(fh), 0, "fclose(fh)"); 15 | 16 | evaluateAsserts(); 17 | } 18 | -------------------------------------------------------------------------------- /tests/lib/stdio/fputs.out1.golden: -------------------------------------------------------------------------------- 1 | SUCCESS testing fputs() 2 | -------------------------------------------------------------------------------- /tests/lib/stdio/include.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/lib/stdio/putchar-test.c: -------------------------------------------------------------------------------- 1 | 2 | putchar_test() { 3 | int i; 4 | tst_chkout(tst_file_no); 5 | for (i='0'; i <= '9'; ++i) { 6 | assertEq(putchar(i), i, "'0'..'9': putchar(i)"); 7 | } 8 | assertEq(putchar(13), 13, "putchar(13)"); 9 | assertEq(putchar('@'), '@', "putchar('@')"); 10 | assertEq(putchar(0x150), EOF, "putchar(256)"); 11 | for (i='a'; i <= 'm'; ++i) { 12 | assertEq(putchar(i), i, "'a'..'m': putchar(i)"); 13 | } 14 | assertEq(putchar('\n'), '\n', "putchar('\n')"); 15 | tst_clrchn(); 16 | 17 | evaluateAsserts(); 18 | } 19 | -------------------------------------------------------------------------------- /tests/lib/stdio/putchar.golden: -------------------------------------------------------------------------------- 1 | 0123456789 2 | @abcdefghijklm 3 | No assert failed. 4 | -------------------------------------------------------------------------------- /tests/lib/stdio/puts-test.c: -------------------------------------------------------------------------------- 1 | 2 | puts_test() { 3 | tst_chkout(tst_file_no); 4 | 5 | assertTrue(puts("Hello, World!\n") >= 0, "puts(Hello, Wolrd!)"); 6 | assertEq(puts(NULL), EOF, "puts(NULL)"); 7 | assertTrue(puts("1234") >= 0, "puts(1234)"); 8 | assertTrue(puts("5678\n") >= 0, "puts(5678)"); 9 | 10 | tst_clrchn(); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/stdio/puts.golden: -------------------------------------------------------------------------------- 1 | Hello, World! 2 | 12345678 3 | No assert failed. 4 | -------------------------------------------------------------------------------- /tests/lib/stdio/remove-test.c: -------------------------------------------------------------------------------- 1 | 2 | remove_test() { 3 | char filename[] = "remove-file"; 4 | 5 | fnunit = 8; 6 | assertEq(remove(filename), 0, "remove(filename), 8"); 7 | 8 | fnunit = 7; 9 | assertTrue(remove(filename) != 0, "remove(filename), 7"); 10 | 11 | fnunit = 8; 12 | 13 | evaluateAsserts(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/lib/stdlib/abs-test.c: -------------------------------------------------------------------------------- 1 | 2 | abs_test() { 3 | assertEq(abs(0), 0, "abs(0)"); 4 | assertEq(abs(INT_MAX), INT_MAX, "abs(INT_MAX)"); 5 | assertEq(abs(INT_MIN + 1), -(INT_MIN + 1), "abs(INT_MIN + 1)"); 6 | 7 | evaluateAsserts(); 8 | } 9 | -------------------------------------------------------------------------------- /tests/lib/stdlib/atoi-test.c: -------------------------------------------------------------------------------- 1 | 2 | atoi_test() { 3 | /* basic functionality */ 4 | assertEq(atoi("123"), 123, "atoi(\"123\")"); 5 | /* testing skipping of leading whitespace and trailing garbage */ 6 | assertEq(atoi(" \n\t\f456xyz"), 456, "atoi(\" \n\t\f456xyz\")"); 7 | /* \v removed between \t and \f above as cc64 doesn't support it */ 8 | 9 | evaluateAsserts(); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lib/stdlib/include.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/lib/stdlib/rand-expect.c: -------------------------------------------------------------------------------- 1 | int rand_expected[] = {16838, 5758, 10113, 17515, 31051, 5627}; 2 | int rand_expected_17[] = {24107, 16552, 12125, 9427, 13152, 21440}; 3 | int rand_expected_32767[] = {25968, 24173, 1248, 10215, 17959, 6719}; 4 | int rand_expected_0[] = {0, 21468, 9988, 22117, 3498, 16927}; 5 | -------------------------------------------------------------------------------- /tests/lib/string/include.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/lib/string/strcat-test.c: -------------------------------------------------------------------------------- 1 | 2 | strcat_test() { 3 | static char s[] = "xx\0xxxxxx"; 4 | assertEq(strcat(s, abcde), s, "strcat(s, abcde)"); 5 | assertEq(s[2], 'a', "s[2]"); 6 | assertEq(s[6], 'e', "s[6]"); 7 | assertEq(s[7], '\0', "s[7]"); 8 | assertEq(s[8], 'x', "s[8]"); 9 | s[0] = '\0'; 10 | assertEq(strcat(s, abcdx), s, "strcat(s, abcdx)"); 11 | assertEq(s[4], 'x', "s[4]"); 12 | assertEq(s[5], '\0', "s[5]"); 13 | assertEq(strcat(s, "\0"), s, "strcat(s, \"\0\")"); 14 | assertEq(s[5], '\0', "s[5]"); 15 | assertEq(s[6], 'e', "s[6]"); 16 | 17 | evaluateAsserts(); 18 | } 19 | -------------------------------------------------------------------------------- /tests/lib/string/strchr-test.c: -------------------------------------------------------------------------------- 1 | 2 | strchr_test() { 3 | static char abccd[] = "abccd"; 4 | assertEq(strchr(abccd, 'x'), NULL, "strchr(abccd, 'x')"); 5 | assertEq(strchr(abccd, 'a'), &abccd[0], "strchr(abccd, 'a')"); 6 | assertEq(strchr(abccd, 'd'), &abccd[4], "strchr(abccd, 'd')"); 7 | assertEq(strchr(abccd, '\0'), &abccd[5], "strchr(abccd, '\0')"); 8 | assertEq(strchr(abccd, 'c'), &abccd[2], "strchr(abccd, 'c')"); 9 | 10 | evaluateAsserts(); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lib/string/strcmp-test.c: -------------------------------------------------------------------------------- 1 | 2 | strcmp_test() { 3 | static char cmpabcde[] = "abcde"; 4 | static char cmpabcd_[] = "abcd\xfc"; 5 | static char empty[] = ""; 6 | assertEq(strcmp(abcde, cmpabcde), 0, "strcmp(abcde, cmpabcde)"); 7 | assertTrue(strcmp(abcde, abcdx) < 0, "strcmp(abcde, abcdx) < 0"); 8 | assertTrue(strcmp(abcdx, abcde) > 0, "strcmp(abcdx, abcde) > 0"); 9 | assertTrue(strcmp(empty, abcde) < 0, "strcmp(empty, abcde) < 0"); 10 | assertTrue(strcmp(abcde, empty) > 0, "strcmp(abcde, empty) > 0"); 11 | assertTrue(strcmp(abcde, cmpabcd_) < 0, "strcmp(abcde, cmpabcd_) < 0"); 12 | 13 | evaluateAsserts(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/lib/string/strcpy-test.c: -------------------------------------------------------------------------------- 1 | 2 | strcpy_test() { 3 | static char s[] = "xxxxx"; 4 | assertEq(strcpy(s, ""), s, "strcpy(s, \"\")"); 5 | assertEq(s[0], '\0', "s[0]"); 6 | assertEq(s[1], 'x', "s[1]"); 7 | assertEq(strcpy(s, abcde), s, "strcpy(s, abcde)"); 8 | assertEq(s[0], 'a', "s[0]"); 9 | assertEq(s[4], 'e', "s[4]"); 10 | assertEq(s[5], '\0', "s[5]"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/string/strcspn-test.c: -------------------------------------------------------------------------------- 1 | 2 | strcspn_test() { 3 | assertEq(strcspn(abcde, "x"), 5, "strcspn(abcde, \"x\")"); 4 | assertEq(strcspn(abcde, "xyz"), 5, "strcspn(abcde, \"xyz\")"); 5 | assertEq(strcspn(abcde, "zyx"), 5, "strcspn(abcde, \"zyx\")"); 6 | assertEq(strcspn(abcdx, "x"), 4, "strcspn(abcdx, \"x\")"); 7 | assertEq(strcspn(abcdx, "xyz"), 4, "strcspn(abcdx, \"xyz\")"); 8 | assertEq(strcspn(abcdx, "zyx"), 4, "strcspn(abcdx, \"zyx\")"); 9 | assertEq(strcspn(abcde, "a"), 0, "strcspn(abcde, \"a\")"); 10 | assertEq(strcspn(abcde, "abc"), 0, "strcspn(abcde, \"abc\")"); 11 | assertEq(strcspn(abcde, "cba"), 0, "strcspn(abcde, \"cba\")"); 12 | 13 | evaluateAsserts(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/lib/string/strlen-test.c: -------------------------------------------------------------------------------- 1 | 2 | strlen_test() { 3 | assertEq(strlen(abcde), 5, "strlen(abcde)"); 4 | assertEq(strlen(""), 0, "strlen(\"\")"); 5 | 6 | evaluateAsserts(); 7 | } 8 | -------------------------------------------------------------------------------- /tests/lib/string/strncpy-test.c: -------------------------------------------------------------------------------- 1 | 2 | strncpy_test() { 3 | static char s[] = "xxxxxxx"; 4 | assertEq(strncpy(s, "", 1), s, "strncpy(s, \"\", 1)"); 5 | assertEq(s[0], '\0', "s[0]"); 6 | assertEq(s[1], 'x', "s[1]"); 7 | assertEq(strncpy(s, abcde, 6), s, "strncpy(s, abcde, 6)"); 8 | assertEq(s[0], 'a', "s[0]"); 9 | assertEq(s[4], 'e', "s[4]"); 10 | assertEq(s[5], '\0', "s[5]"); 11 | assertEq(s[6], 'x', "s[6]"); 12 | assertEq(strncpy(s, abcde, 7), s, "strncpy(s, abcde, 7)"); 13 | assertEq(s[6], '\0', "s[6]"); 14 | assertEq(strncpy(s, "xxxx", 3), s, "strncpy(s, \"xxxx\", 3)"); 15 | assertEq(s[0], 'x', "s[0]"); 16 | assertEq(s[2], 'x', "s[2]"); 17 | assertEq(s[3], 'd', "s[3]"); 18 | 19 | evaluateAsserts(); 20 | } 21 | -------------------------------------------------------------------------------- /tests/lib/string/strpbrk-test.c: -------------------------------------------------------------------------------- 1 | 2 | strpbrk_test() { 3 | assertEq(strpbrk(abcde, "x"), NULL, "strpbrk(abcde, \"x\")"); 4 | assertEq(strpbrk(abcde, "xyz"), NULL, "strpbrk(abcde, \"xyz\")"); 5 | assertEq(strpbrk(abcdx, "x"), &abcdx[4], "strpbrk(abcdx, \"x\")"); 6 | assertEq(strpbrk(abcdx, "xyz"), &abcdx[4], "strpbrk(abcdx, \"xyz\")"); 7 | assertEq(strpbrk(abcdx, "zyx"), &abcdx[4], "strpbrk(abcdx, \"zyx\")"); 8 | assertEq(strpbrk(abcde, "a"), &abcde[0], "strpbrk(abcde, \"a\")"); 9 | assertEq(strpbrk(abcde, "abc"), &abcde[0], "strpbrk(abcde, \"abc\")"); 10 | assertEq(strpbrk(abcde, "cba"), &abcde[0], "strpbrk(abcde, \"cba\")"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/string/strrchr-test.c: -------------------------------------------------------------------------------- 1 | 2 | strrchr_test() { 3 | static char abccd[] = "abccd"; 4 | assertEq(strrchr(abcde, '\0'), &abcde[5], "strrchr(abcde, '\0')"); 5 | assertEq(strrchr(abcde, 'e'), &abcde[4], "strrchr(abcde, 'e')"); 6 | assertEq(strrchr(abcde, 'a'), &abcde[0], "strrchr(abcde, 'a')"); 7 | assertEq(strrchr(abccd, 'c'), &abccd[3], "strrchr(abccd, 'c')"); 8 | 9 | evaluateAsserts(); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lib/string/strspn-test.c: -------------------------------------------------------------------------------- 1 | 2 | strspn_test() { 3 | assertEq(strspn(abcde, "abc"), 3, "strspn(abcde, \"abc\")"); 4 | assertEq(strspn(abcde, "b"), 0, "strspn(abcde, \"b\")"); 5 | assertEq(strspn(abcde, abcde), 5, "strspn(abcde, abcde)"); 6 | 7 | evaluateAsserts(); 8 | } 9 | -------------------------------------------------------------------------------- /tests/lib/string/strstr-test.c: -------------------------------------------------------------------------------- 1 | 2 | strstr_test() { 3 | static char s[] = "abcabcabcdabcde"; 4 | assertEq(strstr(s, "x"), NULL, "strstr(s, \"x\")"); 5 | assertEq(strstr(s, "xyz"), NULL, "strstr(s, \"xyz\")"); 6 | assertEq(strstr(s, "a"), &s[0], "strstr(s, \"a\")"); 7 | assertEq(strstr(s, "abc"), &s[0], "strstr(s, \"abc\")"); 8 | assertEq(strstr(s, "abcd"), &s[6], "strstr(s, \"abcd\")"); 9 | assertEq(strstr(s, "abcde"), &s[10], "strstr(s, \"abcde\")"); 10 | 11 | evaluateAsserts(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/lib/strmem/include.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/lib/strmem/memchr-test.c: -------------------------------------------------------------------------------- 1 | 2 | memchr_test() { 3 | assertEq(memchr( abcde, 'c', 5 ), &abcde[2], 4 | "memchr( abcde, 'c', 5 ) == &abcde[2]"); 5 | assertEq(memchr( abcde, 'a', 1 ), &abcde[0], 6 | "memchr( abcde, 'a', 1 )"); 7 | assertEq(memchr( abcde, 'a', 0 ), NULL, 8 | "memchr( abcde, 'a', 0 )"); 9 | assertEq(memchr( abcde, '\0', 5 ), NULL, 10 | "memchr( abcde, '\0', 5 )"); 11 | assertEq(memchr( abcde, '\0', 6 ), &abcde[5], 12 | "memchr( abcde, '\0', 6 )"); 13 | 14 | evaluateAsserts(); 15 | } 16 | -------------------------------------------------------------------------------- /tests/lib/strmem/memcmp-test.c: -------------------------------------------------------------------------------- 1 | 2 | memcmp_test() { 3 | static char xxxxx[] = "xxxxx"; 4 | assertTrue( memcmp( abcde, abcdx, 5 ) < 0, 5 | "memcmp( abcde, abcdx, 5 ) < 0"); 6 | assertEq( memcmp( abcde, abcdx, 4 ), 0, 7 | "memcmp( abcde, abcdx, 4 )"); 8 | assertEq( memcmp( abcde, xxxxx, 0 ), 0, 9 | "memcmp( abcde, xxxxx, 0 )"); 10 | assertTrue( memcmp( xxxxx, abcde, 1 ) > 0, 11 | "memcmp( xxxxx, abcde, 1 ) > 0"); 12 | 13 | evaluateAsserts(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/lib/strmem/memcpy-test.c: -------------------------------------------------------------------------------- 1 | 2 | memcpy_test() { 3 | static char s[] = "xxxxxxxxxxx"; 4 | assertEq(memcpy( s, abcde, 6 ), s, "memcpy( s, abcde, 6 )"); 5 | assertEq(s[4], 'e', "s[4]"); 6 | assertEq(s[5], '\0', "s[5]"); 7 | assertEq(memcpy( s + 5, abcde, 5 ), s + 5, 8 | "memcpy( s + 5, abcde, 5 )"); 9 | assertEq(s[9], 'e', "s[9]"); 10 | assertEq(s[10], 'x', "s[10]"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/strmem/memmove-test.c: -------------------------------------------------------------------------------- 1 | 2 | memmove_test() { 3 | static char s[] = "xxxxabcde"; 4 | assertEq(memmove(s, s + 4, 5), s, "memmove(s, s + 4, 5)"); 5 | assertEq(s[0], 'a', "s[0]"); 6 | assertEq(s[4], 'e', "s[4]"); 7 | assertEq(s[5], 'b', "s[5]"); 8 | assertEq(memmove(s + 4, s, 5), s + 4, "memmove(s + 4, s, 5)"); 9 | assertEq(s[4], 'a', "s[4]"); 10 | 11 | evaluateAsserts(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/lib/strmem/memset-test.c: -------------------------------------------------------------------------------- 1 | 2 | memset_test() { 3 | static char s[] = "xxxxxxxxx"; 4 | assertEq(memset(s, 'o', 10), s, "memset(s, 'o', 10)"); 5 | assertEq(s[9], 'o', "s[9]"); 6 | assertEq(memset(s, '_', (0)), s, "memset(s, '_', (0))"); 7 | assertEq(s[0], 'o', "s[0]"); 8 | assertEq(memset(s, '_', 1), s, "memset(s, '_', 1)"); 9 | assertEq(s[0], '_', "s[0]"); 10 | assertEq(s[1], 'o', "s[1]"); 11 | 12 | evaluateAsserts(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/lib/test-main.h: -------------------------------------------------------------------------------- 1 | 2 | main() 3 | { 4 | int i; 5 | tst_open(tst_file_no, 8, 2, name()); 6 | test(); 7 | if (failedAsserts) { 8 | tst_println("Some test didn't evaluate its asserts."); 9 | } 10 | tst_close(tst_file_no); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lib/xprintf-golden.awk: -------------------------------------------------------------------------------- 1 | { print; print length() + 1; } 2 | END { print "No assert failed." } 3 | -------------------------------------------------------------------------------- /tests/lib/xprintf-test.awk: -------------------------------------------------------------------------------- 1 | /^INCLUDE$/ { 2 | system( \ 3 | "sed -e \"s/P[(]PRINTF[(]/$PRINTF/g\" \"$SUBDIR\"/xprintf-test-inc.c"); 4 | } 5 | !/^INCLUDE$/ { print; } 6 | -------------------------------------------------------------------------------- /tests/peddi/editfile.keybuf: -------------------------------------------------------------------------------- 1 | \x1d\x1d\x1d\x1d\x1d\x1d insert 2 | \x11\x11\x11\x11 3 | \x1d\x1d\x1d\x1d\x1d hello 4 | \x91\x91 5 | \x9d\x9d\x9d\x9d\x9d\x9d\x9d\x9d 6 | \x9d\x9d\x9d\x9d\x9d\x9d\x9d\x9d 7 | world 8 | \x11\x11\x11\x11\x11\x11\x11\x11 9 | \x14\x14\x14 10 | COL 11 | \x11\n 12 | \x88 13 | 20 lines down. 14 | \x91\x91\x91\x91\x91\x91\x91\x91\x91\x91\x91\x91 15 | \x1d\x1d\x1d\x1d 16 | . 17 | \x11\x01 18 | a 19 | \x05 20 | e 21 | \x8d\x85\x85 22 | \x11\x11\x11\x11\x11\x11\x11\x11 23 | \x04 24 | \x85\x88\x91\x91 25 | \x10 26 | \x91\x91 27 | \x94 28 | \x18 29 | -------------------------------------------------------------------------------- /tests/peddi/helloworld.golden: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | This is peddi. 3 | -------------------------------------------------------------------------------- /tests/peddi/helloworld.keybuf: -------------------------------------------------------------------------------- 1 | Hello, world!\n 2 | This is peddi.\x18 3 | -------------------------------------------------------------------------------- /tests/peddi/notdone: -------------------------------------------------------------------------------- 1 | Flag file: 2 | Build or test processes running in VICE signal that they are done 3 | by scratching this file's copy from the c64files/ dir. 4 | Corresponding build bash scripts watch for the existence of this 5 | file in c64files/ and terminate VICE after the file disappeared. 6 | -------------------------------------------------------------------------------- /tests/peddi/widelines.keybuf: -------------------------------------------------------------------------------- 1 | \x18 2 | -------------------------------------------------------------------------------- /tests/unit/base-setup.fth: -------------------------------------------------------------------------------- 1 | 2 | \needs \prof ' \ alias \prof immediate 3 | 4 | ' noop alias ~ 5 | ' noop alias ~on 6 | ' noop alias ~off 7 | 8 | include tmpheap.fth 9 | $2000 mk-tmp-heap 10 | 11 | : dos ( -- ) 12 | bl word count ?dup 13 | IF 8 15 busout bustype 14 | busoff cr ELSE drop THEN 15 | 8 15 busin 16 | BEGIN bus@ con! i/o-status? UNTIL 17 | busoff ; 18 | 19 | onlyforth decimal 20 | include util-words.fth 21 | include tmp6502asm.fth 22 | include strings.fth 23 | 24 | include tester.fth 25 | decimal 26 | 27 | cr 28 | vocabulary compiler 29 | compiler also definitions 30 | 31 | include init.fth 32 | 33 | include strtab.fth 34 | include errormsgs.fth 35 | include fake-err-hdl.fth 36 | tmp-clear 37 | -------------------------------------------------------------------------------- /tests/unit/basedir.shlib: -------------------------------------------------------------------------------- 1 | #!/bin/echo Please source this file 2 | 3 | basedir="$(realpath --relative-to="$PWD" "${testdir}/../..")" 4 | -------------------------------------------------------------------------------- /tests/unit/fake-codeh.fth: -------------------------------------------------------------------------------- 1 | 2 | \ fake for codehandler.fth 3 | 4 | variable >tos-offs 5 | 6 | ~ : dyn-offs ( -- offs ) >tos-offs @ ; 7 | 8 | ~ : dyn-reset ( -- ) >tos-offs off ; 9 | 10 | ~ : dyn-allot ( n -- offs ) 11 | dyn-offs swap >tos-offs +! ; 12 | 13 | variable statics.last 14 | 15 | variable staticadr 16 | 17 | : staticadr> ( -- current.adress ) 18 | staticadr @ ; 19 | 20 | : >staticadr ( adr -- ) 21 | staticadr ! ; 22 | 23 | : init-static $a000 dup >staticadr statics.last ! ; 24 | init: init-static 25 | 26 | : stat, . ." stat, " -2 staticadr +! ; 27 | : cstat, . ." cstat, " -1 staticadr +! ; 28 | 29 | : flushcode ; 30 | : flushstatic ; 31 | 32 | -------------------------------------------------------------------------------- /tests/unit/fake-memheap.fth: -------------------------------------------------------------------------------- 1 | 2 | 6 constant /link 3 | 10 constant #links 4 | create heap[ #links /link * allot 5 | here constant ]heap 6 | -------------------------------------------------------------------------------- /tests/unit/fake-memsym.fth: -------------------------------------------------------------------------------- 1 | 2 | 31 constant /id 3 | 4 constant /symbol \ datenfeldgroesse 4 | 32 constant #globals 5 | 100 constant symtabsize 6 | create hash[ #globals 2+ allot here constant ]hash 7 | create symtab[ symtabsize allot here constant ]symtab 8 | -------------------------------------------------------------------------------- /tests/unit/filter.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | BEGIN { out=0; } 3 | /GOLDEN-SECTION-END/ { out=0; } 4 | { if(out) { print; } } 5 | /GOLDEN-SECTION-START/ { out=1; } 6 | -------------------------------------------------------------------------------- /tests/unit/parser-setup.fth: -------------------------------------------------------------------------------- 1 | 2 | include fake-memheap.fth 3 | include listman.fth 4 | tmp-clear 5 | 6 | include fake-codeh.fth 7 | include fake-v-asm.fth 8 | 9 | include codegen.fth 10 | 11 | include notmpheap.fth 12 | 13 | include parser.fth 14 | 15 | : fetchglobal" ascii " word findglobal ?dup IF 2@ THEN ; 16 | : fetchlocal" ascii " word findlocal ?dup IF 2@ THEN ; 17 | -------------------------------------------------------------------------------- /tests/unit/prs-stm-test.fth: -------------------------------------------------------------------------------- 1 | 2 | ' noop alias \log 3 | 4 | \log include logtofile.fth 5 | \log logopen prs-stm-test.log 6 | 7 | include base-setup.fth 8 | include scan-setup.fth 9 | 10 | include parser-setup.fth 11 | 12 | src-begin test-stmt 13 | src@ for @ 14 | test-begin 15 | T{ statement-tab #keyword# comes-tab-token? -> ' for-stmt true }T 16 | test-end 17 | 18 | 19 | cr hex .( here, s0: ) here u. s0 @ u. 20 | 21 | cr .( test completed with ) #errors @ . .( errors) cr 22 | 23 | \log logclose 24 | -------------------------------------------------------------------------------- /tests/unit/scan-setup.fth: -------------------------------------------------------------------------------- 1 | 2 | include fake-memsym.fth 3 | include symboltable.fth 4 | : globals-empty? globals> @ symtab[ = ; 5 | : locals-empty? locals> @ 1+ ]symtab = ; 6 | tmp-clear 7 | 8 | include fake-input.fth 9 | include scanner.fth 10 | ' id-buf alias scn-idbuf 11 | tmp-clear 12 | 13 | : test-begin 14 | src-end last-src perform fetchword ; 15 | 16 | : test-end 17 | T{ thisword -> #eof# }T 18 | check-error-messages ; 19 | -------------------------------------------------------------------------------- /tests/unit/scanner-test.golden: -------------------------------------------------------------------------------- 1 | 2 | testing word. 3 | do if for int auto case 4 | char else goto break while extern 5 | return static switch default continue register 6 | 7 | ++ += + -- -= - *= * /= /* / %= 8 | % &= && & |= || | ^= ^ != ! == 9 | = <<= << <= < >>= >> >= > ~ 10 | -------------------------------------------------------------------------------- /tools/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | test_*.fth 3 | -------------------------------------------------------------------------------- /tools/ascii2petscii.c: -------------------------------------------------------------------------------- 1 | 2 | /* ascii2petscii.c, (c) Philip Zembrod, 2020 */ 3 | 4 | /* Converts a ASCII file to PETSCII, as needed by cc64. */ 5 | 6 | #include 7 | 8 | #include "openfiles.h" 9 | #include "petscii.h" 10 | 11 | 12 | int main(int argc, char *argv[]) { 13 | FILE *in, *out; 14 | int error = openfiles(&in, &out, argc, argv, 15 | "usage: %s infile [outfile]\n"); 16 | if (error) { 17 | return error; 18 | } 19 | int c; 20 | while ((c = fgetc(in)) != EOF) { 21 | fputc(ascii2petscii(c), out); 22 | } 23 | return closefiles(in, out); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tools/openfiles.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENFILES_H 3 | #define OPENFILES_H 4 | 5 | #include 6 | 7 | extern int openfiles(FILE **in, FILE **out, int argc, char *argv[], 8 | const char* usageFormatStr); 9 | 10 | extern int closefiles(FILE *in, FILE *out); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /tools/petscii.c: -------------------------------------------------------------------------------- 1 | 2 | /* Simple petscii to ascii conversion routines. */ 3 | 4 | #include "petscii.h" 5 | 6 | int ascii2petscii(int c) { 7 | if (c >= 0x41 && c <= 0x5a) return (c + 0x80); 8 | if (c >= 0x61 && c <= 0x7a) return (c - 0x20); 9 | if (c >= 0x7b && c <= 0x7f) return (c + 0x60); 10 | if (c == 0x0a) return 0x0d; 11 | if (c < 0x20) return 0x20; 12 | return c; 13 | } 14 | 15 | int petscii2ascii(int c) { 16 | if (c >= 0x41 && c <= 0x5a) return (c + 0x20); 17 | if (c >= 0x61 && c <= 0x7a) return (c - 0x20); 18 | if (c >= 0xc0 && c <= 0xda) return (c - 0x80); 19 | if (c >= 0xdb && c <= 0xdf) return (c - 0x60); 20 | if (c == 0x0d) return 0x0a; 21 | if (c == 0xa4) return '_'; // Only for cc64 forth sources 22 | if (c < 0x20) return 0x20; 23 | return c; 24 | } 25 | -------------------------------------------------------------------------------- /tools/petscii.h: -------------------------------------------------------------------------------- 1 | 2 | /* Simple petscii to ascii conversion routines. */ 3 | 4 | #ifndef PETSCII_H 5 | #define PETSCII_H 6 | 7 | extern int ascii2petscii(int c); 8 | 9 | extern int petscii2ascii(int c); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /tools/petscii2ascii.c: -------------------------------------------------------------------------------- 1 | 2 | /* petscii2ascii.c, (c) Philip Zembrod, 2020 */ 3 | 4 | /* Converts a PETSCII file to ASCII, as needed by cc64. */ 5 | 6 | #include 7 | 8 | #include "openfiles.h" 9 | #include "petscii.h" 10 | 11 | 12 | int main(int argc, char *argv[]) { 13 | FILE *in, *out; 14 | int error = openfiles(&in, &out, argc, argv, 15 | "usage: %s infile [outfile]\n"); 16 | if (error) { 17 | return error; 18 | } 19 | int c; 20 | while ((c = fgetc(in)) != EOF) { 21 | fputc(petscii2ascii(c), out); 22 | } 23 | return closefiles(in, out); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tools/striploadaddress.c: -------------------------------------------------------------------------------- 1 | 2 | /* striploadaddress.c, (c) Philip Zembrod, 2020 */ 3 | 4 | /* Strips the first 2 bytes from a file. */ 5 | 6 | #include 7 | 8 | #include "openfiles.h" 9 | #include "petscii.h" 10 | 11 | 12 | int main(int argc, char *argv[]) { 13 | FILE *in, *out; 14 | int error = openfiles(&in, &out, argc, argv, 15 | "usage: %s infile [outfile]\n"); 16 | if (error) { 17 | return error; 18 | } 19 | int c; 20 | if (fgetc(in) == EOF) return 1; 21 | if (fgetc(in) == EOF) return 1; 22 | while ((c = fgetc(in)) != EOF) { 23 | fputc(c, out); 24 | } 25 | return closefiles(in, out); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /tools/testdata/testshadow.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/tools/testdata/testshadow.d64 -------------------------------------------------------------------------------- /tools/testdata/testsrc.d64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/tools/testdata/testsrc.d64 -------------------------------------------------------------------------------- /x16files/c-charset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/c-charset -------------------------------------------------------------------------------- /x16files/cc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/cc64 -------------------------------------------------------------------------------- /x16files/ctype.h: -------------------------------------------------------------------------------- 1 | EXTERN _FASTCALL INT ISDIGIT(INT C); EXTERN _FASTCALL INT ISALNUM(INT C); EXTERN _FASTCALL INT ISALPHA(INT C); EXTERN _FASTCALL INT ISSPACE(INT C); EXTERN _FASTCALL INT ISLOWER(INT C); EXTERN _FASTCALL INT ISUPPER(INT C); EXTERN _FASTCALL INT TOLOWER(INT C); EXTERN _FASTCALL INT TOUPPER(INT C); -------------------------------------------------------------------------------- /x16files/helloworld-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/helloworld-c16.c -------------------------------------------------------------------------------- /x16files/helloworld-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/helloworld-c64.c -------------------------------------------------------------------------------- /x16files/helloworld-x16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/helloworld-x16.c -------------------------------------------------------------------------------- /x16files/kernal-io-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/kernal-io-c16.c -------------------------------------------------------------------------------- /x16files/kernal-io-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/kernal-io-c64.c -------------------------------------------------------------------------------- /x16files/libc-c16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-c16.h -------------------------------------------------------------------------------- /x16files/libc-c16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-c16.i -------------------------------------------------------------------------------- /x16files/libc-c16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-c16.o -------------------------------------------------------------------------------- /x16files/libc-c64.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-c64.h -------------------------------------------------------------------------------- /x16files/libc-c64.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-c64.i -------------------------------------------------------------------------------- /x16files/libc-c64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-c64.o -------------------------------------------------------------------------------- /x16files/libc-x16.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-x16.h -------------------------------------------------------------------------------- /x16files/libc-x16.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-x16.i -------------------------------------------------------------------------------- /x16files/libc-x16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/libc-x16.o -------------------------------------------------------------------------------- /x16files/rt-c16-10-7f.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0X22 0X24 0X1001 0X1040 0X11EE 0X7FFE 0X8000 RT-C16-10-7F -------------------------------------------------------------------------------- /x16files/rt-c16-10-7f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/rt-c16-10-7f.i -------------------------------------------------------------------------------- /x16files/rt-c16-10-7f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/rt-c16-10-7f.o -------------------------------------------------------------------------------- /x16files/rt-c64-08-9f.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0XFD 0XFB 0X801 0X840 0X9EE 0X9FFE 0XA000 RT-C64-08-9F -------------------------------------------------------------------------------- /x16files/rt-c64-08-9f.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/rt-c64-08-9f.i -------------------------------------------------------------------------------- /x16files/rt-c64-08-9f.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/rt-c64-08-9f.o -------------------------------------------------------------------------------- /x16files/rt-x16-08-9e.h: -------------------------------------------------------------------------------- 1 | #PRAGMA CC64 0X40 0X42 0X801 0X83D 0X9EB 0X9EFE 0X9F00 RT-X16-08-9E -------------------------------------------------------------------------------- /x16files/rt-x16-08-9e.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/rt-x16-08-9e.i -------------------------------------------------------------------------------- /x16files/rt-x16-08-9e.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/rt-x16-08-9e.o -------------------------------------------------------------------------------- /x16files/sieve-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/sieve-c64.c -------------------------------------------------------------------------------- /x16files/stdio.h: -------------------------------------------------------------------------------- 1 | EXTERN INT FOPEN(CHAR* FILENAME, CHAR* MODE); EXTERN _FASTCALL INT FCLOSE(INT FH); EXTERN _FASTCALL INT FGETC(INT FH); EXTERN INT FPUTC(INT C, INT FH); EXTERN CHAR* FGETS(CHAR* STR, INT COUNT, INT FH); EXTERN INT FPUTS(CHAR* STR, INT FH); EXTERN _FASTCALL INT PUTCHAR(INT C); EXTERN _FASTCALL INT PUTS(CHAR* STR); EXTERN _FASTCALL INT REMOVE(CHAR* FILENAME); EXTERN INT PRINTF(); /* (CHAR* FMTSTR, ...); */ EXTERN INT FPRINTF(); /* (INT FH, CHAR* FMTSTR, ...); */ EXTERN INT SPRINTF(); /* (CHAR* BUFFER, CHAR* FMTSTR, ...); */ -------------------------------------------------------------------------------- /x16files/stdlib.h: -------------------------------------------------------------------------------- 1 | EXTERN INT ABS(INT J); EXTERN INT ATOI(CHAR *S); EXTERN _FASTCALL INT RAND(); EXTERN _FASTCALL INT SRAND(INT SEED); -------------------------------------------------------------------------------- /x16files/string.h: -------------------------------------------------------------------------------- 1 | EXTERN CHAR *MEMCHR(CHAR *S, INT C, INT N); EXTERN INT MEMCMP(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *MEMCPY(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR MEMMOVE(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *MEMSET(CHAR* S, INT C, INT N); EXTERN CHAR *STRCAT(CHAR *S1, CHAR *S2); EXTERN CHAR *STRCHR(CHAR *S, INT C); EXTERN INT STRCMP(CHAR *S1, CHAR *S2); EXTERN CHAR *STRCPY(CHAR *S1, CHAR *S2); EXTERN INT STRCSPN(CHAR *S1, CHAR *S2); EXTERN INT STRLEN(CHAR *S); EXTERN CHAR *STRNCAT(CHAR *S1, CHAR *S2, INT N); EXTERN INT STRNCMP(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *STRNCPY(CHAR *S1, CHAR *S2, INT N); EXTERN CHAR *STRPBRK(CHAR *S1, CHAR *S2); EXTERN CHAR *STRRCHR(CHAR *S, INT C); EXTERN INT STRSPN(CHAR *S1, CHAR *S2); EXTERN CHAR *STRSTR(CHAR *S1, CHAR *S2); -------------------------------------------------------------------------------- /x16files/vccc2023-c16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/vccc2023-c16.c -------------------------------------------------------------------------------- /x16files/vccc2023-c64.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/vccc2023-c64.c -------------------------------------------------------------------------------- /x16files/vccc2023-x16.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/vccc2023-x16.c -------------------------------------------------------------------------------- /x16files/vf-build-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzembrod/cc64/8f99376a804fc10fbf0b795fb71db474f6c7da8f/x16files/vf-build-base --------------------------------------------------------------------------------