TRANSCENDENTAL OPERATORS
FPWRT EE97
Raise ARG to the FAC power. On entry A and Z must reflect the value of FACEXP.
SQR EE8D
Takes the square root of FAC
LOG E941
Log base e of FAC
EXP EF09
Raise e to the FAC power
COS EFEA
Returns the cosine of the FAC in radians.
SIN EFF1
Returns the sine of the FAC in radians.
TAN F03A
Returns the tangent of the FAC in radians.
ATN F09E
Returns the inverse-tangent of the FAC in radians.
OTHER OPERATORS
SGN EB90
Modifies the value of the FAC depending on its value on entry.
On exit:
FAC = 1 if FAC was greater than 0
FAC = 0 if FAC was equal to 0
FAC = -1 if FAC was less than 0
ABS EBAF
Absolute value of FAC. If FAC is less than 0 then FAC = -FAC.
INT EC23
Greatest integer value of FAC. Uses QINT and floats the result.
RND EFAE
Form a pseudo-random number in FAC and update RND at 00C9.
SIGN EB82
Set A according to the value of FAC.
On exit:
A = 1 if FAC is positive
A = 0 if FAC = 0
A = FF if FAC is negative
FCOMP EBB2
Compare FAC and a packed number in memory pointed to by Y,A.
On exit:
A = 1 if (Y,A) < FAC
A = 0 if (Y,A) = FAC
A = FF if (Y,A) > FAC
NEGOP EED0
FAC = -FAC
FADDH E7A0
Add 1/2 to FAC
DIV10 EA55
Divide FAC by 10. Returns positive numbers only.
MUL10 EA39
Multiply FAC by 10. Works for both positive and negative numbers.
LOWER LEVEL INTERFACE ROUTINES
FOUT ED34
FOUT creates an ASCII string in FBUFFR equivalent to the value of FAC. On exit Y,A points to the string, which ends with an ASCII null. FAC is scrambled. Use STROUT to print the number.
SNGFLT E301
SNGFLT converts the unsigned number in Y to a floating point number in FAC.
GIVAYF E2F2
GIVAYF converts the unsigned number in Y,A to a floating point number in FAC.
FLOAT EB93
FLOAT converts the signed number in A to a floating point number in FAC.
CONINT E6FB
CONINT converts FAC into a single byte integer in X and FACLO. CONINT normally exits through CHRGET unless FAC is greater than 255 or less than 0, when it exits via ILLEGAL QUANTITY ERROR.
AYINT E10C
If FAC is less than +32767 and greater than -32767, then execute QINT. Otherwise AYINT exits via ILLEGAL QUANTITY ERROR.
QINT EBF2
Quick greatest integer function. Leaves INT(FAC) in FACHO,MO,LO signed. QINT assumes that the absolute value of the FAC is less than 8388608 (2^23rd power).
GETADR E752
GETADR converts the number in FAC to a 2 byte, unsigned integer in LINNUM. When FAC is greater than 65535 or less than -65535, GETADR exits via ILLEGAL QUANTITY ERROR.
GETNUM E746
GETNUM fetches a 2 byte number, a comma and an unsigned, single byte number from TXTPTR. The first number is stored in LINNUM, while the second is returned to the X register. On entry TXTPTR points to the first character of the formula for the first number. GETNUM uses FRNUM, GETADR, CHKCOM and GETBYT.
COMBYTE E74C
COMBYTE checks for a comma, then fetches an unsigned, single byte number returned in X. On entry TXTPTR points to the comma. COMBYTE uses CHKCOM and GETBYT.
FRMEVL DD7B
FRMEVL evaluates the formula at TXTPTR using CHRGET, then leaves the result in FAC. On entry, TXTPTR points to the first character of the formula, while on exit points to the terminator. "A" does not contain the terminator. The format of the temporary result on the stack is:
The address of the operator routine.
The floating point temporary result.
The precedence of the operator.
FRMEVL, the main subroutine for the commands that use formulas, works for both strings and numbers. If the formula is a string literal, FRMEVL gobbles the opening quote, then executes STRLIT and ST2TXT.
FRMNUM DD67
FRMNUM evaluates the formula at TXTPTR, puts it in FAC, then makes sure the result is numeric. On entry TXTPTR points to the first character of the formula. FRMNUM exits through TYPE MISMATCH ERROR if the result is a string.
FIN EC4A
FIN inputs a floating point number into FAC from CHRGET. FIN assumes the 6502 registers and A were set up by the CHRGET that fetched the first digit. FIN only operates on numeric constants, not formulas.