MPE/iX Intrinsics Reference Manual (32650-90875)

Chapter 4 57
Command Definitions (ABORTSESS - FCLOSE)
ASCII
ASCII
NM and CM callable.
Converts a 16-bit binary number to a specified base and represents it as a numeric ASCII
string.
Syntax
I16 * I16V CA
numchar
:=ASCII(
binvalue,base,asciieqv
);
Functional Return
numchar
16-bit signed integer (assigned functional return)
Returns the number of characters in the resulting ASCII equivalent.
Parameters
binvalue
type varies by value (required)
Passes the binary number to be converted to an ASCII string:
For octal conversions,
binvalue
must be a 16-bit unsigned integer.
For decimal conversions,
binvalue
must be a 16-bit signed integer.
For hexadecimal conversions,
binvalue
must be a 16-bit unsigned
integer
base
16-bit signed integer by value (required)
Passes and must be one of the following values or the process aborts:
Value Meaning
8 Convert to octal (pad with zeros)
10 Convert to decimal (left-justify)
-10 Convert to decimal (right-justify)
16 Convert to hexadecimal (pad with zeros)
asciieqv
character array (required)
Returns the converted value. Must be long enough to contain the result (<=
6 characters):
For octal conversions (
base
=8), 6 characters (including leading zeros)
are returned;
numchar
returns the number of significant
(right-justified) characters (excluding leading zeros). If
binvalue
=0,
the length returned is 1.