Jump to content



Photo
- - - - -

Basic Files


  • Please log in to reply
22 replies to this topic

#1 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 30 January 2003 - 06:52 PM

Hi there!

2072 told me how to do this. He said I sould link his library into my program
but the problem is at first taht this methode eats about 16 Kb of diskspace
This is more than three times as large as the whole program is. And ist's
pretty unhandy.

I myself don't understand (and like) enough c to rewrite the llibrary in
assembler. But I need these Files for my current projects.

I'm searchin for someone who knows how to CREATE/DELETE/WRITE TO/READ FROM Basic Files and has the ability to write a simple library for the usage with Tasm.

If the problem are technical information maybe 2072 would help.
I would be VERY thankfull for this and of course mention you in my about dialogs!!!

#2 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 30 January 2003 - 07:56 PM

I mainly use TASM, so give me a day or two, and I'll try :)

#3 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 30 January 2003 - 09:47 PM

I really do not appreciate your post!

It took me a lot of time to program this library, it is not simple to write in a basic file without erazing the calc mem after a reboot.

For now I'm the only person who knows how to CREATE/DELETE/WRITE TO/READ in a basic file (without counting casio programmers...).

My library just does the necessary, you won't have simpler...

if you used UPX you could divide the size of your prog by 2 (there is a link on the link page of my website).

use this command line to have the best ratio :
upx.exe --best --crp-ms=100000 --8086 -v yourprog.exe

And what do you mean by "unhandy" ??

#4 dscoshpe

dscoshpe

    Casio Freak

  • [Legends]
  • PipPipPipPip
  • 185 posts
  • Location:California, USA

  • Calculators:
    AFX 2.0 (v1.00), 9850Ga+, 9800, BE-300 other..

Posted 30 January 2003 - 10:34 PM

on the other hand, unless your assembly abilities are very very good, any program you are likely to make should be able to absorb the extra 16k.. but yes, other than Roe's methods, 2072's are the only option. (I think Roe said he would update the working example of his method in a couple weeks)

- dscoshpe -

#5 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 30 January 2003 - 11:39 PM

Sorry if I offended anyone here..

All credit to 2072 for his librarie and the work he has put in to getting in with the casio way of working things :)

However, I'm gonna make an attempt of doing the same kind of library in asm, for use with Tasm, and maby later, make it linkable with c..

I think I can squize the size down quite a bit, but in ways of making it much faster or reliable, I don't know.

Again, all credit to 2072. I use his Touche program + some of his source, to learn the format of the MCS, which I think I'm finished with now.. so I'll start programming. Thnx 2072 :)

#6 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 31 January 2003 - 11:16 AM

I was talking to huhn_m not to you BiTwhise.

My library really take about 4 Kb in a program then it's TC that does I don't know why and add about 10 Kb to the size...

Anyway good luck. But know that I don't think there is anymore bug in the last version.

But please tell me in what way you can improve the size?

#7 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 31 January 2003 - 12:02 PM

@2072
with "unhandy " I mean that I don'T get it working by pushing & popping
the registers. I didn't want to offend you!!!! The work you did is great!
Of course you library doesn't eat this much diskspace but the C librarys
do.

@dscoshpe
Yes it should but I want to slit my program in 5 parts to make programming
and updating more easy and this it would grow
16*5 -> 80 KB larger (and this will be a problem even ifI compress it)

#8 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 31 January 2003 - 08:07 PM

@2072:
You could make a simple program that would create a Basic File with a specyfic size on request - this would remove the need of including those routines in many programs. It would be usefull if this program could be launched from command line like this:
makemem.exe FNAME 4048
FNAME- basic file name
4048 - BASIC file size in bytes.
I think that it is very easy to do and helpfull.
Roeoender

#9 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 31 January 2003 - 09:04 PM

Well but how did you access it afterwards? You still need some lib... and this way isn't really handy since the prog I'll make will use ~14Kb because of TC... so it's better to link it.

#10 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 01 February 2003 - 04:34 AM

I was thinking, why not make a small TSR, and hook it up to an interrupt.. I'll try that :)

#11 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 01 February 2003 - 04:41 AM

Yes thats an great Idea I myself thought about this, but
I don't know how to do this in c!
I tried it on a simple example and it didn't work!

You can use INT 41h for exapmle because it don't seems to be used.
Then you could do sth like
AX = 0 -> Delete file
...


Keep on doing!

#12 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 01 February 2003 - 04:56 AM

I havent tried yet.. but I guess I'll go with the usual int layout
ah = function selecion
other registers for passing information
returns result in ax (+ segment and index registers if necesary)

If I make such a library, I'll make a complete map of which registers are destroyed, etc, for programmers to use.

Anyway, for now, it's just a thought.. :) lots of things suddenly came up these days..(like partys and stuff), so little time for my calc.. and on Monday, school starts again..

Oh well, this isn't as big a project as my 3d-grapher, so I'll probably finish ASAP :)

#13 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 02 February 2003 - 05:57 PM

@2072
Most programs (games) use only one specyfic BASIC file, so they don't nead a feature of creating it (which takes much space), and all functions for finding a BASIC file and reading from and writing to it are really small (and easier to make in ASM if someone really wants to). That is why I think my previous proposition makes sense.
Roeoender

#14 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 03 February 2003 - 01:31 PM

@roeoender
Of course this will make the programs much smaller, but
how long will it take to write 5KB to a file??
You have to call the program 5000 times!
I think thats slower than calling an interrupt!

Bye
Huhn_m

#15 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 04 February 2003 - 06:03 PM

what are you talking about?
You just need the memory address of the BASIC file (SEGMENT:OFFSET)
and from now you can do everything just like on usual structure.
You probably didn't read previous posts carefully.
Roeoender.

#16 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 05 February 2003 - 12:11 PM

Oh! Sorry!

I read them but I didn't get what you ment!
But how will you return these adresses? Errorlevel allows only 1 number to
be returned! And I also think it is easyer to use interrupts,

Sorry if I offended you! I didn't mean to!

Bye Huhn

#17 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 05 February 2003 - 01:17 PM

As Roender said, the routine for searching a Basic file is very small and easy to make.

Such a function can be built to return address, size and such in registers, or, to easier link with c, put all relevant information in a data zone asigned by a pointer provided to the function on call.

Reading and writing routines only relies on this pointer to know where to read or write.


It's creating/deleting and resizing that demand for more complex functions (MCS / MAT needs to be updated, huge blocks might need to be moved, etc).

#18 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 05 February 2003 - 03:05 PM

But because I'm currently working on some office-like tools
creating and resizing files wil be very(!!!) important.
Otherwise you could only save a fixed number of files.
And they could only have a fixed or predefined size if you
couldn't resize them.

You see that I like the idea with interrupts most :D

#19 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 06 February 2003 - 09:17 PM

to huhn_m:
Yes for this purposes "my way" is useless.
Using interrupts is a method - look at the first Kb of RAM there is a list of addresses of the interrupts (you probably know that, if not look at some M$ DOS-programmer books). You may see there that one address is very commonly used - this is probably the address of the routine that handles the unused (unhandled) interrupts - by this way you will know which interrupts you can easly use.

Another way is to make some kind of a library (but it probably would be better for other purposes like graphics lib) - you simply write binary code on one of the flash drives which contains all your procedures.
Then your program searches where this FLASH drive is mapped in the RAM and find your routines (by "magic" string, or this address could be fixed).
To use a specified function you load registers like this (example):
ES:SI - will point to the basic file name
CX - desired basic file size
etc.
and to execute the procedure you make a far jump to desired procedure (addres found like above).
Hope I have described it clearly (?)
Roeoender.

#20 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 06 February 2003 - 11:57 PM

About the int.

I believe this common pointer on the interrupt table points to a place in memory, which only contains an 'iret' instruction. To scan for free interrupts, you scan the table, and compare the instruction at the pointer from the table with an 'iret', if equal, you have found yourself a free interrupt :)

This way, you can dynamically allocate interrupts on the table. However, that's not very suitable for a library, which programmers need to know which interrupt is hooked up to..
(the int number could be detected runtime, by including some sort of identifier in the library, but would demand for some extra bit of code in the actuall program)

The best would probably be to scan the tables of all the ROM versions for free interrupts, and decide for a universal mapping of user made ints.

#21 BradN

BradN

    Casio Addict

  • Members
  • PipPipPip
  • 69 posts

Posted 13 February 2003 - 11:14 PM

Has anybody come up with some asm routines for A) creating a basic file, or B) resizing one? If so, it'd be cool if I could borrow those :)

#22 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 13 February 2003 - 11:20 PM

I've made a small library for this

It still need more extensive testing, and expanding.. but if anyone is interested I can mail it to them

It's full TASM source, so a little conversion will be necesarry for use with NASM

#23 BradN

BradN

    Casio Addict

  • Members
  • PipPipPip
  • 69 posts

Posted 14 February 2003 - 12:32 AM

Send it my way please :)

bradn2 at yahoo.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users