support for ti calculators

TI-82, TI-83 (plus, silver..), TI-84, TI-85 and TI-86
Post Reply
stev47
New member
Posts: 6
Joined: Sun Mar 07, 2010 4:36 pm

support for ti calculators

Post by stev47 »

hello,

up until now I've been programming in ti-basic for my ti83+ calculator since there were sufficient resources available and it was easy to learn.
Although being happy for quite a long time, I am interested to program in C for the reason of performance (and code-tidiness).
I was following asm-forums with interest, but I'm lacking the time to really dig into it.

Trying out the z88dk suite, I ran into many problems reaching from lacking documentation (especially for programming for ti-devices) to weird compiling issues.

What is the activity in the support for the ti-calculators?
I'm using z88dk version 1.8 (included in Ubuntu 9.10, since 1.9 and the cvs-snapshot don't compile for me), floating-point support seems broken (compiling the mandel.c example):

Code: Select all

File '/tmp/tmpXXBzY7pe.asm', Module 'MANDEL', Symbol not defined
Error in expression MINUSFA

File '/tmp/tmpXXBzY7pe.asm', Module 'MANDEL', Symbol not defined
Error in expression DSUB

File '/tmp/tmpXXBzY7pe.asm', Module 'MANDEL', Symbol not defined
Error in expression FLOAT

File '/tmp/tmpXXBzY7pe.asm', Module 'MANDEL', Symbol not defined
Error in expression DDIV
Considering that this is a rather huge issue and the missing documentation, I'm wondering whether programming in C is the right decision.
But even so I don't quite understand why there is so little activity concerning C Development for the TI-Z80-calculators. After all there are quite a bunch of people out there programming actively asm for the TIs and with nowadays compilers it should be able to optimize the code quite well. I can't think of anyone who would rather program in complicated Assembler than in C when performance is not a big deal.

regards
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

TI support hasn't really changed in a few years, we're lacking a maintainer who has good knowledge of the various calculators and actually owns one - all the work Stefano does is using emulators.

However, things should compile, it looks like you need to add -lm to your compile line. Documentation is mostly tucked away on the wiki (http://www.z88dk.org/wiki).

I'm a bit worried about your 1.9 compilation problems - can you let me know the platform and the errors? There's also nightly snapshots up at http://nightly.z88dk.org which fix a few issues we've found on 64 bit platforms.
stev47
New member
Posts: 6
Joined: Sun Mar 07, 2010 4:36 pm

Post by stev47 »

thank you, the example compiled properly with the additional parameter.
But isn't the math library already being linked by the ?#include <math.h>? expression?

Link to buildlog: http://pastebin.com/ecxuuvG6

I'm using kernel 2.6.32 and platform x86_64.

Are there some easy tasks to complete? I'm willing to contribute to the project.
As I'm getting more affiliated with it, I would like to write some additional examples and documentation for the ti-ports.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Thanks for the log, I understand what's happening. It looks like a delicately poised tower of problems:

1. z80asm isn't building - there's a symbol clash within z80asm and a library provided by (I think) Fedora. This has been fixed in the nightlies
2. The build doesn't stop at that point and tries to build libraries.
3. There's possibly another program called z80asm installed which doesn't like some of z88dk's z80asm options (it may even be an older version of our z80asm)

1. Has already been fixed, 2. I'll look into, and 3. I'm not sure what we can do about.

Regarding -lm, some platforms have multiple math library implementations so you need to explicitly say which one you want (as a generally rule, -lm is the generic one and -lmz is the native one).

Best thing to do is to pick up an area that you think is lacking an example or documentation. One are that isn't great is actually how to get a program running on a calculator.
stev47
New member
Posts: 6
Joined: Sun Mar 07, 2010 4:36 pm

Post by stev47 »

I've had the z80asm package installed (http://packages.ubuntu.com/karmic/z80asm) which also provides the z80asm command.
The z88dk-bin package in Ubuntu provides the binary with an alias: z88dk-z80asm

If the build uses its own z80asm binary, shouldn't the bin-directory then be in $PATH during the build (even if it is a system-wide install)?
In the README.1st it is only mentioned in the ?Home Directory Install? paragraph.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

stev47 wrote:But isn't the math library already being linked by the ?#include <math.h>? expression?
Only a few C libraries are automatically linked to according to the C standard and math is not one of them, probably for the reason dom gave :-) The header file only informs the compiler that said functions are out there somewhere but the linker needs to be separately informed where to look.
Are there some easy tasks to complete? I'm willing to contribute to the project.
The one thing I've wondered about is if it's possible to build a native TI app rather than going through all that pain of targetting a dozen shells and if it could make sense to do that.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I'd like to say a thing myself too, it would be wonderful to have native math libraries for the TI calculators, but it is not easy at all.. first because of the 10 bytes mantissa format, but expecially for the many different ROM versions / target platforms to be included.
Post Reply