Jump to content



Photo
- - - - -

On Calc Compilation


  • Please log in to reply
26 replies to this topic

#1 zerocool

zerocool

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 February 2005 - 09:56 PM

Greets,

Is it possible to run a compiler on the calculator? Ive read through prior messages on this forum, and im quite sure its possible. I kno that the AFX has enough memory to run several of the C compilers out there, and i guess an assembler program could be possible too.

But exactly how could it be accomplished? Even if we had an editor that has full ASCII character support, how is it possible to save the file onto the rom, so the compiler can access it? Or is it possible to get the compiler to read it straight of the RAM? Also, another problem is that the compiler only creates an object file (.obj), which then has to be run through a linker, to be made into an exe.

So really my main questions are, how can i get the compiler to read the program code, and how can i get it to save the .obj and the .exe files.

Of course... i may be totaly wrong here, and that there is no possibilty to do any of this, and we'll just have to live off of interpreted programs like Casio-Basic or MLC (which is a great piece of work, IMO).

Thanks,
Zerocool

#2 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 06 February 2005 - 10:04 PM

you have to write and compile c/asm programs on the computer, then transfer them over to your calc. there isnt any on calc compilers ;)

#3 zerocool

zerocool

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 February 2005 - 10:07 PM

ah well, i knew writing on the computer is an option, i was just wondering it it could be possible on-calc too, since it would seem that we have enough memory available :unsure: ... or not?

#4 Marco

Marco

    Casio Freak

  • Members
  • PipPipPipPip
  • 185 posts
  • Location:Dresden, Germany

  • Calculators:
    Casio CFX 9850G (broken),
    Casio CFX 9850GB,
    Casio Algebra FX 2.0 Plus

Posted 06 February 2005 - 10:35 PM

In principle, an on calc C compiler would be possible, but currently there isn't one. Even if there was, such a compiler and the programs it generates would be very limited, cause due to the compilation process the compiler would take nearly all ressources for own code+data, so very few left for code+data of the program to be compiled only (that you have to assemble in the RAM before writing to Flash). Even with MemZones you would not have enough ressources - remember you also have to store the program's source and that of the libs in the RAM ... (maybe using RXE + storing precompiled LIBs to flash would be possible at least? :rolleyes:)

However, for on calc programming you should use MLC. It's not only an interpreter like Casio Basic, but also a kind of compiler that generates a bytecode before interpreteing it (--> not interpreting the source and much faster thus). Also the MLC interpreter/compiler takes much fewer ressources than any C compiler could (as the syntax is not that complex as C), and the program's sources don't do, too (you need no moduls for graphical routines and so on).

Also a good alternative for on calc programming is using the WinG100 emulator and developing/testing your stuff on PC completely (your PC isn't that mobile your calc is however ;)).

#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 06 February 2005 - 11:15 PM

I think Roe has been experimenting with an on calc C or ASM complier (i forget which one), so if we see one it will probably come from him

#6 zerocool

zerocool

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 07 February 2005 - 12:15 AM

ok thank you,
yes, MLC is great, but it does have it limitations. Its purely game programming, which dont always suit one's needs. There are a lot things that cant be done with MLC that could be done with ASM or C. But yes, maybe MLC is the best we can get for on calculator programming. But if compiling is possible, it would be awesome :thumbsup:

well anyways, thanks again
Zerocool

#7 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 07 February 2005 - 02:11 AM

I am not really an authority on such things, but one limitation that you will probably encounter is the poor file system of the AFX. The drive system is just a horrible setup in my opinion. This is the main thing on my short list of things that I dislike about the AFX. The TI-89 has a great setup that lets you store as many files in any order as memory allows in either the FLASH or the RAM. It is almost like a harddrive. Didn't Roe find a way to change what program the calculator boots to? I know that the ROM on all AFXs are non-eraseable and making a new ROM is not possible but would it be possible to make the calculator boot to a different program stored on one of the FLASH disks? If that were possible, perhaps one could take over all 256k of RAM and use it for larger programs. Obviously, all calculator functionality would be gone at this point but I think the system would be very convenient if you could somehow boot to this other program, use your DOS program, save the data to a FLASH disk, then boot back to the calculator software. All settings would be lost but for me at least, all I would really be losing is my radians/degree setting. Something like that is totally beyond me but maybe someone knows if something like that is at least possible?

#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 07 February 2005 - 10:53 AM

Yes I managed to run a C compiler on the calc. This compiler used about 3 or 4 separate programs each responsible for different phases of compilation. Thanks to dividing compilation to several independent and smaller programs and passing data between them with files, memory usage was greatly limited (but it needed ramdisk). I used 64Kb ramdisk for temporary files. Compiled source code was about 5kb (I didn't test limits). As there was no on-calc editor I just copied source code from PC and compiled on the calc.
Useful tools for doing this stuff (ramdisk, enter key emu, highmem bound changer) are in my AfxPC package (somewhere on the net).
Probably with RXE possible a different compiler would be more suitable.
There's lots of tiny compilers or even C interpreters to test.

BTW My Ramdisk simply overwrites end of memory - if it isn't used it is ok but when you have some basic stuff there your calc may crash.

A86 assembler works with less pain.

My (poor) method of booting other code wastes 2 or 3 flash disks so it wouldn't be popular anyway.

I don't have time in visible future to play with it, I hadn't got time even to play MLC yet :cry:
Roeoender.

#9 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 07 February 2005 - 10:49 PM

Roe, how do RAM disks work? Would it possible to steal all of the calculators RAM and use it for yourself?

#10 4nic8

4nic8

    Casio Freak

  • Members
  • PipPipPipPip
  • 182 posts
  • Location:Warsaw, Poland

  • Calculators:
    Casio AFX 2.0 ROM 1.01, TI-89 (ASM 2.08 HW 2.00)

Posted 09 February 2005 - 11:23 AM

This topic sounds really interesting. Some time ago I was wondering on the same thing but I've never found a clue to succeed. (I didn't know that Roe already made it ;) ).

@Roe: do you think that there is a possibility to run NASM (259kb :angry: , it would thake 2 drives) , and TLink (131kb :blink: )?
Oh well, I guess I should use A86 instead. Could you give more information how should I run it?

#11 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 09 February 2005 - 03:53 PM

Well, use tools from my AfxPC to establish ramdisk and in case that compiler says "not enough memory" use maxmem to raise system memory boundary. Use enter.com and (optionally, only for verbosity) datalight's command.com to manipulate files from command line. Maybe with RXE programs could fit in memory without using maxmem it would be good as it gets memory that is already used by calc's original software.
Before doing anything make sure to backup your data to the PC :)

@Aleph: just read all readme.txt from AfxPC package.

Roeoender.

#12 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 09 February 2005 - 05:32 PM

i have tried, and i have succeeded in getting a few programs running... like Tiny C Compiler, or A86... but they dont work correctly... the calculator just crashes when it is run...

do any of the settings for the ramdisk or maxmem need to be changed? like the address where the ramdisk is stored?

greetz,
zerocool

#13 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 25 February 2005 - 04:22 PM

Is it possible to add more RAM to the Casio CFX manually?
Can adding more RAM to the CFX give it the possibility to have a compiler for it?

Andy.Davies: I deleted your other post on this, you only need to ask once :)

Edited by Andy.Davies, 25 February 2005 - 05:10 PM.


#14 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 25 February 2005 - 05:08 PM

there is a how to on a website somewhere, but i dont know the url, and if i remember rightly the tutorial is in german.

#15 Marco

Marco

    Casio Freak

  • Members
  • PipPipPipPip
  • 185 posts
  • Location:Dresden, Germany

  • Calculators:
    Casio CFX 9850G (broken),
    Casio CFX 9850GB,
    Casio Algebra FX 2.0 Plus

Posted 25 February 2005 - 05:30 PM

It's Marcel's CFX-9850G Seite, but there's no english version available.

He soldered a 32KB chip into his calc and got 64KB by that, some others copied it (btw. he also overclocked his calc to 8MHz and some copied it too, that's twice the original speed B))

Can adding more RAM to the CFX give it the possibility to have a compiler for it?

No, a ROM update would be necessarry. Call Martin Poupe (-> Martin?s Hacking Site), but I think he stopped it a long time ago.

#16 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 25 February 2005 - 06:48 PM

actually, if i remember correctly, mo translated that site.

#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 26 February 2005 - 04:51 PM

sitenote @zerocool:
huhn_m: Please log in when posting. The guest posting is not for lazy users :)

#18 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 28 February 2005 - 04:12 PM

Can anyone make a C compiler for Casio CFX?

#19 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 28 February 2005 - 04:18 PM

not really, there is nowhere on the calc to upload the progs to....

#20 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 28 February 2005 - 04:24 PM

Nobody is going to try to put the MLC on CFX?

#21 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 28 February 2005 - 04:28 PM

The only way would be that every calc user take a part his cfx, unsolder the ROM and re-programs it with a new OS....

#22 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 28 February 2005 - 06:53 PM

i mean... i guess we could do it... but only like 2 people would use it :(

#23 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 28 February 2005 - 08:14 PM

i mean... i guess we could do it... but only like 2 people would use it :(

<{POST_SNAPBACK}>


I know a lot of people who would like to have the MLC on CFX

#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 28 February 2005 - 08:18 PM

well, yeah, but how many people are going to put in a new ROM, risking destroying there calculato in the process...?

#25 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 28 February 2005 - 11:58 PM

i highly doubt it, if you managed to get the MLC onto the calc, you definatly wouldnt have the memory for the games. i am pretty sure that the CFX dosent have the memory for the MLC anyway. and then there is the problem that it dosent have flash memory, so there is no where to put the MLC anyway.

#26 Guest_CFX & FX Owner_*

Guest_CFX & FX Owner_*
  • Guests

Posted 03 March 2005 - 04:12 PM

If you want to read or write to a ROM chip, you need a ROM reader right?
If so, where do you get a ROM reader?

#27 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 03 March 2005 - 05:51 PM

in some electronic shop like CONRAD http://www.conrad.com




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users