Intrinsic Function

This summary list of intrinsic functions has only terse descriptions. Detailed behaviors, such as exception and boundary conditions, are omitted.

Numeric functions operate on types Byte, Parcel, Word, Cell, Single, or Double. The arguments have the same type as their return value. The return type is derived from the type of the expression in which they are contained.

    abs(Numeric)                    Absolute value

    ln(Numeric)                     Natural log, base e

    log(Numeric)                    Common log, base 10

    log2(Numeric)                   Binary log, base 2

    max(Numeric, Numeric)           Larger of two signed numbers

    min(Numeric, Numeric)           Smaller of two signed numbers

    mod(Numeric, Numeric)           Truncated signed integer or real modulus

    remainder(Numeric, Numeric)     Remainder of a signed interger or a real

    root(Numeric)                   Square root of an unsigned integer or real

Real functions operate on Single or Double types. As with numeric functions their arguments have the same type as their return value.

    acos(Real)                      Inverse cosine in radians

    acosh(Real)                     Inverse hyperbolic cosine

    asin(Real)                      Inverse sine in radians

    asinh(Real)                     Inverse hyperbolic sine

    atan(Real)                      Inverse tangent in radians

    atanh(Real)                     Inverse hyperbolic tangent

    cos(Real)                       Cosine of an angle in radians

    cosh(Real)                      Hyperbolic cosine

    exp(Real)                       Exponentiation (e ^ Real)

    integer(Real)                   Integer part of real number

    round(Real)                     Round a real number to an integer

    sin(Real)                       Sine of an angle in radians

    sinh(Real)                      Hyperbolic sine

    tan(Real)                       Tangent of an angle in radians

    tanh(Real)                      Hyperbolic tangent

Integer functions operate on Byte, Parcel, Word, or Cell types. Arguments to the Borrow and Carry functions also have the same type as their return value and return either a zero or one value. The argument to the Positive function is a self-typed expression that is smaller than the return type.

    borrow(Integer, Integer)        Borrow from an unsigned subtraction

    carry(Integer, Integer)         Carry from an unsigned addition

    positive(Integer)               Zero extended integer type cast

String functions perform text related operations. All 8 bit character values are allowed in Strings including zero. Consequently Strings can also be used to represent any variable length data; not just text.

Functions that select a single character return the type indicated by the function name. The Length function returs a Word and the rest return string values. Functions with an optional index use a default value. Note that string indecies are one based.

    byte(String [, Word])           Select a character in a String

    cell(String [, Word])           Select a character in a String; 0 extend

    chop(String[, Word])            Remove leading characters

    left(String [, Word])           Left most characters in a String

    length(String)                  Number of characters in a String

    lower(String | Integer)         Lower case a String or character

    parcel(String [, Word])         Select a character in a String; 0 extend

    right(String [, Word])          Right most characters in a String

    string(String[ , Word])         Select a character in a String

    string(String, WordA, WordB)    Substring from WordA to WordB

    trim(String [, Word])           Remove Word characters in back of String

    upper(String | Integer)         Uppercase a String or character

    word(String [, Word])           Select a character in a String; 0 extend

These functions perform type related operations. The Alignment and Span functions take a type name and return a Word (determined at compile time).

    alignment(Type)                 Alignment of a type

    byte{Base | Enum}               Cast to a Byte; Enumeration gives a position

    cell{Base | Enum}               Cast to a Cell; Enumeration gives a position

    double{Integer | Single}        Cast a signed value to a Double

    Enum{Integer}                   Cast to an enumeration by position

    parcel{Base | Enum}             Cast to a Parcel; Enumeration gives a position

    parcel(@Pointer)                Return a Parcel value or 0 if an address

    single{Integer | Double}        Cast a signed value to a Single

    span(Type)                      Number of unpadded Bytes for a type

    span(@)                         Number of Bytes for a pointer (4 or 8)

    string{Integer}                 Cast a character to a String

    word{Base | Enum}               Cast to a Word; Enumeration gives a position

The remaining functions perform I/O and exception related operations.

    context(Variable)               Return 1 if a context is active; else 0

    file(String)                    Size of a file in bytes to a Cell

    form(Base [, Form])             Formatted string for a value or micro

    form(Enum [, Form])             Format the name of an enumerated value

    signal(Variable)                Return 1 if a variable is signaled; else 0

    status({Word | in | out})       Status of an I/O stream

Conditional Expression

Assignment Command