Page 3 of 7

Posted: Fri Jan 15, 2010 8:24 am
by Diddl
Maybe we could implement many BASIC functions in a special FE3 version?


new functions could placed in another 8K bank and with a switcher we switch to this bank bevore executing.

BASIC has Token Table and a execute address table for each Basic Token. Additionally to the address we could make a bank table.

FE3...ok, but

Posted: Fri Jan 15, 2010 3:59 pm
by wimoos
I do not own an FE3 cartridge and so haven't got experience with it. Must look into FE3 on VICE.
Apart from the extra coding that is needed, what is the performance penalty for bank switching ?

Mike SQR included

Posted: Sat Jan 16, 2010 10:30 am
by wimoos
I have uploaded a new version of WIMBASIC.ZIP that now includes the code for SQR from Mike.

SQR(14)*SQR(14)-14 now really is 0.

Wim.

Re: FE3...ok, but

Posted: Sat Jan 16, 2010 11:17 am
by Diddl
wimoos wrote:Apart from the extra coding that is needed, what is the performance penalty for bank switching ?
You can switch a ROM Bank with one write statement. The slowest part is your 6502, the CPLD switches in 10ns.



If we choose mode RAM-2 we can switch BLK-5 without changing other RAM Blocks.

By setting Bit 3 of Register 1 we switch BLK 5 to another bank.

If code is running in Blk 5 a switching would make problems.

So we either have switching code in both banks (on same address) or we need a switcher in another Blk, maybe Block 0 (3KB RAM Expansion).

---

But bevore thinking about bank switching, we simply could use this free 3K RAM for extensions.

So not only FE3 user but also user who posses a 8KB + 3KB RAM extension could use it.



If

Posted: Sat Jan 16, 2010 9:50 pm
by Leeeeee
and for the manual that I reworked (in Dutch though).
Can you post this somewhere? I've not been able to find it anywhere in any language.

Lee.

manuals for exbasic

Posted: Sun Jan 17, 2010 11:13 am
by wimoos
My Dutch version, aimed for VIC20, is now available at

http://home.kpn.nl/oost4231/exbasic.pdf

There is a more elaborate version that I found later on

http://simon25.de/Commodore/CBM/EXBASIC ... L%20II.pdf

This one is in German, for CBM, but not specifically for VIC20.

Regards,

Wim.

Posted: Sun Jan 17, 2010 8:55 pm
by Leeeeee
English version in .pdf and .txt is here though my crappy .pdf editor crashed on save and now crashes when I try to open the .pdf to fix some errors I spotted.

Anyone recommend a good, free WinXP compatable pdf editor?

Lee.

Posted: Thu Jan 21, 2010 2:40 am
by wimoos
In my latest version I have now kicked out HARDCOPY in favor of UNNEW.

I was thinking about "computed GOTO/GOSUB", but this could also be achieved bij EXEC("GOTO"+STR$(<expr>))
And M=MOD(A,B) can also be had by M=B*FRAC(A/B)

What remains on my list to add is

- XOR
- A=$1B00:B=%10110
- clear a string array
- sort an array
- graphics module

Removing the commands for (fast) tape handling LOAD, VERIFY and SAVE should give a lot of space in BLK5, but I could work on extensions in $0400-$0FFF.

Thanks for any comments on this.

New version WimBasic

Posted: Sat Jan 30, 2010 12:39 pm
by wimoos
I have uploaded a new version of WimBasic to http://home.kpn.nl/oost4231/wimbasic.zip

It is still less than 8kb. The differences from the previous version are:

- Removed HARDCOPY and added UNNEW
- Changed COKE to accept color no longer as required parameter. Per default it takes the value entered with CURSOR.
- Improved SWAP. Previously SWAP exchanged the 5 bytes of the values of the variables, no matter what. Didn't do type checking or take array elements into account (for strings and integer these are less than 5 bytes in length). Now it does type checking and adapts the number of bytes to exchange, depending on the type. It can now be safely used to swap string or integer array elements.

Regards,

Wim.

Re: New version WimBasic

Posted: Sun Jan 31, 2010 5:36 am
by Mike
wimoos wrote:- [...] added UNNEW
That one can be expressed in a slightly more compact form by using the re-link routine of the BASIC interpreter: ;)

Code: Select all

.Old
 LDA #$01    ; set first link pointer to non-0 value
 TAY
 STA ($2B),Y
 JSR $C533   ; ** re-link BASIC program
 CLC         ; set pointer $2D/$2E to start of variables
 LDA $22     ; (AKA "end of program")
 ADC #$02
 STA $2D
 LDA $23
 ADC #$00
 STA $2E
 JSR $C659   ; CLR, reset TXTPTR
 JMP $C474   ; BASIC warm start
And another two bytes are saved, when you rename the command to "OLD".

Greetings,

Michael

Posted: Mon Feb 01, 2010 3:39 am
by Mike
It might also be feasible to replace BORDER, COLOR, CURSOR, and GROUND by a single COLOR command taking two parameters, as follows:

Code: Select all

COLOR <nr>,<value> with <nr> :=

0: background (value = 0..15)
1: foreground (value = 0..15; >=8 means multi-colour enable)
2: border     (value = 0..15; >=8 means reverse mode on)
3: auxiliary  (value = 0..15)
Changing the border value should EOR the value with 8, so reverse mode is off with values between 0, and 7.

When you implement a command to sort arrays, one very usable extension is to sort additional arrays alongside the first array, i.e.

SORT A$()[,B$(),...]

where A$() is sorted, and B$() is permuted in the same way as A$(). These additional arrays need not be the same type, but they must be the same size.

For an example of Quicksort in BASIC, I've posted one here.

Posted: Mon Feb 01, 2010 3:46 am
by Diddl
Mike wrote:It might also be feasible to replace BORDER, COLOR, CURSOR, and GROUND by a single COLOR command taking two parameters, as follows:
maybe it would ...


... but I would like to see all Exbasic commands available in WimBasic. So it is compatible with Exbasic programs available. And maybe code it is more readable with good old exbasic commands.

An additional command is ok.

Posted: Mon Feb 01, 2010 3:52 am
by Mike
Diddl wrote:And maybe code it is more readable with good old exbasic commands.
From a quick glance I'd rather suspect the CURSOR command puts the cursor somewhere, and not change its colour. So much for readability. :? The redefined COLOR command is inspired from BASIC 3.5/7.0.
An additional command is ok.
With removing the HARDCOPY command, Wim already has taken the path in another direction. :twisted:

Posted: Mon Feb 01, 2010 5:14 am
by carlsson
Excuse my ignorance, but is this a well known and used Basic extention? Can you point me to any programs that are written in Exbasic? I thought it was yet another of those obscure extentions with a nice set of commands, now revived for improved performance and possible future use.

Posted: Mon Feb 01, 2010 5:34 am
by Diddl
carlsson wrote:Excuse my ignorance, but is this a well known and used Basic extention? Can you point me to any programs that are written in Exbasic? I thought it was yet another of those obscure extentions with a nice set of commands, now revived for improved performance and possible future use.
Exbasic Level II is well known on PET and CBM computers. Someone has ported it to VIC-20 and later to C-64.