A86: Re: Math


[Prev][Next][Index][Thread]

A86: Re: Math




I can see about three ways to do math like that.  First would be to (as you
said) combine registers.  The next way would be to use BCD.  Using BCD you
can be as accurate as you want, but it can get complicated.  See
http://icarus.ticalc.org/ for some BCD math tutorials.  The third way is to
use the ROM's floating point routines.  If there is enough interest, we'll
get a tutorial written.

To combine registers for addition and subtraction, the key is to use the
carry flag.  If you don't need numbers bigger than 24 bit, you can use AHL
as the abs routines do.  For example, to add DE to AHL:

 add hl,de
 adc a,0


> Does anyone know where I can get a tutorial on math routines for the
> TI-86.  I just have some basic things that I need to learn.  Like how to
> add and store numbers like 45632 and 383839 that are greater than 256..
> (i'm guessing you combine registers) and how to work with floating point
> numbers...




References: