Jump to content



Photo
- - - - -

BASIC improvement?


  • Please log in to reply
24 replies to this topic

#1 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 12 February 2003 - 11:37 PM

Would it be posible to:

Create a add-in which could be called from a BASIC program, that way we could use fast functions that normally take a long time or could not be used at all, such as sprites and text on the 8th line.

I'm thinking it could work something like AShell for the TI's.

#2 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 13 February 2003 - 05:37 AM

This seems to be difficult but is probably not impossible.
Here is one way I think it would work:

You write a TSR that you lay on the timer interrrupt.
This will scan a variable/listbfile/matrix ... (everythin you have
write / read access to in basic files). If it has a certain value it
scans other variables / fields of the list / matrix and performs
the requested operation. This would probably take a huge ammount of Ram
because it's TSR but it should be possible.

I won't do this! This was just an idea. I know nothing exactly about changing
an interrupt so it someone with a lot of expiriences. Maybe roeoender will
try it???

Bye Huhn

#3 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 13 February 2003 - 08:54 AM

Another way is to make your own BASIC interpreter.
It would use some of the calculator's tokens and it would be definietly faster then built-in basic.
Noone ofcourse would make a complete (the same as the oryginal) BASIC but a smaller subset game&graphics-oriented would be possible.
At my school I will have a subjeect called "translators & interpreters" and I would like to dom something like this for it. But it will be in 12 months or so, so don't excite about it. :-)
Roeoender.

#4 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 14 February 2003 - 07:57 AM

Well I searched for my asm books and found an example for programming
a TSR, then I searched the interrupt the calc uses for displaying characters.
(it is INT10/09)

So I wrote a simple plugin that enables you to reboot the calc by simply outputting a # on the screen. This needs a little improvement though
because if the driver is installed while writing the programm immediatly after
calling the SYBL pop-up menu the calc will reboot because there is a '#' in it.
Probably I'll also use a variable that has to be set to a special state to
start the program.

If someone is interrested in the sourcecode simply send a PM/Mail

Bye Huhn

#5 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 14 February 2003 - 10:34 AM

I was thinking that you could call another BASIC program and that would take care of the specifics, you would just have to specify what functon you wanted to use and any paramerters.

for example, if you wanted to draw a line:
1->N //function number
0->X //1st X coordinate
0->Y //1st Y coordinate
1->A //2nd X coordinate
1->B //2nd Y coordinate
Prog "ASM"

#6 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 14 February 2003 - 06:02 PM

It's only possible the same way (I think).
I think of something like:


1->List 11 //function Number
0->List 12 //1st x coord
0->List 13 //1st Y coord
1->List 14 //2nd X coord
1->List 15 //2nd Y coord
"*" //execute
I think thats more easy to use.
But I've some problems using the cmm in an interrupt routine.
I'm probably doing sth. wrong there. It'll need some further testing ...
But I think it's possible

You'r way will result in the same thing only that the prog asm will contain the
trigger for the TSR

Bye huhn

#7 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 14 February 2003 - 06:15 PM

But I've some problems using the cmm in an interrupt routine

Remember to set your data segment to cs (in order to acces local data), cause this is the only segment that will change when your interrupt is called..

#8 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 14 February 2003 - 07:18 PM

Thanx BiTwhise!

I'll try it but till now I've another model working.
You can enable / disable the extended-Basic driver using basic files
Functions are also given via the print command.

enable -> "#"
disable -> "~"

To reboot use:
"#5" etc.

If you want to print #5 you must use #D (deinstall) what will remove the
Extended basic (but not the driver!)

Tell my what functions you want and I'll implement them!

Bye huhn

#9 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 14 February 2003 - 07:38 PM

keep in mind, that in order to effectivelly extend the casio basic format, you'll need to manipulate variables stored in floating point format.
Either that, or you would have to include a declare variable function, which declares variables from the text given to the functions. you would then also have to include a function to release these variables so they don't lock the memory..

I think the last way would yield the best performance, but limits functionallity somewhat.. and users would need some extra programming experience to do it (might as well do it in c.., on the other hand, you can do it on-calc, which is cool)

you could include new variables for sprites, vectors, and arrays of these types..

you could then plot polygons, implement 3d plotting, plot sprites, scroll screen, ++ :)
functions are virtually endless, but remember, it will be a TSR, and as such, shouldn't occupy to much of memory...

#10 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 14 February 2003 - 08:10 PM

Here are some things I think it needs:

filled/un-filled Circles
sprites- you should be able to defign them some how
scrolling
polylines
filled squares
color (gray,white,black)
Screen update- that way we can draw many things to the screen, then show them at once (even normal stuff).
a pixel test function which can tell if the pixel is off, gray or black
user defigned functions?
a better text display
STRINGS!!!!!!!!!!!!!!!

Mabey more later...

#11 MathManiac

MathManiac

    Casio Addict

  • Members
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:Portugal
  • Interests:Maths & Physics
    Girls
    Science fiction
    Cinema

  • Calculators:
    fx CG20
    fx 9860 GII SD
    Afx 2.0 plus
    CFX 9850 G
    Fx 115 D
    TI 83 Plus SE
    Ti 92 Plus
    Hp 49 G

Posted 14 February 2003 - 10:12 PM

I would be happy if i could use CAS functions in basic programs...(OK, i'm asking too much!!!)

#12 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 14 February 2003 - 10:22 PM

actually thats not a bad idea, but I think I remember someone saying it couldnt be done.

#13 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 15 February 2003 - 05:33 AM

Can anybody tell me how to decode the numbers stored in the list files???
This would help me a lot!

But I'll definately *NOT* include floating point support because there is no
FPU and rewriting FPU functions will make the program HUGE.
Every value passed to E-Basic has to be an integer

Bye huhn

=============== EDITED =====================

OK guys! I know now how the BCD format of the Lists is but has anyone
already got a good working routine that can decode a BCD-packed string
to a 16 Bit Value??

#14 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 15 February 2003 - 05:57 AM

Then you will have to use pixel coordinates for the screen instead of plot coords.

#15 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 15 February 2003 - 07:38 AM

Is there any possibility to add files to drv A: there is free unused space and
this way you could patch the autoexec.bat so that the E-Basic is loaded every-
time the calc is rebooted. In Flash-Editor / Flash100 you can only change menu-
icons but can't access the files in the system zone.

#16 BradN

BradN

    Casio Addict

  • Members
  • PipPipPip
  • 69 posts

Posted 15 February 2003 - 03:24 PM

There is either a checksum or a direct comparison to ROM that is done before the calc is booted... if you simply modify A:, it will re-load it from ROM. I haven't disassembled the BIOS boot process far enough to see which is the case.

#17 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 15 February 2003 - 04:01 PM

Are you sure??
If you change the Main Menu the system is not reset.
And the files are included in the system file.
I looked in a system file downloaded with flash com and there
I found the contents of the config.sys and autoexec.bat files!?!?

#18 BradN

BradN

    Casio Addict

  • Members
  • PipPipPip
  • 69 posts

Posted 15 February 2003 - 04:24 PM

OK, go ahead and change some text in the ROM-DISK image if you don't believe me :)

#19 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 15 February 2003 - 04:33 PM

Shit!

I changed the word BUFFERS to BFUFERS (so this would not provoke a
checksume error if there is a checksume a all) but I get and DATA ERROR 78
(one I never saw before). If I let it reset will this only reset Drive A
or all drives ???

#20 BradN

BradN

    Casio Addict

  • Members
  • PipPipPip
  • 69 posts

Posted 15 February 2003 - 04:34 PM

it should only reset A: if I remember. If you want to try something else, try increasing one character by one (eg, A to B), and decreasing a character that is 4 after it, and see if it works then... (BUFFERS > CUFFDRS) - if this works, it proves they're using a 32 bit checksum.

Don't change anything that could crash your calc at startup, or you'll find yourself in a tricky situation trying to recover it (eg, having to disable the flash somehow and re-enable it to allow the reset).

Edit... these emoticons have really been pissing me off as of late... lol

#21 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 15 February 2003 - 05:07 PM

OK.

At first it deleted the WHOLE flash :( :( :(
Second: Changing the buffers command as you suggested also caused
the same error.

#22 BradN

BradN

    Casio Addict

  • Members
  • PipPipPip
  • 69 posts

Posted 16 February 2003 - 04:16 AM

Hmm... the reason I thought it would only erase A: was that loading a system segment from a different calculator ROM version just seems to reset part of the flash... oh well.

#23 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 16 February 2003 - 12:20 PM

We went a little offtopic ...

A question: Is it possible to call another program from within a TSR???
I need this to get the memory requirement lower. Else I don't know if
it's good writing to large interrupt routines because they eat memory. If I
only call a secon program when neccesary the memory will be free again after
the program has run. It also will make programming more easy.

I tried it using INT21h/4Bh but it only crashed the calculator ...

#24 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 26 February 2003 - 06:31 PM

anything new?

#25 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 27 February 2003 - 09:03 AM

No :(

no one could help me with my problem and so I stopped developing.
I now concentrate on my office suite
(Font creator DONE / Fontuplaod DONE / Main Interface DONE)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users