Page 1 of 7

Using and improving Exbasic

Posted: Mon Jul 27, 2009 3:54 am
by wimoos
Does anybody have a manual for EXbasic available ? Amongst others I have the following questions:

1. Why does LOAD"<file>",8 behave like there's a tape on 8 ? And how to come around that ?
2. What does ODF do ?
3. What does CEEK do ?
4. What is the reverse of SPACE ?
5...

Regards

Posted: Mon Jul 27, 2009 5:03 am
by Diddl
3)

CEEK position,c/s

Like PEEK but for chars on screen memory. Parameter s for char code and c for color code.




4)

Space [off]

either with or without "off"

Posted: Mon Aug 17, 2009 1:05 pm
by wimoos
I found it on www.forum64.de in a post by member oldskool.

It appears SPACE has two different functions.
Loading from/saving to disk works with DOS directives.
CEEK has an unwanted side effect in that it changes screencolors.

ODF is not mentioned in the manual, so its purpose remains unclear.

found it

Posted: Tue Sep 01, 2009 11:13 am
by wimoos
I discovered that ODF is not an Exbasic statement, but it is a small typo/bug.
At location $BEF0 is a $44 ("D") but it should be a $46 ("F"), which turns ODF into OFF.

Now the commands SPACE OFF, TRACE OFF, LOCK OFF, LETTER OFF work the way they should.

Amazingly, the HELP command reflects the change immediately.

Now, there still is a bug in CEEK.

CEEK

Posted: Tue Sep 22, 2009 12:08 pm
by wimoos
I fixed the bug in CEEK as well. There was a bogus opcode on $BB6C. I changed it to $EA (NOP) and now CEEK works as expected.

The code was a $6F and I have a 65C02, so it performs a BBR6, together with the two following bytes, hence the side effect. On a regular 6502 it would probably hang.

In the parameters, it only checks for a "C". Any other character behaves like an "S".

Now there's still a bug in DUMP and MATRIX: the sign is not printed. Probable printing starts with the second character.

Posted: Wed Sep 23, 2009 12:54 am
by Diddl
cool, exbasic has such an error! they was using illegal opcodes in a comercial product?

And you found this, - really cool!!

Thanks for that, will patch my exbasic also ...

Posted: Wed Sep 23, 2009 2:59 pm
by wimoos
Found the bugs in DUMP and MATRIX as well.
At two instances there is a JMP $DDD7 that needs to be replaced with a JSR $DDDD followed by a JMP $CB1E . Because some more space is needed I have to develop the patch, before I put it here.
If someone beats me to it, I wouldn't mind. :wink:

Fixed it, and reworked the manual

Posted: Thu Sep 24, 2009 2:07 pm
by wimoos
A small challenge because of space limitations, but I fixed it as follows.

At $A108 there is a string of 6 characters that seems to denote the date of assembly: "301082". In the code there is no reference to this string.
Being 6 bytes it's just enough to hold the patch.

So:

$A108 JSR $DDDD
$A10B JMP $CB1E

and

$B0FC JMP $A108

and

$B102 JMP $A108

Now DUMP and MATRIX print the sign as well. How could anybody have lived without it for 27 years.
For anybody who's interested, send me a message for the complete binary and for the manual that I reworked (in Dutch though).

How CALL works

Posted: Mon Oct 12, 2009 1:14 am
by wimoos
I figured out how you're supposed to use CALL.

First you have to set up the vector:

DEF CALL <address>

The address is kept in 780 and 781 (these locations are also used by SYS, so you have to keep that in mind).

Then you can perform a call like:

CALL (<params>)

After checking for the left parenthesis, control is transfered to your ML routine at <address>, where you need to pick up the <params>.
You end your ML routine with an RTS and then in the stub the right parenthesis is checked.
-
Knowing this, its usefulness can be debated. The interface is a bit more ethical than SYS.
It could be used as a head for a routine to for example sort a large array.

LETTER OFF/ON

Posted: Wed Dec 30, 2009 1:25 pm
by wimoos
Another small bug that I fixed today. When using LETTER ON/OFF, Exbasic assumes an unexpanded VIC: it stores $F0 and $F2 straight into $9005.

I have a 32k expansion, so these values should have been $C0 and $C2.

The faulty code is a follows:

B42F LDA #$F2
B431 BIT $F0A9
B434 STA $9005

I fixed it as follows:

B42F LDA #$0E
B431 BIT $8EA9
B434 JSR $FFD2

so it's no longer dependant on the memory configuration.

Best regards,

Wim.

Posted: Wed Dec 30, 2009 1:51 pm
by Diddl
Very fine, will patch my Rom too, thanks!

Exbasic disassembled

Posted: Wed Jan 06, 2010 1:33 pm
by wimoos
At last I disassembled the entire PRG, and there I came across another bug that appears in the SPACE command.

When the coordinates of the upper-left corner are not less than those of the lower-right corner it bails out with a SYNTAX error instead of an ILLEGAL QUANTITY error.

Looking at the faulty code, you're lucky to get an error message after all instead of a hang.

It has to be fixed by putting $A8 in $ ADC9 and $99 in $ADD8.

I intend to optimize the source that I now have and maybe find some room for additionals.

Regards,

Wim.

Posted: Thu Jan 07, 2010 2:28 am
by carlsson
Soon now you can rename it WimBasic. 8)

wimbasic

Posted: Thu Jan 07, 2010 4:14 am
by wimoos
Thanks for the suggestion.

I have already reserved www.wimbasic.nl :D

Regards

Posted: Thu Jan 07, 2010 4:32 am
by Diddl
carlsson wrote:Soon now you can rename it WimBasic. 8)
WimBasic is cool! :D

On A FE3 we could implement WimBasic seemless (Blk1-5 free, only a small wrapper in cassette buffer or in 3K expansion)