When the WimBasic extension starts 'cold', it tries to find a file by the name of WBSTART from device #8. When found, it loads and runs it, using the DOS <up-arrow> command.
This allows for customization, i.e. automatically starting any other program.
Scrolling during LIST, FIND, DUMP, MATRIX, HELP, DOS-command ">$": Press CTRL to slow down scrolling, press C= to stop scrolling, press and release CTRL to resume scrolling.
During tracing the program execution can be slowed down using the CTRL and the C= keys.
Also, when a program listing is on the screen, the cursor up and down keys scroll back and forth through the program. After a RUN/STOP-RESTORE, this scrolling is disabled. It can be re-enabled through a KEY ON command.
The default vector for USR() points to a routine that reads the joystick and returns the direction(s) as a value. "up" returns -22, "down" returns 22, "left" returns -1 and "right" returns 1. No direction returns 0 and a combination of directions returns the appropriate value. The fire button does not return a value.
When USR() is needed for your own routine, save the default vector first (X=DEEK(1)).
When the program runs and an error occurs, WimBasic first checks if an ON ERROR GOTO is active. If so, the variable EC is given the value of the errorcode and variable EL is given the value of line where the error occured. Processing then continues at the linenumber that was specfied in ON ERROR GOTO. The errorstatus is dismissed when a RESUME is executed.
If ON ERROR GOTO is not active, the line that contains the error is listed, with the cursor at the position where the error occurred and the program stops.
I did some speed testing on my PAL VIC-20 with the 65C02 version of WimBasic. The benchmark was a Basic program that calculates factorials in all significant decimals. For 69!, this number consists of 99 decimals. The program holds a FOR-NEXT, appended with an IF..GOTO loop, both inside another FOR-NEXT.
Pure Basic, without the extension, this takes 4395 jiffies (= 4395/60 seconds = 73.25 seconds)
The same program, within WimBasic, takes 4477 jiffies (= 4477/60 seconds = 74.62 seconds = 1.8% slower)
Now, using all possible WimBasic improvements (SuperNumbers, DIVMOD, hex inline), this takes 2427 jiffies (= 2427/60 seconds = 40.45 seconds = 45% faster !)
Changing the IF.. GOTO. into WHILE-WEND, it takes 2421 jiffies (even faster and improved programming!)
Changing both the FOR-NEXT loops into WHILE-WEND (and applying SuperNumbers of course), the program took 2812 jiffies (= 46.87 seconds). Still 36% faster than pure Basic, but 9% slower than the fastest solution.
|WimBasic|| CBM Basic|| speed improvement factor|
| INSTR (worst case)|| equivalent routine (worst case)||5.00|
| datasette (turbo)||datasette (regular)||4.00|
|ODD(X)||X/2 > INT(X/2)||2.83|
|STRING$()|| equivalent routine||2.83|
| SWAP X%,Y%||T%=X%:X%=Y%:Y%=T%|| 2.50 |
| SWAP X,Y||T=X:X=Y:Y=T||2.21|
|XOR(X,Y)|| X AND NOT Y OR Y AND NOT X||2.18|
| DIVMOD X,Y||DQ=INT(X/Y):DR=X-DQ*Y||2.08|
| MIN(V,W,X,Y,Z) || equivalent routine||2.04|
|MIN(X,Y)||R=Y:IF X<Y THEN R=X||1.78|