Emerson PMT1 Network Router User Manual


 
Monitor: Standard Monitor Functions
10002367-02 PmT1 and PmE1 User’s Manual
8-37
unsigned long atoX(p, Base)
char *p;
int Base;
BinToHex(Val)
unsigned long Val;
HexToBin(Val)
unsigned long Val;
FindBitSet(Number)
unsigned long Number;
Description: These functions are a collection of numeric conversion programs used to convert character
strings to numeric values, convert hexadecimal to BCD, BCD to hexadecimal, and to search
for bit values.
The atoh function converts an ASCII string to a hex number. The atod function converts an
ASCII string to a decimal number. The atoo function converts an ASCII string to an octal
number. The atob function converts an ASCII string to a binary number.
The function atoX accepts both the character string p and the numeric base Base to be used
in converting the string. This can be used for numeric bases other than the standard bases
16, 10, 8, and 2.
The BinToHex function converts a binary value to packed nibbles (BCD). The HexToBin
function converts packed nibbles (BCD) to binary. This function accepts the parameter Val,
which is assumed to contain a single hex number of value 0-99.
The FindBitSet function searches the Number for the first non-zero bit. The bit position of
the least significant non-zero bit is returned.
BootUp
BootUp(PowerUp)
int PowerUp;
Description: The BootUp function is called immediately after the nonvolatile memory device has been
opened and the board has been configured according to the nonvolatile configuration. This
function also determines if memory is to be cleared according to the nonvolatile configura-
tion and the flag PowerUp.
The monitor provides an autoboot feature that allows an application to be loaded from a
variety of devices and executed. This function uses the nonvolatile configuration to deter-
mine which device to boot from and calls the appropriate bootstrap program. The monitor
supports the EPROM, ROM, BUS, and SERIAL autoboot devices, which are not hardware-
specific. The remainder of the devices may or may not be supported by board-specific func-
tions described elsewhere.
Arguments: The flag PowerUp indicates if this function is being called for the first time. If so, memory
must be cleared.