Arithmetic 99 I ::;O!JF:~CF LI! i:::\ ()i)()'::, 'j .::,(;"i:, '::i, m'm ==:i,'?B I;::;CiUF~CF Add in new digit (old d glT I'::UUf;':CE :::::Tf:i AF;;::? ':::;,;:'i.".":;:' ti"';>';:' ce:,('r-",:,:''::: t,ed cf.~c,t ':::, ",' I~:;C)tJ~~C:E:. Flt"'C1Ct:'i:::':] tc: .::tC1,ji,..l::::.t ;': · .. ·.·-1::·· ... :~; .~!.I .~1· I. Arithmetic Utilities Now that you have been introduced to the complexities of BCD arithmetic and floating-point operations, this is the time to present an easier way of accomplishing these operations - the arithmetic utilities. In order to make BASIC a useful programming tool, the operating system already contains a number of floating-point routines.
Recognizing that BCD and floating-point arithmetic can be a difficult and laborious task to implement, the assembly language provides a utility by which the operating system mathematical routines can be accessed. There are also utilities for the conver- sion of numerical data types. UTILITY: ReI math The Rei_math utility provides access to all of the system floating point routines and functions. General Procedure: The utility is told the execution address of the desired routine or function and is also told the number of parameters. The parameters are floating-point values stored in full-precision form (4 words each). The result is a full-precision value. Special Requirements:
If one operand is passed to the utility, the address of the operand is stored in register Oper_1. If two operands are passed to the utility, the address of the first operand is stored in register Oper _1 (as above), and the address of the second operand is stored in register Oper_2. The address of where the result should be stored must be stored in the register Result. All operands and the r~sult are full-precision values and require 4 words each.