Compiling for TI-83+

TI-82, TI-83 (plus, silver..), TI-84, TI-85 and TI-86
Post Reply
ratiocinate
New member
Posts: 4
Joined: Mon Mar 10, 2008 3:57 am

Compiling for TI-83+

Post by ratiocinate »

Hey, I'm new here. I tried writing a couple of trivial C programs (printing "Hello world", etc) and running them through zcc. I'm using the command zcc +ti83 -lm -create-app test.c, but I always get:

Code: Select all

sccz80:"test.c" L:8 Error:#1:Unexpected end of file
Compilation aborted
test.c:

Code: Select all

#include <stdio.h>

int main()
{

    printf("Hello!");
    return 0;
}
Can someone point me in the right direction?

Thanks
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

This is supposed to be fixed :P Are you running 1.8 or previous 1.7?

If it's the problem I think it is it's because your C file does not end in a blank line. Try adding a few blank lines at the end of the program and let us know if this fixes it. If it does, let us know if you're using 1.7 or 1.8 and what platform!
ratiocinate
New member
Posts: 4
Joined: Mon Mar 10, 2008 3:57 am

Post by ratiocinate »

I'm on WinXP Home. I believe I'm using version 1.8, but I noticed that on running zcc, it displays:

Code: Select all

zcc - Frontend for the z88dk Cross-C Compiler
v2.57 (C) 7.10.2007 D.J.Morris
The July date makes me suspect I might actually be running 1.7. I know I downloaded 1.8, though.

In any case, the extra newlines at the end solved the problem. Thanks!

However, I have another issue. Upon running Asm(prgmA) on my calculator, I get ERR:INVALID. I tried compiling it with -startup=10 as suggested by http://www.z88dk.org/forum/viewtopic.php?id=2112, but it results in the same thing. I use MirageOS, but I'm not sure how to get the program to show up in the file listing...
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

ratiocinate wrote:

Code: Select all

zcc - Frontend for the z88dk Cross-C Compiler
v2.57 (C) 7.10.2007 D.J.Morris
My copy also says this. Dom compiles the win32 binaries so we'll have to see what he says.
However, I have another issue. Upon running Asm(prgmA) on my calculator, I get ERR:INVALID. I tried compiling it with -startup=10 as suggested by http://www.z88dk.org/forum/viewtopic.php?id=2112, but it results in the same thing. I use MirageOS, but I'm not sure how to get the program to show up in the file listing...
Unfortunately I'm still not up to speed on the TI calculators, though I would very much like to be. I did get one for Christmas but haven't dipped into it yet as there are several biggish cross-platform things I want to do within z88dk first.

Stef will be able to best answer this so I'll leave it to him, or perhaps someone using MirageOS will comment.

Edit:
Forgot to add a link to the wiki page concerning the TIs, in case it is helpful:
http://www.z88dk.org/wiki/doku.php/platform:ticalc
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I visited:
http://www.detachedsolutions.com/mirageos/

which mentions mirage supports ION and TIOS asm files. You might want to try "-startup=9" and "-startup=1" to see if they work.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Ok, we will get through this yet and I'll be able to stop replying to my own posts I hope..

I just now noticed the named of this thread includes "TI-83+". PLUS.

Refer to:
http://www.z88dk.org/wiki/doku.php/platform:ticalc

For a Ti-83+ target you should be compiling with "+ti8x" or "+ti8xansi" and to target MirageOS you should be using "-startup=2".

Maybe we've sussed it then :D
ratiocinate
New member
Posts: 4
Joined: Mon Mar 10, 2008 3:57 am

Post by ratiocinate »

*Facepalm* Of course, that might be where my problem lies. However, when I compile with zcc +ti8x, my TI-Connect software chokes when trying to transfer it to my calculator. It gives me the following error message: "The current transfer failed. A retry may be successful. (8C010001)"

Retries are not successful. Any ideas?

Thanks for all your help thus far.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

ratiocinate wrote:*Facepalm* Of course, that might be where my problem lies. However, when I compile with zcc +ti8x, my TI-Connect software chokes when trying to transfer it to my calculator. It gives me the following error message: "The current transfer failed. A retry may be successful. (8C010001)"

Retries are not successful. Any ideas?
I'm almost out :P but since MirageOS supports ION stuff as well, give "-startup=1" a try just to see if we can get something working.

The other thing I am thinking about is the other rather odd post tonight by cjgone about header files being corrupted by the optimizer. cjgone is also targetting the ti83+/ti84 I believe. So would you mind trying to compile with "-O0" option as well to turn off the optimizer and see if perhaps it is messing with the header? Now I don't believe this is the case as I think any header file will be a list of bytes as in "defb x0,x1,..." and the optimizer only transforms z80 assembly instructions not raw bytes or lists of raw bytes.

Hopefully if cjgone reads this he will comment on how he got things to work for him in the past!
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

alvin wrote:
ratiocinate wrote:

Code: Select all

zcc - Frontend for the z88dk Cross-C Compiler
v2.57 (C) 7.10.2007 D.J.Morris
My copy also says this. Dom compiles the win32 binaries so we'll have to see what he says.
7th October 2007? :)

I'm not sure what's going on with the cpp - I can't see any CVS logs where I would have fixed it, I know we've spoken about it, so I need to dig up those posts to see what we decided to do.
cjgone
Member
Posts: 15
Joined: Wed Dec 26, 2007 11:41 pm

Post by cjgone »

How I made it work was for no shell( some calc guru told me):

zcc +ti8xansi -startup=10 -o hello.bin hello.c

Then use devpac8x to convert the binary file into a useable file. ( ask for a link if you cannot find)

This is what I did for the Ti-84 Plus SE... I don't know the compatability between Ti-83+ and the Ti-84 Plus SE, but I know I need .8XP for the 84.


I AM not sure if the Ti-83P can execute .8XP, but I know that the Ti-84 cannot not execute .83P files..

However, i'm pretty sure there's a version of devpac8x to convert to .83P files. :S
Last edited by cjgone on Tue Mar 11, 2008 12:05 am, edited 1 time in total.
ratiocinate
New member
Posts: 4
Joined: Mon Mar 10, 2008 3:57 am

Post by ratiocinate »

I finally got around to trying your suggestion, cjgone, and it worked. Thanks a lot!
cjgone
Member
Posts: 15
Joined: Wed Dec 26, 2007 11:41 pm

Post by cjgone »

Sweet, have fun coding some intense calc games, lol!

Just watch out for the 8k memory restriction on the Ti calcs.

The OS won't run program with 8k+ mem, but using a shell like ION or Mirage, you can.

However, if you know the memory layout of the calc, if code is run between $C000 and $FFFF it will crash the calculator, however data can be places placed after this....

If you have like an uber complete prog but you are outta mem, I might be able to help(?).

And if you compile a C prog for ION and it doesn't how up, there might be a slight header error in the ti83p_0crt.asm file. ( may or may not be)
Last edited by cjgone on Sun Mar 16, 2008 9:44 pm, edited 1 time in total.
Post Reply