Jump to content



Photo
- - - - -

Programming the fx-9860GII-2 with assembly


  • Please log in to reply
5 replies to this topic

#1 hejsotnoss

hejsotnoss

    Casio Fan

  • Members
  • PipPip
  • 31 posts
  • Gender:Male
  • Interests:programming
    mathematics
    piano
    reading

  • Calculators:
    fx-9750GII
    fx-9860GII

Posted 26 February 2020 - 09:26 PM

I have been doing research and I figured out the format for G1A files(header structure) and learned a little about the assembly specifications for my calculator's cpu. I was wondering if someone could give me some directions to what it takes to write a simple program in assembly?

I am having trouble writing the entry point of my program because I do not know anything about the initialization steps.

 

TBit told me about the gint kernel so I will try looking at that for now, but any information will be helpful ^_^

 

Regards, hejsotnoss

4929ca71fffdad5439509ef264df5dd8-full.pn

4d24bef37cb332db3e87418d04884452-full.pn

This is the only thing I could find which shows moving the address(long) of _main to register 3 and jumping to the address of register 3. I'm not sure how I can set this up though.


Edited by hejsotnoss, 26 February 2020 - 10:25 PM.


#2 TBit

TBit

    Newbie

  • Members
  • Pip
  • 26 posts
  • Gender:Male
  • Location:Germany
  • Interests:C/C++, Assembly, Demoscene

  • Calculators:
    FX-9860 GII
    FX-9750 GII
    ClassPad 330 PLUS

Posted 26 February 2020 - 11:22 PM

Hi, it's me againhappy.png

 

I actually forgot to share this, which is probably the best source of info about programming

for the 9860, since it contains syscall references and a (fairly) complete memory map.

 

If you scroll down to the bottom, there's also a zip file which contains some reverse-engineered code from

the SDK, including the complete startup code in minimum/fx-9860GII_2_SDK/LIB/source.

I actually use this for my own projects as well, and I'm currently working on a graphics demo in assembly,

so feel free to ask about stuffsmile.png


  • hejsotnoss likes this

#3 hejsotnoss

hejsotnoss

    Casio Fan

  • Members
  • PipPip
  • 31 posts
  • Gender:Male
  • Interests:programming
    mathematics
    piano
    reading

  • Calculators:
    fx-9750GII
    fx-9860GII

Posted 27 February 2020 - 01:28 AM

Hi, it's me againhappy.png

 

I actually forgot to share this, which is probably the best source of info about programming

for the 9860, since it contains syscall references and a (fairly) complete memory map.

 

If you scroll down to the bottom, there's also a zip file which contains some reverse-engineered code from

the SDK, including the complete startup code in minimum/fx-9860GII_2_SDK/LIB/source.

I actually use this for my own projects as well, and I'm currently working on a graphics demo in assembly,

so feel free to ask about stuffsmile.png

 

Hi, TBit

Thank you, this is really useful :) I'm really glad you showed me this. I'll probably have more questions soon, but thank you again it means a lot ^_^

 

Regards, aleksandr



#4 hejsotnoss

hejsotnoss

    Casio Fan

  • Members
  • PipPip
  • 31 posts
  • Gender:Male
  • Interests:programming
    mathematics
    piano
    reading

  • Calculators:
    fx-9750GII
    fx-9860GII

Posted 27 February 2020 - 05:43 AM

Hey, I was wondering what you use to compile your assembly code into machine code?

 

So far I only managed to manually write the binary file with hex using the opcodes and wrapping it in the g1a format and uploaded it to my calculator, but that seems really inefficient.



#5 TBit

TBit

    Newbie

  • Members
  • Pip
  • 26 posts
  • Gender:Male
  • Location:Germany
  • Interests:C/C++, Assembly, Demoscene

  • Calculators:
    FX-9860 GII
    FX-9750 GII
    ClassPad 330 PLUS

Posted 27 February 2020 - 06:58 AM

I'm using the Renesas compiler toolchain which comes with the SDK. I wouldn't actually fully recommend this, because it is really outdated and full of weird bugs.

You can download the SDK from Casios website, at edu.casio.com/dl after you've registered your calculator. If you want though, I can PM you a link later (Casio probably doesn't care at all about this SDK from 2007...)


The other (probably better) option is to compile GNU binutils for SH3, it has some different syntax though. I think gint includes a linker script if you want to have a try.
  • hejsotnoss likes this

#6 hejsotnoss

hejsotnoss

    Casio Fan

  • Members
  • PipPip
  • 31 posts
  • Gender:Male
  • Interests:programming
    mathematics
    piano
    reading

  • Calculators:
    fx-9750GII
    fx-9860GII

Posted 27 February 2020 - 08:10 AM

I'm using the Renesas compiler toolchain which comes with the SDK. I wouldn't actually fully recommend this, because it is really outdated and full of weird bugs.

You can download the SDK from Casios website, at edu.casio.com/dl after you've registered your calculator. If you want though, I can PM you a link later (Casio probably doesn't care at all about this SDK from 2007...)


The other (probably better) option is to compile GNU binutils for SH3, it has some different syntax though. I think gint includes a linker script if you want to have a try.

I would appreciate it if you linked me the SDK ^_^, I hope it's not too much to ask for. Also, I managed to compile binutils with sh3eb-elf as the target architecture so I will see if I can figure out how to assemble with that.

 

Thank you


Edited by hejsotnoss, 27 February 2020 - 08:15 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users