Please enable JavaScript to view this site.

A-Shell Reference

Added July 2016

B,6 and I,6 variables—little endian 48 bit unsigned and signed integers, respectively—were added to ASB in A-Shell version 6.3.1516.0 and compiler edit 763. They are not supported under AMOS. These extend the range of integers that can be stored properly as integers to nearly as great as the range of integers that can be represented precisely by the F,8 data type. The range of B,5 variables is just slightly less than the corresponding range of integers that can be stored precisely in the F,6 data type.

B,6 and I,6 variables can be used like any other numeric variables in statements, expressions, parameter passing, etc., with the following reminders:

Beware that A-Shell run-time versions prior to 6.3.1516 will not properly deal with programs containing B,6 or I,6 variables. Earlier versions of the compiler will report the problem clearly—?Illegal size for variable type—but the run-time will simply misinterpret any values held in those variables, probably treating the value as 0.
As with any conversion between types, when converting from B,6 or I,6 to other types, the receiving variable must be large enough to hold the converted value, else the result will be truncated, wrapped, or otherwise corrupted without any error condition being raised. For B,6 and I,6, the only other data types that can hold the entire range of possible values are F,8 and S,15+. In the case of string, you must set SIGNIFICANCE 15 to avoid exponential notation for large values.
As with any conversion from a floating point value to an integer variable, the fractional part will be truncated, and if the source value exceeds the range of the destination variable type, the result will be wrapped around, without any error being raised.
See ashinc:minmax.def for definitions of the minimum and maximum integer values that can be held by each integer type.
Bitwise operators (AND, OR, NOT, XOR, EQV) operate out to 48 bits.
Built-in subroutines, while having access to the new extended range of integers, have not necessarily been updated to take advantage of them. Unless the documentation explicitly indicates otherwise, you should assume a 32 bit limit for general numeric parameters.
Decimal, octal, and hex constants and symbol definitions support values extending to 48 bit integer or F8 floating point; previously it was 40 bit integer or F6 floating point. You may optionally append an "L" to the end of such literal constants to make explicit that you want them to be encoded into the RUN file using the larger format, but this isn't necessary as the compiler will do it automatically as needed.
The functions Fn'Dec2Hex$() and Fn'Hex2Dec() in SOSLIB:[907,10] have been updated to support the new 48 bit integers. Make sure to download and recompile with the updated fndec2hex.bsi and/or fnhex2dec.bsi modules if you plan to use these functions with values larger than 32 bit values.