Using and improving Exbasic
Moderator: Moderators
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
Using and improving Exbasic
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
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
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.
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
found it
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.
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
CEEK
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.
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
Fixed it, and reworked the manual
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).
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).
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
How CALL works
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.
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
LETTER OFF/ON
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.
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
Exbasic disassembled
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.
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.
-
- Vic 20 Afficionado
- Posts: 350
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer