Description of some of my Arithmetic Routines

Last Up date: 2017 May 5 on nuMacMini work/gd/lafarr/math
Recent changes: Shortened IA description and replaced RF with R & R3
Updated for www.laforth.com from: 2004 March 20
At the present I haven't got the links below uploaded to the web pages. If you would like them call me at the cell phone number below.

FSEE.ZIP has a few DOS programs to examine files that have Hex data in them.
A description of each is included.

In MA.ZIP, 7,080 bytes. Which must be Un-zipped by you. I have included a four little routines that each do something that would not be easy to do on a calculator.

All were written to run under DOS V2.1 or latter. All were written, entirely by me, in assembly language; hence the small size and, hopefully, speed. In general they all quit if you give them nothing to do, which is just a blank line. Except for IA, all are very simple. Their size, in bytes, is in ( )'s after the name. SX, and IA use only 8086 instructions and will run on any IBM compatible PC.

  1. SX (688) "Sequence Extender"
  2. SX does what Babbage was trying to make a difference engine to accomplish. That is: Evaluate Polynomials. SX also does automatic set up which Babbage had to calculate and do manually. SX uses 78 Digit decimal arithmetic and 10's complement for negative numbers, which you will see if the polynomial goes negative. Incidentally, after using SX, I am convinced that had Babbage completed his difference engine it would have turned out to be worthless for his intended application. ? Maybe that is why he abandoned it and went on to other things?

    SX uses no Multiply, only decimal add instructions. For an Nth degree Polynomial you give it at least N+1 values: One per line on a regular interval, and it will give you 6 more each time you press Enter or Space. (Spaces are allowed preceding values but not between digits.) Press a letter to start a new polynomial.

    Examples, you give it: 0, 5; it knows you want values of "5*x". You give it: 0,0,2 it knows you want values of "X**2 - X". You give it: 0, 10001, 20004 it knows you want values of "X**2 + 10000*X", which is a table of "X" and "X**2" with some zeros separating them.

  3. IA (6,226) "Integer Arithmetic"
  4. IA does variable precision unsigned binary arithmetic. Values can be over 60,000 digits long. Values can be input in any number system base from 2 to 255, and can be output in any base 2 through 16. Decimal input and Hex or Decimal output is the normal default.

    IA is stack oriented (reverse Polish) like early HP calculators and FORTH, it is like APL in that operators are largely single special characters. With very few exceptions, like FORTRAN, spaces are ignored and may be used to make input easier. IA, like APL, may be a bit confusing until you understand it.

    IA has a HELP Screen Which you can see here, and get details of each operation. Arithmetically IA has: Add, Subtract, Multiply, Divide, Power, Factorial, Combinations and Permutations, and Square Root. Plus: Looping, an Alternate Stack, and the stack manipulating commands a FORTH programmer would expect. Except for Square Root, IA does no truncation or rounding.

    Here is an introductory History and description. For more detail on: IA's Input & Output, and how it uses memory. And, if you are serious, here is a much longer history and Detailed instructions I wrote some time ago.

    If you are interested I have more documentation and will help you. IA is here because a few have previous versions and, for them, this is the latest.


    R3, and PL9 use 80386 32-bit instructions; thus, require a 80386 or latter.

  5. R (180)and R3 (240)"Reduced Fractions"
  6. Both take two decimal numbers on the command line. Seperated by either a space or a "/". R uses 16 bit registers R3 uses 32-bit registers. This determines the maximum size of the parameters. Both output a series of "Best" fractions. No fraction of smaller numbers is closer.

  7. PL9 (560) "Powers, Last 9 digits"
  8. Calculators and Floating Point languages such as: C, Fortran, APL, or Logarithms and Slide Rules all provide the first digits of a value. PL9 gives you the last 9 digits of integers raised to a power. PL9 wants either one or two numbers (less than 65,536) on a line. If it gets two numbers separated with a space it calculates the first raised to the power of the second, and then prints out the last 9 decimal digits. If it gets only one number, it raises that number to its own power and prints the last 9 digits. (No spaces within values.)


Feel free to call me before or when you try to run any of them. If you can't remember my phone number just use the DOS "TYPE" command to TYPE the program. The TYPE command requires you include the ".COM" extension.


Contact me at:
My phone #'s
For comments call, or e-mail me. Go to My Home Page or TOP of this page.