A85: FP Math (was: Re: Re: Assembly-85 Digest V1 #522)


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

A85: FP Math (was: Re: Re: Assembly-85 Digest V1 #522)




As far as I know the only working FP math program for the TI85 is a program
which converts the value in ans to a fraction using square roots. The
program was written by a french guy (I do not remember his name and he is as
far as I know no longer an active ti85 programer), and it is based on a
proram written in BASIC. The program is written for ZShell, but only runs on
ROM version 3.0A since no shell supports the FP math functions. The program
has one small error which causes it to hang, but other wise works fine.
Since it only works for one ROM version, it was never released.

I have myself written some programs on the TI82 which uses FP math and the
error handler. They are fairly simple and are intended to show people how to
use FP math, and they work on all ROM versions. If anyone want to do FP math
on the TI85, I could probably send you a copy of the source code.

Doing FP math is fairly simple if you under stand the format of the FP
number used on the TI85. Let me give an example:

LD A,4 ; OP2 = constant number 4 (PI)
CALL 24D3
CALL 21A3 ; OP1=2.0
CALL E52 ; OP1=OP1*OP2

The above program calculates 2*PI and stores the value in OP1, from where it
can then be displayed. Most of the ROM functions needed can be found in
TI-ROM.TXT. The only thing which you need besides that it the ability to
load your own number into the OPs. The easiest way of doing this is by
defining them in you program, for example:

My_num:
.DB $00,$01,$FC,$10,$00,$00,$00,$00,$00,$00,$00 ; 10.00

Then the following will load the number into OP1:
LD HL,My_num ; point to number
RST 20 ; load it

Again the needed function are listed in TI-ROM.TXT

DINes
----- Original Message -----
From: Jimi Malcolm <MalcolmJ1@email.msn.com>
To: <assembly-85@towerguard.unix.edu.sollentuna.se>
Sent: Thursday, March 18, 1999 8:31 PM
Subject: A85: Re: Assembly-85 Digest V1 #522


>
> is there any floating point math programs out there that people have
> actually worked with and used?  i am making a program that will use a numb
er
> stored in ascii (a subroutine changes it into decimal) as ".db "000.000",0
> without the ".".  i've already got a program that will add the numbers up.
> i leave out the decimal because it has no value to be added.  it's only
put
> in there when displaying the number.  the number will be saved as, say for
> example, ".db "023013",0" which is the same as "23.013" when it is
> displayed.  i hope that's not too confusing.  i don't like the routine
i've
> alredy made and was wondeirng if someone has already written a routine
that
> will add that number stored as that to another number stored the same way
> and then save the result in one of the slots.  if anyone has used one of
> those programs i would really appreciate it if anyknow could recommend a
> routine or could quickly write one.  that would be great and you would get
> credit.
>
> i know that the op registers can do this but i don't know how to store
> decimal numbers into the op registers.  if someone could help me with that
> i'd really appreciate it too!  thanks a ton.
>
> jimi
>
>
>
>



References: