HUEY: SUPERCALCULATOR LXVIII
Copyright 1978 by Don Rindsberg
IM-1 VERSION by
This is probabily the mots powerful calculating system available to users of microprocessors. It is written in a way that uses the fewest number of machine cycles required for the accuracy produced. For example, “?”, arctan, calls over 200 subroutines and gives an anwser in 3 or 4 seconds. Imagine how long it would take the following algorithm to run in BASIC for 11 digit accuracy:
B=x/(1+(x2+1)*5) C=B/(1+(B2+1)*5) Y=C2
ARCTAN(X) = 4C(1-y/3(1-3y/5(1-5y/7(1-7y/9(1-9y/11(1-11y/13(1-13y/15(1-15y/17(1-17y/19))))))))
Huey uses 47 bit arithmetic, that is 1 bit less than an IBM mainframe (360) in double precision mode, and 15 bits more than the new floating point processor boards selling for hundreds of $$$ for the modt popular computers. Huey does not round-off nubers of check for illogical functions like SQR of zero. There are certain constants built-in for the algorithms and may be displayed if dividing by zero, log of zero, etc. The STACK (XYZT) can also play a part so become familar with the four sequences of the stack. However, there are FIVE ERROR signals built-in and they don't erase all your entries doing it (like most poket calculators). They are:
|LOG of NEG.#||-0.000000000000* 00||T|
|SQR of NEG.#||-0.000000000000* 00||Z|
|EXPONENT OVERFLOW||0.000000000000* 00||Y|
|MULTIPLY OVERFLOW||0.000000000000* 00||X|
|DIVIDE OVERFLOW||0.000000000000* 00|
If you hit K to display the stack your last entries will still be there. (Except EXP. Functions)
RPN: Revers-polish notation: Enter Y, Enter X, then a function. / * + - operate on X and Y and leave the answer in X. Recalls push the stack up. Log, trig, SQR, Inv of X, E to the X, operate on X and leave the stack unchanged.
|ACCURACY||SIGNIFICANT FIGURES||TRIG. FUNCTIONS|
|Arithmetic||12||0 to Pi/2 radians (0 to 90o)|
|Square Root||11||1 x 1037 to 1 x 10-37|
|Compound interest||8 (1+i)n|
|present value||8 1/(1+i)n|
|Speed of light||±.00008 cm/sec.|
|Speed of dark||Same?|
To enter negative exponents use 63 to 99. Huey will subtract from 100 and display -37 to -01. For negative numbers use the N key, for positive use the P key these are the enter keys. To clear an entry instead of entering it you use the @ key. (remember to shift)
B006 7E or BD AFD1 Jump to input routine
USE 7E and letters of functions, ext. are'nt displayed.
B009 7E 8473 Jump to output routine.
B00E 02 to 0D Number of digits displayed.
B011 01 to FF TTY CRLF delay
B01C Stack (allow 40 bytes) this one is set to BC00
B638,9 Jump to monitor either 7000 or 4812 for Rommon.
B63A,B Jump to Basic, could be anywhere else.
|A Antilog||C COS (radians)||R Rool stack (X->Y->Z->T->X)|
|G LOG10||S SIN||K Display stack|
|L NLOG||T TAN||@ Clear entry|
|E Ex||H SINH (ex-e(-x))/2||P Positive entry|
|J Yx||? ARCTAN||N Negative entry|
|V E(2.718281828)||I 1/x||X Exchange X and Y|
|W LOG e(.434294481)||Q SQUARE ROOT||Y Duplicate X in Y|
|U Pi (3.141592654)||= Xvy-||Store X in M Recall M to X|
|PROGRAMMABLE CONSTANTS||LOCATION||PROGRAMMING NEW CONSTANTS|
|* Velocity of light cm||B910-16||Step 1. Enter number, e.g.,1.2345P|
|, Velocity of light mi||B920-26||Display 1.234500000000* 00|
|: 1 x 10||B930-36||Step 2. Hit M (jumps to mon.)|
|; 1 x 102||B940-46||Step 3. Hit D (display) 0020|
|Z 1 x 105||B950-56||Step 4. Hit ESC, then M B910 (e.g.)|
|Step 5. Enter the 7 hex bytes from 0020-26|
|Now, the period in this example||at B910-16. Now, ESC, the GB00.|
|Will call the new constant.|
|PROGRAMMABLE SUBROUTINES||LOCATION||OTHER SUBROUTINE STRINGS|
|D Present Value||B992||ARCSin D4 D4 06 12 D8 10 04 12 32 E0 60|
|F Compound Interest||B894||08 12 32 B1 00.|
|H Sinh||B980||ARCCOS Change the 60 in arcsin to 10|
|Arcsin and Arccos Will only fit||Gudermannian 32 B0 32 B1 DC 06 12 EA|
|at B980.||DC 08 12 04 12 00.|
|D4 is recall x to x, 02 add, 04 sub., 06 mult., 08 div., 10 exch. X & Y, 00 end of str.|
If you have the new ROMMON you can duplicate HUEY elsewhere in ram in 20 minutes. Just be sure to do it in increments of 100hex. There are 125 bytes to change though before it will work. You can use the B key (jump to BASIC) to jump back and forth between HUEYs for multiple functions per key or more constants.
Example: Duplicating HUEY at A500. You've just duplicated the program and are ready to modify each address listed below to the new correct hex byte.
A501 B013 change to A513, A606 B2AD change to A7AD. B0's to A5's, B1 to A6, B2 to A7, B3 to A8, B4 to A9, B5 to AA and B6 to AB. HUEY starts at B000 and ends at B9B0. But has a jump section from BB00 to BB32. This section could be located elsewhere, e.g. AF00.
The keyboard routine at AFEE can be shared by all. The following table lists the address of each byte that has to be changed. The stack can be anywhere, allow 40 bytes(B01c).B001 B04D B0AC B0D2 B122 B154 B1ED B241 B318 B3E5 B532 B5A5 B004 B054 B0BA B0D7 B132 B162 B1F7 B246 B31E B3EA B535 B5A8 B028 B087 B0BD B106 B141 B19F B20C B250 B32B B3ED B540 B5AF B041 B09A B0C0 B109 B146 B1AE B226 B26A B330 B3F0 B548 B5B2 B046 B0A3 B0CB B11B B149 B1DC B235 B30E B335 B3F3 B5A2
The following gegin with B6 02, 04, 06, 08, 0A, 0C, 0E, 10, 12, 14, 16, 18, 1A, 1C, 1E, 20, 22, 24, 26, 28, 2A, 2C, 2E, 32, 34, 3C, 3E, 40, 42, 44, 46, 48, 4A, 4C, 56, 58, 5A, 5C, 5E, 60, 62, 64, 66, 68, 6A, 6C, 6E, 70, 72, 74, 76, 78, 7A, 7C, 7E.
Overflow Jumps : B1D1, B24C, B3B8, B4A4, B4E9, BB03, BB06, BB0D, BB10, BB1B, BB1E, BB25, BB28.
NOTE: The P & F keys, P.V. & F.V., require # of int. Periods first( in Y), then interest as a rate in X.
E.G. 100*00P, then :(x10),*(mult), 9.00*98P (9%), then F. $1 compounded at 9% for 10yrs. = 2.36736. The ESC key fills in zeroes to exp. Symbol. HUEY is tolerant of most entries, acting only on 1 to 14 or 15 digits entered.
Another sub. The Inverse Gudermannian: DC 08 12 EA CC 08 12 02 12 32 75 32 80 00