Main filesystems

CASIO calculators have a main filesystem, also called “main memory” and “MCS” (for “Main Control Structure”) that contains all the little files necessary to the main functions, such as programming, working on lists, matrixes, spreadsheets, pictures, strings, and so on.

A main memory file is either a blob of data specific to a platform, or an interpreted memory file which is understood by libcasio.

The main memory head

Platform-generic definitions

Every main memory file has a head, which contains the meta-information for it, including its name and type as defined by the main memory. It is defined through the following type:

type casio_mcshead_t

The abstract object representing a main memory file head, including its meta-information.

It defines the platform for which the main memory file is for:

type casio_mcsfor_t

The main memory file platform, i.e. for which platform or protocol the file was for.


Platform-independent file, although all the features in this file might not be supported by all platforms.


Standard main memory archive (or protocol 7 main memory) file, for the fx-9860G.


Legacy CAS40 header.


Legacy CAS50 header.


Legacy CAS100 header.

From the raw header, the library will usually try to find out a platform-independent type amongst the following:

type casio_mcstype_t

The main memory file type, as represented in libcasio for types that can be managed by it.


An unknown blob of data which hasn’t been interpreted by libcasio.


A program in Basic Casio.


A list of number values.


A matrix of number values.


A picture (simple picture).


A capture (double picture).


A spreadsheet.


A string.


The setup file, containing all the calculator settings.


The alpha memory, containing all the calculator variables.


A vector.


An end file (specific to CAS links, see Using the CAS protocols).

Platform-specific headers

You’re not obliged to use the platform-generic main memory file type, you can get the raw headers from the platform, either in this format for fx-9860G files:

type casio_mcsheaders_t

Raw fx-9860G MCS headers.

char const *casio_mcsheaders_name

The file name.

char const *casio_mcsheaders_dirname

The directory name.

char const *casio_mcsheaders_group

The file group.

int casio_mcsheaders_type

The numerical type for the file.

Or in this format for CAS files:

type casio_casheaders_t

Raw CAS (CAS40, CAS50, CAS100) headers.

char const *casio_casheaders_app

The application name.

char const *casio_casheaders_name

The file name.

char const *casio_casheaders_data

The CAS data type.

unsigned long casio_casheaders_flags

The flags for such a header, such as:


There still are file parts to read.


The file is actually a set of files.


The head is actually a request (for links).

You can make a head using the following functions:

int casio_get_mcshead_cas_headers(casio_mcshead_t *head, casio_casheaders_t **headersp)

Get the editable CAS headers pointer (updates are not taken into account until a set is made).

int casio_set_mcshead_cas_headers(casio_mcshead_t *head, casio_casheaders_t const *headers)


Only use a structure pointer that has been obtained through casio_get_mcshead_cas_headers() for binary compatibility.

Set the CAS headers.

int casio_get_mcshead_mcs_headers(casio_mcshead_t *head, casio_mcsheaders_t **headersp)

Get the editable MCS headers pointer (updates are not taken into account until a set is made).

int casio_set_mcshead_mcs_headers(casio_mcshead_t *head, casio_mcsheaders_t const *headers)


Only use a structure pointer that has been obtained through casio_get_mcshead_mcs_headers() for binary compatibility.

Set the MCS headers.

Managing the head

To get and set the type and platform, use the following functions:

int casio_get_mcshead_type(casio_mcshead_t *head, casio_mcstype_t *typep, casio_mcsfor_t *forp)

Get the MCS file head type and platform. If either of these two last pointers is NULL, then it will not be filled.

int casio_set_mcshead_type(casio_mcshead_t *head, casio_mcstype_t type, casio_mcsfor_t for_value)

Set the MCS file head type and platform.

The head contains some more data (for protocol 7, this data is actually within the file, but for a more coherent interface, libcasio considers it as being part of the head):

  • for pictures: a width, a height and a picture format.

  • for programs: a password.


Main memory files

It is represented by the following type:

type casio_mcsfile_t

The abstract object representing a main memory file for any platform.