 |
init_float |
Function (Macro) |
Initializes the floating point emulator.
init_float initializes the TIOS floating point emulator. However, as far as I know,
you need not to call this function explicitely anywhere in your program, because TIOS
does it in the boot code. As this function is removed from AMS 2.xx, it is redefined
in this release of TIGCCLIB to do nothing (it is kept in this header file only for
compatibility with previous releases).
Note: TIOS fp emulator is, in fact, located in TIOS routine called _bcd_math.
This routine performs a set of arithmetic operations on binary coded decimal floating
point values. A two-byte emulator opcode word is needed after the call to _bcd_math
to instruct the emulator which operation will be performed, where are its operands, etc.
Operands may be in MC68000 registers, in the memory, or in "floating point registers"
(they are, in fact, memory locations on the stack frame from the aspect of the emulator).
If the "instruction" has immediate operand, there will be more than one extra inline word
after the call to _bcd_math.
Anyway, function _bcd_math is unusable in C programs (except
in asm statements), due to non-C calling convention. Fortunately, nearly
all operations supported by _bcd_math have also a built-in interface
in TIOS which is adapted to C calling convention.
That's why I completely bypassed _bcd_math function in this header
file. It may give additional flexibility for ASM programmers (sometimes the argument may be in
the register, sometimes in the memory, etc.). But in C, the arguments are always on the stack,
so this flexibility is not necessary.