From e1e48c76195c9a557037cf1dae26556bc76b7470 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Mon, 5 Oct 2026 20:01:04 -0500 Subject: [PATCH] All new BASIC compiler and VM. --- Makefile | 32 +- docs/dvx_basic_reference.html | 791 +- docs/dvx_system_reference.html | 53 +- screenshots/86box/hang-ended.png | 4 +- screenshots/86box/hang-taskmgr.png | 4 +- screenshots/86box/install-su-copy.png | 3 + screenshots/86box/install-su-done.png | 3 + screenshots/86box/install-su-fold.png | 3 + screenshots/86box/install-su-lic.png | 3 + screenshots/86box/install-su-unin.png | 3 + screenshots/86box/scrpage-cga1.png | 3 + screenshots/86box/scrpage-cga2.png | 3 + screenshots/86box/scrpage-full2.png | 3 + screenshots/86box/scrpage-page0.png | 3 + screenshots/86box/scrpage-pcopy.png | 3 + screenshots/86box/scrpage-text40.png | 3 + screenshots/86box/upgrade-su-copy.png | 3 + screenshots/86box/upgrade-su-done.png | 3 + screenshots/86box/upgrade-su-fold.png | 3 + screenshots/86box/upgrade-su-lic.png | 3 + screenshots/86box/upgrade-su-unin.png | 3 + screenshots/86box/upgrade-su-upgr.png | 3 + screenshots/dosbox/hang-ended.png | 4 +- screenshots/dosbox/hang-taskmgr.png | 4 +- screenshots/dosbox/install-in-desk.png | 3 + screenshots/dosbox/install-in-welc.png | 3 + screenshots/dosbox/install-su-copy.png | 3 + screenshots/dosbox/install-su-disk.png | 3 + screenshots/dosbox/install-su-done.png | 3 + screenshots/dosbox/install-su-fold.png | 3 + screenshots/dosbox/install-su-lic.png | 3 + screenshots/dosbox/install-su-unin.png | 3 + screenshots/dosbox/install-su-wrong.png | 3 + screenshots/dosbox/scrpage-cga1.png | 3 + screenshots/dosbox/scrpage-cga2.png | 3 + screenshots/dosbox/scrpage-full2.png | 3 + screenshots/dosbox/scrpage-page0.png | 3 + screenshots/dosbox/scrpage-pcopy.png | 3 + screenshots/dosbox/scrpage-text40.png | 3 + screenshots/dosbox/upgrade-su-copy.png | 3 + screenshots/dosbox/upgrade-su-done.png | 3 + screenshots/dosbox/upgrade-su-fold.png | 3 + screenshots/dosbox/upgrade-su-lic.png | 3 + screenshots/dosbox/upgrade-su-unin.png | 3 + screenshots/dosbox/upgrade-su-upgr.png | 3 + screenshots/masks/install-su-disk.mask | 2 + screenshots/masks/install-su-fold.mask | 4 + screenshots/masks/install-su-wrong.mask | 2 + screenshots/masks/upgrade-su-fold.mask | 4 + src/apps/kpunch/dvxbasic/Makefile | 2 +- src/apps/kpunch/dvxbasic/basBuild.c | 58 +- src/apps/kpunch/dvxbasic/basBuild.h | 11 +- src/apps/kpunch/dvxbasic/basRes.h | 168 +- src/apps/kpunch/dvxbasic/basrt.dhs | 19 +- src/apps/kpunch/dvxbasic/compiler/ast.c | 156 + src/apps/kpunch/dvxbasic/compiler/ast.h | 491 + .../kpunch/dvxbasic/compiler/basDateLit.h | 75 + src/apps/kpunch/dvxbasic/compiler/basEvents.h | 45 +- .../kpunch/dvxbasic/compiler/basKeywords.h | 38 +- src/apps/kpunch/dvxbasic/compiler/codegen.c | 254 +- src/apps/kpunch/dvxbasic/compiler/codegen.h | 17 +- src/apps/kpunch/dvxbasic/compiler/compact.c | 79 +- src/apps/kpunch/dvxbasic/compiler/compiler.c | 953 ++ src/apps/kpunch/dvxbasic/compiler/compiler.h | 124 + src/apps/kpunch/dvxbasic/compiler/fold.c | 565 + src/apps/kpunch/dvxbasic/compiler/front.h | 493 + src/apps/kpunch/dvxbasic/compiler/gen.c | 887 ++ src/apps/kpunch/dvxbasic/compiler/genExpr.c | 448 + src/apps/kpunch/dvxbasic/compiler/genStmt.c | 1652 +++ src/apps/kpunch/dvxbasic/compiler/lexer.c | 180 +- src/apps/kpunch/dvxbasic/compiler/lexer.h | 29 + src/apps/kpunch/dvxbasic/compiler/opcodes.h | 451 +- src/apps/kpunch/dvxbasic/compiler/parse.c | 251 + src/apps/kpunch/dvxbasic/compiler/parseDecl.c | 1761 +++ src/apps/kpunch/dvxbasic/compiler/parseExpr.c | 1389 +++ src/apps/kpunch/dvxbasic/compiler/parseStmt.c | 3097 +++++ src/apps/kpunch/dvxbasic/compiler/parser.c | 10296 ---------------- src/apps/kpunch/dvxbasic/compiler/parser.h | 181 - src/apps/kpunch/dvxbasic/compiler/resolve.c | 3895 ++++++ .../kpunch/dvxbasic/compiler/resolveExpr.c | 2861 +++++ src/apps/kpunch/dvxbasic/compiler/scope.c | 133 + src/apps/kpunch/dvxbasic/compiler/scope.h | 308 + src/apps/kpunch/dvxbasic/compiler/symtab.c | 472 - src/apps/kpunch/dvxbasic/compiler/symtab.h | 307 - src/apps/kpunch/dvxbasic/compiler/typecheck.c | 494 + src/apps/kpunch/dvxbasic/ctrlover.dhs | 119 +- src/apps/kpunch/dvxbasic/form.dhs | 5 +- src/apps/kpunch/dvxbasic/formrt/formGfx.c | 651 +- src/apps/kpunch/dvxbasic/formrt/formrt.c | 816 +- src/apps/kpunch/dvxbasic/formrt/formrt.h | 38 +- src/apps/kpunch/dvxbasic/gapc1.txt | 1 + src/apps/kpunch/dvxbasic/gapc2.txt | 1 + src/apps/kpunch/dvxbasic/gapc3.txt | 1 + src/apps/kpunch/dvxbasic/gapf1.txt | 0 src/apps/kpunch/dvxbasic/gapf2.txt | 0 src/apps/kpunch/dvxbasic/gapw.txt | 9 + src/apps/kpunch/dvxbasic/gapx.txt | 0 src/apps/kpunch/dvxbasic/ide/ideMain.c | 756 +- src/apps/kpunch/dvxbasic/ide/ideProject.c | 96 +- src/apps/kpunch/dvxbasic/ide/ideProject.h | 14 +- src/apps/kpunch/dvxbasic/ideguide.dhs | 67 +- src/apps/kpunch/dvxbasic/langref.dhs | 788 +- src/apps/kpunch/dvxbasic/runtime/basErrors.h | 10 + src/apps/kpunch/dvxbasic/runtime/gfx.c | 863 +- src/apps/kpunch/dvxbasic/runtime/gfx.h | 85 +- src/apps/kpunch/dvxbasic/runtime/screen.c | 1107 +- src/apps/kpunch/dvxbasic/runtime/screen.h | 82 +- src/apps/kpunch/dvxbasic/runtime/serialize.c | 396 +- src/apps/kpunch/dvxbasic/runtime/values.c | 951 +- src/apps/kpunch/dvxbasic/runtime/values.h | 155 +- src/apps/kpunch/dvxbasic/runtime/vm.c | 6103 +++++++-- src/apps/kpunch/dvxbasic/runtime/vm.h | 236 +- src/apps/kpunch/dvxbasic/stub/bascomp.c | 26 +- src/apps/kpunch/dvxbasic/stub/basrun.c | 41 +- src/apps/kpunch/dvxbasic/test_compact.c | 26 +- src/apps/kpunch/dvxbasic/test_compiler.c | 4729 ++++++- src/apps/kpunch/dvxbasic/test_suite.c | 441 +- src/apps/kpunch/iconed/iconed.frm | 42 +- src/installer/Makefile | 2 +- src/installer/pkgFormat.c | 23 + src/installer/pkgFormat.h | 4 + src/installer/pkgRead.c | 28 +- src/installer/pkgRead.h | 4 + src/installer/setup.c | 243 +- src/libs/kpunch/libdvx/apiref.dhs | 34 +- src/libs/kpunch/libdvx/dvxApp.c | 27 + src/libs/kpunch/libdvx/dvxApp.h | 5 + src/libs/kpunch/libdvx/dvxCur.h | 48 +- src/libs/kpunch/libdvx/dvxTypes.h | 2 +- src/libs/kpunch/libdvx/dvxWgt.h | 14 + src/libs/kpunch/libdvx/games.dhs | 2 + src/libs/kpunch/libdvx/platform/dvxPlat.h | 8 + src/libs/kpunch/libdvx/platform/dvxPlatIsr.h | 24 +- .../kpunch/libdvx/platform/dvxPlatformDos.c | 2 + .../kpunch/libdvx/platform/dvxPlatformIrq.c | 14 +- .../kpunch/libdvx/platform/dvxPlatformUtil.c | 59 +- src/libs/kpunch/music/music.dhs | 2 +- src/libs/kpunch/music/music.h | 5 +- src/sdk/templates/basicgame/tplName.frm | 6 +- src/sdk/templates/game/tplName.c | 5 +- src/test/abi/abiSizes.txt | 4 +- src/test/basic/Makefile | 60 +- src/test/basic/basBench.c | 1226 ++ src/test/basic/bench/arithFloat.bas | 15 + src/test/basic/bench/arithFloat.out | 1 + src/test/basic/bench/arithInt.bas | 19 + src/test/basic/bench/arithInt.out | 1 + src/test/basic/bench/array1d.bas | 29 + src/test/basic/bench/array1d.out | 1 + src/test/basic/bench/array2d.bas | 33 + src/test/basic/bench/array2d.out | 1 + src/test/basic/bench/arrayType.bas | 40 + src/test/basic/bench/arrayType.out | 1 + src/test/basic/bench/baseline.txt | 24 + src/test/basic/bench/callByRef.bas | 35 + src/test/basic/bench/callByRef.out | 1 + src/test/basic/bench/callByVal.bas | 24 + src/test/basic/bench/callByVal.out | 1 + src/test/basic/bench/callOptional.bas | 25 + src/test/basic/bench/callOptional.out | 1 + src/test/basic/bench/classCreate.bas | 29 + src/test/basic/bench/classCreate.out | 1 + src/test/basic/bench/classMethods.bas | 40 + src/test/basic/bench/classMethods.out | 1 + src/test/basic/bench/collection.bas | 27 + src/test/basic/bench/collection.out | 1 + src/test/basic/bench/fileIo.bas | 44 + src/test/basic/bench/fileIo.out | 1 + src/test/basic/bench/gfxPrims.bas | 33 + src/test/basic/bench/gfxPrims.out | 1 + src/test/basic/bench/objectGraph.bas | 37 + src/test/basic/bench/objectGraph.out | 1 + src/test/basic/bench/recursion.bas | 27 + src/test/basic/bench/recursion.out | 1 + src/test/basic/bench/strBuild.bas | 21 + src/test/basic/bench/strBuild.out | 1 + src/test/basic/bench/strFuncs.bas | 20 + src/test/basic/bench/strFuncs.out | 1 + src/test/basic/bench/variantArith.bas | 20 + src/test/basic/bench/variantArith.out | 1 + src/test/basic/fixtures/eventsInterfaces.bas | 72 + src/test/basic/fixtures/eventsInterfaces.out | 11 + src/test/basic/fixtures/mathFuncs.bas | 4 +- src/test/basic/fixtures/mathFuncs.out | 2 +- src/test/basic/fuzzCompile.c | 19 +- src/test/basic/fuzzModule.c | 17 +- .../dos/__pycache__/joyDrive.cpython-312.pyc | Bin 0 -> 2469 bytes src/test/dos/diskSwap.py | 78 + src/test/dos/fixtures/benchlog/begin.bas | 12 + src/test/dos/fixtures/benchlog/end.bas | 3 + src/test/dos/fixtures/bnarith/bnarith.dbp | 13 + src/test/dos/fixtures/bncall/bncall.dbp | 13 + src/test/dos/fixtures/bnclass/bnclass.dbp | 13 + src/test/dos/fixtures/bnobj/bnobj.dbp | 13 + src/test/dos/fixtures/bnstr/bnstr.dbp | 13 + src/test/dos/fixtures/scrpage/scrpage.bas | 83 + src/test/dos/fixtures/scrpage/scrpage.dbp | 11 + src/test/dos/runDos.sh | 163 +- src/test/dos/scripts/basbench.scr | 33 + src/test/dos/scripts/install.scr | 11 +- src/test/dos/scripts/scrpage.scr | 41 + src/test/dos/scripts/upgrade.scr | 19 + src/test/formrt/frtHarness.c | 29 +- src/test/formrt/testFormRt.c | 614 +- src/test/game/gameTest.c | 40 + src/test/ide/Makefile | 2 +- src/test/ide/testIde.c | 5 +- src/test/ide/testIdeDesign.c | 23 + src/test/ide/testIdeRegress.c | 303 +- src/test/lint/analyzerBaseline.txt | 16 +- src/test/lint/baseline.txt | 12 - src/test/lint/cppcheckBaseline.txt | 20 +- src/test/lint/staticGate.sh | 21 +- src/test/print/printTest.c | 15 +- src/test/samples/golden/basdemo-debug.app | Bin 24906 -> 25197 bytes src/test/samples/golden/basdemo-release.app | Bin 21349 -> 21914 bytes src/test/samples/golden/helpedit-debug.app | Bin 12661 -> 12743 bytes src/test/samples/golden/helpedit-release.app | Bin 11453 -> 11611 bytes src/test/samples/golden/iconed-debug.app | Bin 17461 -> 17425 bytes src/test/samples/golden/iconed-release.app | Bin 14596 -> 14839 bytes src/test/samples/golden/imgview-debug.app | Bin 9626 -> 9620 bytes src/test/samples/golden/imgview-release.app | Bin 9153 -> 9201 bytes src/test/samples/golden/inc-comm-debug.app | Bin 7498 -> 7480 bytes src/test/samples/golden/inc-comm-release.app | Bin 7416 -> 7428 bytes src/test/samples/golden/inc-commdlg-debug.app | Bin 7222 -> 7222 bytes .../samples/golden/inc-commdlg-release.app | Bin 7158 -> 7170 bytes src/test/samples/golden/inc-fileops-debug.app | Bin 7194 -> 7203 bytes .../samples/golden/inc-fileops-release.app | Bin 7139 -> 7151 bytes src/test/samples/golden/inc-game-debug.app | Bin 7178 -> 7124 bytes src/test/samples/golden/inc-game-release.app | Bin 7060 -> 7072 bytes src/test/samples/golden/inc-help-debug.app | Bin 7126 -> 7135 bytes src/test/samples/golden/inc-help-release.app | Bin 7071 -> 7083 bytes .../samples/golden/inc-joystick-debug.app | Bin 7199 -> 7199 bytes .../samples/golden/inc-joystick-release.app | Bin 7135 -> 7147 bytes src/test/samples/golden/inc-music-debug.app | Bin 7343 -> 7346 bytes src/test/samples/golden/inc-music-release.app | Bin 7282 -> 7294 bytes src/test/samples/golden/inc-net-debug.app | Bin 7271 -> 7280 bytes src/test/samples/golden/inc-net-release.app | Bin 7216 -> 7228 bytes src/test/samples/golden/inc-print-debug.app | Bin 7205 -> 7214 bytes src/test/samples/golden/inc-print-release.app | Bin 7150 -> 7162 bytes .../samples/golden/inc-resource-debug.app | Bin 7231 -> 7231 bytes .../samples/golden/inc-resource-release.app | Bin 7167 -> 7179 bytes src/test/samples/golden/inc-sound-debug.app | Bin 7227 -> 7233 bytes src/test/samples/golden/inc-sound-release.app | Bin 7169 -> 7181 bytes src/test/samples/golden/inc-sql-debug.app | Bin 7274 -> 7283 bytes src/test/samples/golden/inc-sql-release.app | Bin 7219 -> 7231 bytes src/test/samples/golden/inc-xfer-debug.app | Bin 7230 -> 7215 bytes src/test/samples/golden/inc-xfer-release.app | Bin 7151 -> 7163 bytes src/test/samples/golden/notepad-debug.app | Bin 12330 -> 12394 bytes src/test/samples/golden/notepad-release.app | Bin 10999 -> 11153 bytes src/test/samples/golden/resedit-debug.app | Bin 13970 -> 14074 bytes src/test/samples/golden/resedit-release.app | Bin 12294 -> 12533 bytes src/test/samples/golden/widshow-debug.app | Bin 15275 -> 15299 bytes src/test/samples/golden/widshow-release.app | Bin 14265 -> 14373 bytes src/test/setup/setupTest.c | 11 + src/test/shell/Makefile | 1 - src/test/shell/checkDxeExports.sh | 110 +- src/test/shell/loaderTest.c | 18 + .../tools/__pycache__/dxeInfo.cpython-312.pyc | Bin 3158 -> 6850 bytes src/test/tools/checkModules.py | 197 + src/test/tools/dxeInfo.py | 161 +- src/test/widgets/testCovText.c | 43 +- src/widgets/kpunch/canvas/canvas.bhs | 6 +- src/widgets/kpunch/canvas/canvas.dhs | 6 +- src/widgets/kpunch/canvas/widgetCanvas.c | 54 +- src/widgets/kpunch/image/image.bhs | 2 +- src/widgets/kpunch/image/image.dhs | 2 +- src/widgets/kpunch/imageButton/imgbtn.bhs | 2 +- src/widgets/kpunch/imageButton/imgbtn.dhs | 2 +- .../kpunch/textInput/widgetTextInput.c | 34 +- 270 files changed, 42380 insertions(+), 14737 deletions(-) create mode 100644 screenshots/86box/install-su-copy.png create mode 100644 screenshots/86box/install-su-done.png create mode 100644 screenshots/86box/install-su-fold.png create mode 100644 screenshots/86box/install-su-lic.png create mode 100644 screenshots/86box/install-su-unin.png create mode 100644 screenshots/86box/scrpage-cga1.png create mode 100644 screenshots/86box/scrpage-cga2.png create mode 100644 screenshots/86box/scrpage-full2.png create mode 100644 screenshots/86box/scrpage-page0.png create mode 100644 screenshots/86box/scrpage-pcopy.png create mode 100644 screenshots/86box/scrpage-text40.png create mode 100644 screenshots/86box/upgrade-su-copy.png create mode 100644 screenshots/86box/upgrade-su-done.png create mode 100644 screenshots/86box/upgrade-su-fold.png create mode 100644 screenshots/86box/upgrade-su-lic.png create mode 100644 screenshots/86box/upgrade-su-unin.png create mode 100644 screenshots/86box/upgrade-su-upgr.png create mode 100644 screenshots/dosbox/install-in-desk.png create mode 100644 screenshots/dosbox/install-in-welc.png create mode 100644 screenshots/dosbox/install-su-copy.png create mode 100644 screenshots/dosbox/install-su-disk.png create mode 100644 screenshots/dosbox/install-su-done.png create mode 100644 screenshots/dosbox/install-su-fold.png create mode 100644 screenshots/dosbox/install-su-lic.png create mode 100644 screenshots/dosbox/install-su-unin.png create mode 100644 screenshots/dosbox/install-su-wrong.png create mode 100644 screenshots/dosbox/scrpage-cga1.png create mode 100644 screenshots/dosbox/scrpage-cga2.png create mode 100644 screenshots/dosbox/scrpage-full2.png create mode 100644 screenshots/dosbox/scrpage-page0.png create mode 100644 screenshots/dosbox/scrpage-pcopy.png create mode 100644 screenshots/dosbox/scrpage-text40.png create mode 100644 screenshots/dosbox/upgrade-su-copy.png create mode 100644 screenshots/dosbox/upgrade-su-done.png create mode 100644 screenshots/dosbox/upgrade-su-fold.png create mode 100644 screenshots/dosbox/upgrade-su-lic.png create mode 100644 screenshots/dosbox/upgrade-su-unin.png create mode 100644 screenshots/dosbox/upgrade-su-upgr.png create mode 100644 screenshots/masks/install-su-disk.mask create mode 100644 screenshots/masks/install-su-fold.mask create mode 100644 screenshots/masks/install-su-wrong.mask create mode 100644 screenshots/masks/upgrade-su-fold.mask create mode 100644 src/apps/kpunch/dvxbasic/compiler/ast.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/ast.h create mode 100644 src/apps/kpunch/dvxbasic/compiler/basDateLit.h create mode 100644 src/apps/kpunch/dvxbasic/compiler/compiler.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/compiler.h create mode 100644 src/apps/kpunch/dvxbasic/compiler/fold.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/front.h create mode 100644 src/apps/kpunch/dvxbasic/compiler/gen.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/genExpr.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/genStmt.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/parse.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/parseDecl.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/parseExpr.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/parseStmt.c delete mode 100644 src/apps/kpunch/dvxbasic/compiler/parser.c delete mode 100644 src/apps/kpunch/dvxbasic/compiler/parser.h create mode 100644 src/apps/kpunch/dvxbasic/compiler/resolve.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/resolveExpr.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/scope.c create mode 100644 src/apps/kpunch/dvxbasic/compiler/scope.h delete mode 100644 src/apps/kpunch/dvxbasic/compiler/symtab.c delete mode 100644 src/apps/kpunch/dvxbasic/compiler/symtab.h create mode 100644 src/apps/kpunch/dvxbasic/compiler/typecheck.c create mode 100644 src/apps/kpunch/dvxbasic/gapc1.txt create mode 100644 src/apps/kpunch/dvxbasic/gapc2.txt create mode 100644 src/apps/kpunch/dvxbasic/gapc3.txt create mode 100644 src/apps/kpunch/dvxbasic/gapf1.txt create mode 100644 src/apps/kpunch/dvxbasic/gapf2.txt create mode 100644 src/apps/kpunch/dvxbasic/gapw.txt create mode 100644 src/apps/kpunch/dvxbasic/gapx.txt create mode 100644 src/test/basic/basBench.c create mode 100644 src/test/basic/bench/arithFloat.bas create mode 100644 src/test/basic/bench/arithFloat.out create mode 100644 src/test/basic/bench/arithInt.bas create mode 100644 src/test/basic/bench/arithInt.out create mode 100644 src/test/basic/bench/array1d.bas create mode 100644 src/test/basic/bench/array1d.out create mode 100644 src/test/basic/bench/array2d.bas create mode 100644 src/test/basic/bench/array2d.out create mode 100644 src/test/basic/bench/arrayType.bas create mode 100644 src/test/basic/bench/arrayType.out create mode 100644 src/test/basic/bench/baseline.txt create mode 100644 src/test/basic/bench/callByRef.bas create mode 100644 src/test/basic/bench/callByRef.out create mode 100644 src/test/basic/bench/callByVal.bas create mode 100644 src/test/basic/bench/callByVal.out create mode 100644 src/test/basic/bench/callOptional.bas create mode 100644 src/test/basic/bench/callOptional.out create mode 100644 src/test/basic/bench/classCreate.bas create mode 100644 src/test/basic/bench/classCreate.out create mode 100644 src/test/basic/bench/classMethods.bas create mode 100644 src/test/basic/bench/classMethods.out create mode 100644 src/test/basic/bench/collection.bas create mode 100644 src/test/basic/bench/collection.out create mode 100644 src/test/basic/bench/fileIo.bas create mode 100644 src/test/basic/bench/fileIo.out create mode 100644 src/test/basic/bench/gfxPrims.bas create mode 100644 src/test/basic/bench/gfxPrims.out create mode 100644 src/test/basic/bench/objectGraph.bas create mode 100644 src/test/basic/bench/objectGraph.out create mode 100644 src/test/basic/bench/recursion.bas create mode 100644 src/test/basic/bench/recursion.out create mode 100644 src/test/basic/bench/strBuild.bas create mode 100644 src/test/basic/bench/strBuild.out create mode 100644 src/test/basic/bench/strFuncs.bas create mode 100644 src/test/basic/bench/strFuncs.out create mode 100644 src/test/basic/bench/variantArith.bas create mode 100644 src/test/basic/bench/variantArith.out create mode 100644 src/test/basic/fixtures/eventsInterfaces.bas create mode 100644 src/test/basic/fixtures/eventsInterfaces.out create mode 100644 src/test/dos/__pycache__/joyDrive.cpython-312.pyc create mode 100755 src/test/dos/diskSwap.py create mode 100644 src/test/dos/fixtures/benchlog/begin.bas create mode 100644 src/test/dos/fixtures/benchlog/end.bas create mode 100644 src/test/dos/fixtures/bnarith/bnarith.dbp create mode 100644 src/test/dos/fixtures/bncall/bncall.dbp create mode 100644 src/test/dos/fixtures/bnclass/bnclass.dbp create mode 100644 src/test/dos/fixtures/bnobj/bnobj.dbp create mode 100644 src/test/dos/fixtures/bnstr/bnstr.dbp create mode 100644 src/test/dos/fixtures/scrpage/scrpage.bas create mode 100644 src/test/dos/fixtures/scrpage/scrpage.dbp create mode 100644 src/test/dos/scripts/basbench.scr create mode 100644 src/test/dos/scripts/scrpage.scr create mode 100644 src/test/dos/scripts/upgrade.scr create mode 100644 src/test/tools/checkModules.py diff --git a/Makefile b/Makefile index 48b15eb9..16f9749f 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ LIBS = $(sort $(notdir $(patsubst %/Makefile,%,$(wildcard src/libs/kpunch/*/Makefile)))) CORE_LIBS = libdvx libtasks -.PHONY: all clean $(LIBS) loader widgets apps tools installer dist deploy-helpsrc compile-help deploy-sdk test test-quick test-asan test-host test-samples coverage +.PHONY: all clean $(LIBS) loader widgets apps tools installer dist deploy-helpsrc compile-help deploy-sdk test test-quick test-asan test-host test-modules test-samples coverage bench bench-compare # Every build ends by making the release media in dist/ (a second or # two), so dist/ always holds the latest DVX. @@ -85,8 +85,9 @@ deploy-helpsrc: $(LIBS) widgets apps tools # Host-side tests. Every suite is native gcc; the GUI suites build # obj/host/libdvx.a, the widget .so files and libdvxtest.a themselves # (sanitizers on by default, SAN=1). -# make test -- everything: BASIC harnesses + fuzz, sample goldens, -# proxy build, all host suites, tools goldens, lint gate +# make test -- everything: DOS module symbol check, BASIC +# harnesses + fuzz, sample goldens, proxy build, all +# host suites, tools goldens, lint gate # make test-quick -- same minus the fuzzers, static analyzer and tools # make test-asan -- BASIC harnesses rebuilt under ASan/UBSan plus the # host suites (which are already sanitized) @@ -96,6 +97,7 @@ DVXBASIC_DIR = src/apps/kpunch/dvxbasic include src/test/suites.mk test: apps + $(MAKE) test-modules $(MAKE) -C $(DVXBASIC_DIR) tests $(MAKE) -C src/tools/proxy $(MAKE) test-samples @@ -104,12 +106,14 @@ test: apps $(MAKE) -C src/test/lint test-quick: apps + $(MAKE) test-modules $(MAKE) -C $(DVXBASIC_DIR) tests FUZZ_N=0 $(MAKE) test-samples $(MAKE) test-host $(MAKE) -C src/test/lint style ascii test-asan: apps + $(MAKE) test-modules $(MAKE) -C $(DVXBASIC_DIR) tests TESTSAN=1 $(MAKE) test-host @@ -121,6 +125,28 @@ test-host: test-samples: src/test/samples/runSamples.sh +# Every unresolved symbol of every built DOS module (bin/ .lib .wgt .drv +# .app .dxe, plus the BASIC stub that compiled programs are made from) must +# be exported by dvx.exe or by a module loaded before it, or dlopen() fails +# on DOS (src/test/shell/checkDxeExports.sh, src/test/tools/checkModules.py). +# Builds every module first so the check sees the current binaries. +BASIC_STUB = obj/dvxbasic/basstub.app + +test-modules: $(LIBS) loader widgets apps + src/test/shell/checkDxeExports.sh . $(BASIC_STUB) + +# BASIC compiler / VM benchmarks (src/test/basic/basBench.c, programs in +# src/test/basic/bench): results in obj/test/bench/results.txt; +# bench-compare shows the change from BENCH_OLD (default the Phase 0 +# baseline, src/test/basic/bench/baseline.txt) to BENCH_NEW (default the +# last make bench). BENCH_ARGS passes basBench options (-runs N, -profile, +# -filter NAME). +bench: + $(MAKE) -C src/test/basic bench + +bench-compare: + $(MAKE) -C src/test/basic bench-compare $(if $(BENCH_OLD),BENCH_OLD=$(abspath $(BENCH_OLD))) $(if $(BENCH_NEW),BENCH_NEW=$(abspath $(BENCH_NEW))) + # The real DOS build in an emulator (src/test/dos/runDos.sh; not part of # make test). EMULATOR=86box (default) or dosbox; SCRIPTS= a subset. test-dos: all diff --git a/docs/dvx_basic_reference.html b/docs/dvx_basic_reference.html index 58984ffc..f4728798 100644 --- a/docs/dvx_basic_reference.html +++ b/docs/dvx_basic_reference.html @@ -97,6 +97,8 @@ img { max-width: 100%; }
  • Form and Control Statements
  • Objects and Class Modules
  • @@ -179,6 +181,7 @@ img { max-width: 100%; }
  • App.Config
  • App.Data
  • App.Path
  • +
  • ARRAY
  • ASC
  • ATN
  • Attribute
  • @@ -192,6 +195,7 @@ img { max-width: 100%; }
  • Breakpoints
  • Breakpoints Window
  • Button
  • +
  • Byte
  • BYVAL
  • CALL
  • Call Stack
  • @@ -201,6 +205,8 @@ img { max-width: 100%; }
  • CASE
  • CASE ELSE
  • CBOOL
  • +
  • CBYTE
  • +
  • CCUR
  • CDATE
  • CDBL
  • Changes
  • @@ -271,6 +277,7 @@ img { max-width: 100%; }
  • CSNG
  • CSRLIN
  • CSTR
  • +
  • Currency
  • CurrentX
  • CurrentY
  • CursorLine
  • @@ -309,6 +316,10 @@ img { max-width: 100%; }
  • DECLARE LIBRARY
  • DEF FN
  • Default Member
  • +
  • Default Properties
  • +
  • Default Property
  • +
  • DEFBYTE
  • +
  • DEFCUR
  • DEFDBL
  • DEFINT
  • DEFLNG
  • @@ -348,6 +359,7 @@ img { max-width: 100%; }
  • END SELECT
  • END SUB
  • END TYPE
  • +
  • END WITH
  • ENUM
  • ENVIRON$
  • EOF
  • @@ -355,7 +367,16 @@ img { max-width: 100%; }
  • ERASE
  • ERL
  • ERR
  • +
  • Err
  • +
  • Err.Clear
  • +
  • Err.Description
  • +
  • Err.Number
  • +
  • Err.Raise
  • +
  • Err.Source
  • ERROR
  • +
  • ERROR$
  • +
  • Event
  • +
  • EVENT
  • Event Handlers
  • Events
  • Exit
  • @@ -370,6 +391,7 @@ img { max-width: 100%; }
  • False
  • File Attributes
  • File Menu
  • +
  • FILEATTR
  • FILECOPY
  • FillColor
  • FillStyle
  • @@ -397,6 +419,8 @@ img { max-width: 100%; }
  • Frame rate
  • FRAMEWAIT
  • FREEFILE
  • +
  • FRIEND
  • +
  • Friend
  • FRM
  • Full screen
  • FULLSCREEN
  • @@ -406,6 +430,9 @@ img { max-width: 100%; }
  • GameKeyDown
  • GET
  • GETATTR
  • +
  • GETBLUE
  • +
  • GETGREEN
  • +
  • GETRED
  • GOSUB
  • GOTO
  • GoToLine
  • @@ -429,6 +456,8 @@ img { max-width: 100%; }
  • ImageButton
  • Immediate Window
  • IMP
  • +
  • Implements
  • +
  • IMPLEMENTS
  • Include Libraries
  • Index Property
  • INI
  • @@ -444,6 +473,7 @@ img { max-width: 100%; }
  • INSTRREV
  • INT
  • Integer
  • +
  • Interface
  • Interval
  • Invalid use of Null
  • IS
  • @@ -466,18 +496,22 @@ img { max-width: 100%; }
  • Keyboard Shortcuts
  • KILL
  • Label
  • +
  • Labels
  • Late Binding
  • LBOUND
  • LCASE$
  • LEFT$
  • LEN
  • LET
  • +
  • Light pen
  • +
  • LIKE
  • Line
  • LINE (graphics)
  • LINE INPUT
  • LINE INPUT
  • Line method
  • Line Numbers
  • +
  • Line Numbers
  • LineNumbers
  • ListBox
  • ListCount
  • @@ -485,6 +519,7 @@ img { max-width: 100%; }
  • ListView
  • LOAD
  • Load
  • +
  • LOADPICTURE
  • LOC
  • Locals Window
  • LOCATE
  • @@ -511,6 +546,7 @@ img { max-width: 100%; }
  • Migration
  • Min
  • MINUTE
  • +
  • Missing
  • MKDIR
  • MOD
  • MONTH
  • @@ -542,6 +578,9 @@ img { max-width: 100%; }
  • MusicStop
  • MusicVolume
  • NAME
  • +
  • Name Resolution
  • +
  • Named Arguments
  • +
  • Names
  • net.bas
  • NEW
  • New Class Module
  • @@ -557,6 +596,7 @@ img { max-width: 100%; }
  • Objects
  • OCT$
  • ON ERROR
  • +
  • ON ERROR RESUME NEXT
  • ON GOSUB
  • ON GOTO
  • OPEN
  • @@ -573,11 +613,15 @@ img { max-width: 100%; }
  • OR
  • Output Window
  • PAINT
  • +
  • Paint event
  • PaintPicture
  • PALETTE
  • PALETTE USING
  • PARAMARRAY
  • Paste
  • +
  • PCOPY
  • +
  • PEN
  • +
  • PEN ON
  • Picture
  • PictureBox
  • PLAY
  • @@ -586,6 +630,7 @@ img { max-width: 100%; }
  • PlayTone
  • PlayWave
  • PlayWaveLoop
  • +
  • PMAP
  • POINT
  • Point method
  • POS
  • @@ -621,9 +666,13 @@ img { max-width: 100%; }
  • PSet method
  • PUBLIC
  • PUT
  • +
  • QBCOLOR
  • Radio Button
  • +
  • RaiseEvent
  • +
  • RAISEEVENT
  • RANDOMIZE
  • RANDOMIZE TIMER
  • +
  • Raster Operations
  • READ
  • RealMode
  • RecordSource
  • @@ -635,18 +684,21 @@ img { max-width: 100%; }
  • Remove File
  • RemoveControl
  • RemoveItem
  • +
  • Rename File
  • REPL
  • Replace
  • Replace
  • REPLACE$
  • ReplaceAll
  • Reposition
  • +
  • RESET
  • Resizable
  • resource.bas
  • RESTORE
  • RESUME
  • RESUME NEXT
  • RETURN
  • +
  • RGB
  • RIGHT$
  • RMDIR
  • RND
  • @@ -661,10 +713,17 @@ img { max-width: 100%; }
  • Save File
  • Save on Run
  • Save Project
  • +
  • Scale
  • ScaleHeight
  • +
  • ScaleLeft
  • +
  • ScaleMode
  • +
  • ScaleTop
  • ScaleWidth
  • +
  • ScaleX
  • +
  • ScaleY
  • SCREEN
  • SCREEN function
  • +
  • Screen pages
  • Scrollable Container
  • ScrollPane
  • Search
  • @@ -801,6 +860,7 @@ img { max-width: 100%; }
  • Variant
  • VARIANT
  • Variant Type
  • +
  • VARPTR$
  • VARTYPE
  • VB_Name
  • VB_UserMemId
  • @@ -809,12 +869,18 @@ img { max-width: 100%; }
  • vbAutomatic
  • vbBeginDrag
  • vbBinaryCompare
  • +
  • vbBlack
  • +
  • vbBlue
  • vbBoolean
  • +
  • vbByte
  • vbCancel
  • +
  • vbCentimeters
  • vbCFText
  • vbCFText
  • +
  • vbCharacters
  • vbCritical
  • vbCurrency
  • +
  • vbCyan
  • vbDataObject
  • vbDate
  • vbDirectory
  • @@ -828,12 +894,18 @@ img { max-width: 100%; }
  • vbFirstFullWeek
  • vbFirstJan1
  • vbFriday
  • +
  • vbGreen
  • vbHidden
  • +
  • vbHimetric
  • +
  • vbHimetric
  • +
  • vbInches
  • vbInformation
  • vbInteger
  • vbLeave
  • vbLong
  • +
  • vbMagenta
  • vbManual
  • +
  • vbMillimeters
  • vbModal
  • vbMonday
  • vbNo
  • @@ -846,30 +918,41 @@ img { max-width: 100%; }
  • vbOKOnly
  • vbOver
  • VBox
  • +
  • vbPicTypeBitmap
  • +
  • vbPicTypeNone
  • +
  • vbPixels
  • +
  • vbPoints
  • vbQuestion
  • vbReadOnly
  • +
  • vbRed
  • vbRetry
  • vbRetryCancel
  • vbSaturday
  • vbSingle
  • +
  • vbSrcCopy
  • vbString
  • vbSunday
  • vbSystem
  • vbTextCompare
  • vbThursday
  • vbTuesday
  • +
  • vbTwips
  • vbUseCompareOption
  • +
  • vbUser
  • vbUserDefinedType
  • vbUseSystem
  • vbUseSystemDayOfWeek
  • vbVariant
  • vbWednesday
  • +
  • vbWhite
  • +
  • vbYellow
  • vbYes
  • vbYesNo
  • vbYesNoCancel
  • Vertical Layout
  • VIEW
  • View Menu
  • +
  • VIEW PRINT
  • Visual Basic
  • VT100
  • Watch Expressions
  • @@ -881,10 +964,16 @@ img { max-width: 100%; }
  • WHILE
  • Widget Palette
  • WIDTH
  • +
  • WIDTH #
  • +
  • WIDTH LPRINT
  • WINDOW
  • Window
  • Window Menu
  • With
  • +
  • WITH
  • +
  • WITH...END WITH
  • +
  • WithEvents
  • +
  • WITHEVENTS
  • WrapBox
  • WRITE #
  • WYSIWYG
  • @@ -953,6 +1042,7 @@ img { max-width: 100%; } --- Make Executable... Compile the project and save it as a standalone .app file. Prompts for a debug or release build. --- + Rename File... Give the file selected in the Project Explorer a new name, on disk and in the project. See Renaming a File under Project System. Remove File Remove the selected file from the project (prompts to save if modified). --- Exit Close the IDE (prompts to save unsaved changes). @@ -1090,9 +1180,10 @@ img { max-width: 100%; }

    Object and Function Dropdowns

    At the top of the Code Editor are two dropdown lists:

    +

    A WithEvents variable (Dim WithEvents acct As Account, also Private or Public, in a module, a form or a class module) is listed as an object; its events are the ones its class module declares with Event. Picking one of them creates the handler acct_EventName with the event's own parameters, so it matches what the class raises. Selecting the variable when it has no handler yet creates the handler for the class's first event, as a control's default event is created.

    The editor shows one procedure at a time. Each procedure has its own buffer, and switching between them is instantaneous. The (General) section contains module-level declarations and code.

    Text outside the procedure being shown is never lost: lines typed above or below the SUB move to (General), a second SUB typed into the buffer becomes a procedure of its own, and a procedure whose SUB line was deleted becomes (General) text. When you leave an event handler that was generated and never edited it is removed; empty SUBs and FUNCTIONs you wrote yourself are kept. After a save the editor shows exactly what was stored (blank lines around a procedure are normalized). A section too large for the editor opens read-only, with a message in the status bar.

    Syntax Highlighting

    @@ -1104,8 +1195,9 @@ img { max-width: 100%; } Types INTEGER, LONG, SINGLE, DOUBLE, STRING, BOOLEAN, DATE, VARIANT, OBJECT, COLLECTION, TRUE, FALSE, NOTHING, EMPTY, NULL Strings "Hello, World!" Comments ' This is a comment, REM This is a comment - Numbers 42, 3.14, &HFF + Numbers 42, 3.14, &HFF, date literals such as #2026-09-30# and #1/15/2026 10:30 AM# Operators =, <, >, +, -, *, /, \, & +

    Date literals are colored as numbers only when they are real dates, as the compiler reads them; the # of a file number (CLOSE #1) is not. Some words are colored like keywords without being reserved -- built-in type names, Empty, Null, EACH, EVENT, WITHEVENTS, and the console and graphics statements such as CLS, LOCATE, COLOR, SCREEN, PSET, CIRCLE, PAINT, PCOPY and PMAP. A program may use them as its own names, and after a dot (Text1.Width, Picture1.Point) they are shown as ordinary names.

    Editor Features

    A new class module starts with these header lines:

    VERSION DVX 1.00 CLASS
    @@ -1326,7 +1422,7 @@ Option Explicit
    Name Variable name (internal mangled names like static variable placeholders are filtered out). Type Data type: Integer, Long, Single, Double, String, Boolean, Date, Variant, Array, UDT, or the type of object. Array types show the element type (e.g., Integer()). Value Current value. Strings are shown in quotes. Booleans as True/False. Arrays show bounds and element count (e.g., Integer(0 To 9) [10]). Uninitialized arrays show (uninitialized). -

    Variants show the value they currently hold, or Empty or Null. Object variables show Nothing, or which object they refer to: the class name of a class instance, a Collection with its number of items, or the form or control.

    +

    Variants show the value they currently hold, or Empty or Null; an OPTIONAL Variant parameter the caller left out shows Missing. Object variables show Nothing, or which object they refer to: the class name of a class instance, a Collection with its number of items, or the form or control.

    The Locals window displays: