Radix Conversion (MB, MO, MX) |
![]() ![]() ![]() |
The radix conversion codes convert a number to/from binary (MB), octal (MO) or hexadecimal (MX).
Input Conversion
The MB, MO and MX conversions take a number represented by a character string of binary, octal or hexadecimal digits and converts it to an internal integer value.
Addition of the 0C suffix to these codes (MB0C, MO0C, MX0C) takes a character string holding a series of binary, octal or hexadecimal digits and translates each group of 8, 3 or 2 digits to the corresponding ASCII character. If the source data is not an exact multiple of 8, 3 or 2 digits in length, as appropriate to the conversion type, implied leading zeros are added.
Output Conversion
The MB, MO and MX conversions convert a number to binary, octal or hexadecimal form as a character string. Non-integer values are truncated towards zero. Negative values are treated as unsigned 32 bit values. Leading zeros are suppressed.
The addition of the 0C suffix to any of these conversion codes treats the source data as a character string and converts each character to its binary, octal or hexadecimal representation.
Examples
|