Page 4 of 7

Posted: Mon Feb 01, 2010 5:50 am
by wimoos
another of those obscure extentions
Well, its not that obscure. Please take a look at the PDFs that I referenced in previous posts. Exbasic was there on other and older CBM machines as well (each with their specifics of course). Also, there is much resemblence with the Level II Basic that is used on TRS-80.

(BUMP: Diddl)

Between Jan6 en Jan7, since I changed the announcement screen, I left the official Exbasic for what it is. So much for full compatibility. All these tokens...

The suggestions for the COLOR command: I'll include the EOR #$08 in a next version.

The SORT command: I was thinking about a solution like the qsort() function in C, where a callback routine for the comparison and a callback routine for the swap is used. So something like:

QSORT("A$(I)<A$(I+1)","SWAPA$(I),A$(I+1):SWAPB$(I),B$(I+1)")

but I haven't decided on it yet.

Regards,

Wim.

Posted: Mon Feb 01, 2010 6:40 am
by carlsson
Hm, ok. At least those colour oriented commands must've been added for the VIC-20 version as the colour choice for PET and CBM-II was factory default: white, amber or green, but only one per computer. :-D

Posted: Mon Feb 01, 2010 8:34 am
by Mike
wimoos wrote:The SORT command: I was thinking about a solution like the qsort() function in C, where a callback routine for the comparison and a callback routine for the swap is used. So something like:

QSORT("A$(I)<A$(I+1)","SWAPA$(I),A$(I+1):SWAPB$(I),B$(I+1)")

but I haven't decided on it yet.
In that case, the SORT command not going to offer a performance increase over a dedicated subroutine, similar to that one I had posted. A lot of time will be wasted in "executing" the strings each time they're needed, i.e. finding where the variables are stored, and sending the comparison statement through FRMEVL. And BTW, Quicksort does not only compare, and swap elements that are neighbors.

Anyhow, taking a parameter to select between sorting in ascending, or descending order definitely is the right thing to do.

Posted: Mon Feb 01, 2010 12:59 pm
by wimoos
Not gaining the performance is exactly what is holding me back. I should look into a solution that comes halfway, like you said.

Posted: Tue Feb 02, 2010 2:25 pm
by wimoos
New version of Wimbasic available.

It supports hexbased value entry: A=$1D00
This makes A=EVAL("$1D00") possible and thus supersedes DEC().
I removed DEC() and changed it for X=XOR(A,B).


Here's one for you: I tested the hexbased value entry and found that when the number ends in ..DEF it returns 0. First I thought it had to do with exponential notation, but I can't really explain. It's only when it ends in ..DEF ? What going on here ?

( :lol: I already figured it out :lol: )

Regards.

Posted: Tue Feb 02, 2010 4:29 pm
by carlsson
I can hear Britney Spears from far away..

Tokenizer, token-tokenizer, it's the tokenizer
Oh, tokenizer, oh, it's the tokenizer baby,
It, it, it is, it, it, it's the tokenizer, tokenizer, tokenizer

:lol:

Posted: Tue Feb 02, 2010 4:47 pm
by Pedro Lambrini
Is all this work on Exbasic simply an academic excercise (not to diminish your work!) or is there real benefits to using this instead of Basic 2.0? As I'm starting to write Basic programs after decades in the wilderness I'm just a little curious. :)

Posted: Wed Feb 03, 2010 2:02 am
by Mike
Pedro Lambrini wrote:Is all this work on Exbasic simply an academic excercise (not to diminish your work!) or is there real benefits to using this instead of Basic 2.0? As I'm starting to write Basic programs after decades in the wilderness I'm just a little curious. :)
In principle, you can express every program idea within BASIC 2.0.

BASIC extensions shine, where that algorithm either would run too slow in BASIC, or would need comparatively a lot of statements. If that function could be expressed with a short name, maybe with some parameters, BASIC extensions add this to the pool of available commands.

The speed advantage is there, because the same algorithm now is executed in machine language within the extension. The space advantage is a two-folded sword - within the BASIC listing you now only see the new command, with arguments as necessary. Of course the ML translation within the extension now needs space as well, typically in the same order is if the command had been expressed as subroutine within the BASIC program.

Some BASIC extensions try to be all-rounders, remedying many (sometimes only perceived) deficiencies of BASIC 2.0 regarding program flow structures (adding IF ... THEN ... ELSE, REPEAT ... UNTIL, DEF PROC, CALL: like Waterloo BASIC), easing screen manipulation, and sound (ExBASIC has some commands there), programming help (RENUMBER, AUTO, function keys: Programmers' Aid), or bitmapped graphics (Super Expander).

Others gain their usefulness by being specialised on a single task, but within small and compact code, like MINIGRAFIK does for hires graphics. :)

Greetings,

Michael

Posted: Wed Feb 03, 2010 2:03 am
by wimoos
Yes, I need a drink, academic of course, after all these hours...

But seriously, I keep two versions:

- one is Exbasic for VIC, with a lot of bugs fixed
- the other is Wimbasic, where I develop my own adaptions

If you need Exbasic.prg please let me know. I have regenerated a source file through disassembly, so in theory this can be assembled on a location other than $A000.

@Anders: it's 1983 ! Who is Britney Spears ?

Bug in MAX() and MIN()

Posted: Sun Feb 07, 2010 11:13 am
by wimoos
Talk about academic...

In Exbasic, MIN() and MAX() are not recursive. That is, an expression like: A=MIN(4,MIN(8,9)) should give 4, but it gives 8.
Of course, in this case the error can be prevented by using: A=MIN(4,8,9).

But, when an expression like A=MIN(4,MAX(8,9)) is used, the result will be 9, where it should be 4. This can only be prevented by splitting it up in two statements.

In Wimbasic I have now solved this by keeping the running value, together with the operator, on the stack.

A working example could be: A=MAX(0,MIN(16,A)) to limit A in the range 0..16.


Regards,

Wim.

New version available

Posted: Mon Feb 22, 2010 12:14 pm
by wimoos
A new version of Wimbasic is now available at

http://home.kpn.nl/oost4231/wimbasic.zip

I brought it back to 8131 bytes and this version contains the following improvements:

; FIXED MIN AND MAX TO BE RECURSIVE
; HELP SCROLLS ONE LINE INSTEAD OF FOUR
; PARAMETER CHECKING ON CEEK AND COKE (0..511)

Regards,

Wim.

Posted: Mon Feb 22, 2010 12:46 pm
by Diddl
Thank you wimoos, wimbasic is great! :D

Full support for hexbased and binary entry

Posted: Thu Feb 25, 2010 4:04 pm
by wimoos
Found some more optimizations and I built in full support for hexbased and binary based value entry.

Wimbasic now can deal with the following expression:

X=XOR($4DEF,%1101)

Regards,

Wim.

New version available

Posted: Fri Mar 12, 2010 1:49 am
by wimoos
This new version has more code improvements and the following fixes:

; FIXED DEEK AND CEEK TO BE RECURSIVE
; IMPROVED '.' HANDLING FOR GOTO, THEN, ELSE, RUN AND LIST

Regards,

Wim.

Re: New version available

Posted: Fri Mar 12, 2010 2:27 am
by Diddl
wimoos wrote:This new version has more code improvements and the following fixes:

; FIXED DEEK AND CEEK TO BE RECURSIVE
; IMPROVED '.' HANDLING FOR GOTO, THEN, ELSE, RUN AND LIST

Regards,

Wim.
Could you explain more detailed about tthis improvements. Is this a better coding with same results or did you make a faster GOTO or another implementation?