Re: A82: Floating point numbers in ash


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

Re: A82: Floating point numbers in ash




82-ROM.TXT lists some of the most common math functions, but it is not
very easy to use them in a program. Using functions which is placed before
app. $800 is no problem since they are in the same place in all rom
versions, however the math functions are placed after that. A lot of the
useful rom call are placed in a table at the end of the page and therefore
Ash makes it possible to call these (using ROM_CALL). All the calls which
are placed in between $800 and $3000, can not be called because they have
different addresses in all the rom versions. So if you want to use a
function which is located here you have to find the addr in all the rom
versions your self, and then make your own versions of ROM_CALL.
Fortunatly some of the functions can be called using the rst instruction,
but this is only the simpel ones. 

It is possible to add support for the FP math functions to Ash, but there
are several problems with this. All PUSH/POP instructions are
allocating/deallocating user memm which means some locations in  RAM could
be moved. Besides that you need to be able to use the PUSH/POP
instructions and LD OPx,? instructions. If you have a look in 82-ROM.TXT
you will see that a lot of functions would have to be added, which would
take up a lot of space.

So it is rather hard to use the FP math functions, but i has been tested
on the TI85, and it is possible to make make rather complicated math
programs using these functions. If you want to use the functions i would
suggest that you do not use the FP Stack (It is too hard to write the
functions your self, and there are too many for a shell to support this),
and that you write your own LD instructions (this is rather easy and would
save a lot of space). If you do this all you need to do is to make your
own rom call function, which is rather easy if you know the addrs of the
functions you have to call. So you some how have to find the addrs of the
math functions in all the rom versions <> 19.

Dines


_______________________________________

Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________