Using and improving Exbasic

Basic and Machine Language

Moderator: Moderators

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Using and improving Exbasic

Postby wimoos » Mon Jul 27, 2009 3:54 am

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
Last edited by wimoos on Tue Jan 12, 2010 2:19 am, edited 1 time in total.

Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Postby Diddl » Mon Jul 27, 2009 5:03 am

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"

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Postby wimoos » Mon Aug 17, 2009 1:05 pm

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.

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

found it

Postby wimoos » Tue Sep 01, 2009 11:13 am

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.

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

CEEK

Postby wimoos » Tue Sep 22, 2009 12:08 pm

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.

Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Postby Diddl » Wed Sep 23, 2009 12:54 am

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 ...

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Postby wimoos » Wed Sep 23, 2009 2:59 pm

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:

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Fixed it, and reworked the manual

Postby wimoos » Thu Sep 24, 2009 2:07 pm

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).

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

How CALL works

Postby wimoos » Mon Oct 12, 2009 1:14 am

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.

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

LETTER OFF/ON

Postby wimoos » Wed Dec 30, 2009 1:25 pm

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.

Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Postby Diddl » Wed Dec 30, 2009 1:51 pm

Very fine, will patch my Rom too, thanks!

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Exbasic disassembled

Postby wimoos » Wed Jan 06, 2010 1:33 pm

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.

User avatar
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Postby carlsson » Thu Jan 07, 2010 2:28 am

Soon now you can rename it WimBasic. 8)
Anders Carlsson

Image Image Image Image Image

wimoos
Vic 20 Devotee
Posts: 245
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

wimbasic

Postby wimoos » Thu Jan 07, 2010 4:14 am

Thanks for the suggestion.

I have already reserved www.wimbasic.nl :D

Regards

Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Postby Diddl » Thu Jan 07, 2010 4:32 am

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)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest