
    CaS reference guide

Notes
=====

1.  Numbers and variable names are used as-is.  Remember to use UPPER CASE
    for variable names.

2.  Generally, `words' can be used as-is too.  Thus `Lbl 3' is the correct
    usage.  Only the first letter may be capitalised.

3.  Always follow the syntax of the calculator

4.  Note that lower-case will be translated as lower-case, and appear on the
    calculator in lower case, even though this is impossible normally!

5.  `words' will only be translated when in string literals if the
    capitalisation and spacing exactly matches that on the calculator.  Hence
    "sin " will be the name of the function, whereas "sin" or "Sin " are just
    a collection of letters.


Reference
=========

Basic programming
~~~~~~~~~~~~~~~~~
    ->      Assignment arrow  (eg 3->A)
    _       (at end of line)  <disp> triangle thingy
    =>      `then' (eg A > B => Goto 2)
    <>      Not Equals
    >=      Greater than or equal to
    <=      Smaller than or equal to


Mathematical functions
~~~~~~~~~~~~~~~~~~~~~~
    %       Fraction delimiter (eg 1%2 = 0.5 => "CALC WORKS!"
    \sqr    Squared.  3 \sqr = 9
    \sqrt   Square root.  (eg \sqrt(A \sqr + B \sqr) -> C)
    \cbrt   Cube root
    \^-1    Inverse.  (superscript -1)
    ^       Power  (x^y button on 7700)
    \nrt    nth root.
    arcsin  arcsine/arcsinus of a ratio.
    sinh    Hyperbolic sine
    arsinh  Inverse hyperbolic sine
    \sum(   Summation function
    e^      e to the power...   (shift ln)
    (10^)   10 to the power...  (shift log)
    *10^    Exponent (E)
    \A      hexadecimal digit A

Probability
~~~~~~~~~~~

    Ran#    Random number
    !       Factorial
    nCr     Combinations
    nPr     Permutations


Miscellaneous
~~~~~~~~~~~~~
    \i      Complex i  (\sqrt-1)
    \f1     Function memeory 1
    \pi     Pi (3.141...)     

Further Reference
=================

A canonical list of *all* tokens supported by CaS is in `ascii.tok'.
To see how to read this properly, read `tok_specs' in the cashack.zip file.


CaS command line options
========================

  [-i[=format][,args[,args[...]]]] <filename>  

     Specify the input filename, type and arguments.
     If filename is `stdin' or `-' then uses standard input

  -o[=format][,args[,args[...]]] <filename>

     Specify the output filename, type and arguments
     If filename is `stdout' or `-' then uses standard output

  -l[=format][,args[,args[...]]]

     Specify the list type and arguments.  Generally the list type is only
     a text file type: (asc, dos or tokfile.tok)

     Types:

       asc:     Text   (ascii.tok)
       dos:     Text   (cp437.tok)
       fxp:     .FXP files as made by Bob Parish's program.  These can only
                contain Single Programs
       cas:     .CAS files; generally a mirror of the transmission format.
                Used by Casio's Program Link software.
       bmp:     Windows 3.0 monochrome RGB encoded bitmap files
       gif:     (output only) .GIF file

     Also included as token files:

       link-up.tok :  compatibility with .LNK files created by LINK-UP
       casiodoc.tok:  load the text files created with this token file into
                      Windows Write (or Wordpad), and view with casio's
                      CASIODOC.TTF font.

     Cas will attempt to determine the file type from the extension of the
     file.  Default output depends on the input type:

       Type     Extension   Default output

       asc      (.txt)      cas
       dos                  cas
       token files          cas
       fxp      (.fxp)      asc
       cas      (.cas)      asc
       bmp      (.bmp)      cas
       gif      (.gif)      cas


  -c[,args[,args[...]]]
  -C[,args[,args[...]]]

     Convert data to another type; f.e. converting a screenshot to a program
     which draws that screenshot.
     -c performs conversion *before* list, -C does so *afterwards*.

  -v

    Verbose mode.

  -d[=file]

    Writes debug information into file (stderr if not specified)

  -p
   
    Pages output every 20 lines.


Arguments
=========

  Arguments are not case-sensitive, and come in two forms:

    flags
    ~~~~~
    A flag is set by simply specifying its name in the argument list for a
    switch, eg:

      -l,crop,block
    
    sets ths `crop' and `block' flags.

    values
    ~~~~~~
    This sets a certain value, and is as follows:

      -i=com,baud=1200,parity:odd

    Note that the value and the name can be separated by either a
    ':' or a '='.

  Screenshots
  ~~~~~~~~~~~

  inverse       -i,-l,-o.
                Inverses the screenshot at that stage:
                -i,inverse  inverses as read, so -l and -o already inv.
                -l,inverse  only lists the screenshot in inverse
                -o,inverse  only ouputs the screenshot in inverse
                thus -i,inverse -l,inverse will invert, but list normally...

   block        -l
                Uses block characters when listing screenshot (DOS only).

   single       -l
                Lists in single lines, instead of packing two calculator
                lines onto one text mode line.

   top=         -l
   bottom=      Sets the characters to be used for listing a screenshot.
   full=        Note that literal characters should be preceded with a $ 
   empty=       whereas ascii values (eg 32 for a space) should be used as-is
                eg -l,top=$~,bottom=$_,full=$#,empty=32
                for a wavy output :)

   crop         -l
                crops the display at 79 columns.  To view screenshots properly
                you wil need to set the text mode to 132x43.  This can be done
                using the accompanying `widescr.com' utility.  Note that not
                all video cards support this.  `normscr.com' will return the
                screen to normal.


   Listing Programs
   ~~~~~~~~~~~~~~~~
   num=         -l
                spc:  adds a space between every token - useful to check
                      that tokenisation is happening properly.  Can also be
                      declared using just `spc'.

                dec:  displays the decimal value of the token after each token
                hex:  as above, but in hexadecimal
                oct:  [...] in octal


    dump        -l
                Displays memory dump instead.  You are not expected to
                understand this

    list        -l
                (with dump) displays both dump and standard list

    pass        -l
                Displays editor file passwords in listing


    Communications
    ~~~~~~~~~~~~~~

    parity=     -i,-o
                Sets the parity to be used.
                Valid Choices: odd,even,none.
                Default: even

    baud=       -i,-o
                Sets baud rate.
                Valid choices: 1200, 2400, 4800, 9600
                Default: 9600

    rts         -i,-o
                Causes RTS line to be raised during communications

    nodtr       -i,-o
                Disables raising of DTR line during comms.
                (Default is DTR on, RTS off)

    timid       -o
                Will not overwrite existing programs in the calculator

    pause       -o
                Waits for user input before sending.  Useful if sending more
                than one file:

                for %f in (*.cas) do cas %f -o,pause COM2

    raw         -i,-o (and for .CAS filetypes)
                Specifies `raw' processing mode.  CaS doesn't look at the
                internal data structure of the CAS data, allowing transmission
                and saving of unsupported file types.  Effectively identical
                in to getpas, putcas and casport for Windows.  eg:

                cas -i,raw com2 -o raw.cas -v

------
TW 96/11/14
