"How to" for first program

TI-82, TI-83 (plus, silver..), TI-84, TI-85 and TI-86
Post Reply
AntonioCS
New member
Posts: 2
Joined: Wed Sep 12, 2007 2:24 pm

"How to" for first program

Post by AntonioCS »

Hey!

I know a bit how to program in C. What I don't know is how to run z88 to convert my .c file to a program for my calculator.

Can anyone make a simple "how to" for this please! Like the first steps and such! please please!!!
User avatar
dom
Well known member
Posts: 1194
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Alvin's ongoing tutorial thread on WoS is targetted for the spectrum but the concepts are applicable to all platforms: http://www.worldofspectrum.org/forums/s ... hp?t=16690

As for calculator support, I'm really not sure of the state of play, there's probably a few comments on ticalc.org about how to make things work.
AntonioCS
New member
Posts: 2
Joined: Wed Sep 12, 2007 2:24 pm

Post by AntonioCS »

Gee thanks alot for the support
User avatar
dom
Well known member
Posts: 1194
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Maybe a newsgroup would've been a better idea....

I'm baffled as to what you want to do, for example I don't have the following information:

1. What platform you're running z88dk on
2. What target you want to produce a program for
3. What your program does that you want to port to whatever target you want it to run on
4. What you've changed in the source code in an attempt to get it to run on whatever your target is

Without any clue as to what you're hoping to achieve, I can't really give you any help other than to point you in some general directions.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Yes it's hard to help out without more information :)

The basic compile command is something like this:

zcc +zx -vn prog.c -o prog.bin -lndos -create-app

The "+zx" selects the z80 target. In this case "zx" is the Sinclair ZX Spectrum and this tells the compiler to use library code written for the Spectrum. You mentioned the intended target is one of the calculators for which there are several possibile targets "+ti8x", "+ti82", "+ti82ansi", "+ti83", "+ti83ansi", "+ti85", "+ti85ansi", "+ti86", "+ti86ansi" depending on which model calculator you are compiling for. I imagine the main difference between them is the graphics code. The ansi libraries include some terminal emulation for stdout.

"-vn" indicates a silent compile (verbose no). "-lndos" links to the stdio library stubs. Many targets do not have disk drives, etc, so cannot have a full stdio implementation. This stdio stub is for such targets. "-create-app" does not work for all z80 targets; this option invokes "appmake" which uses the output machine code to generate a standalone file appropriate for emulators (or whatever) on the intended target. For example, on the ZX Spectrum this option creates a "tap" file which is an electronic image of a tape containing the output binary. "appmake" only supports a finite number of z80 targets and may not be able to do anything for the ti calcs (I don't know but if it doesn't you are welcome to add support!). Regardless of whether or not you can use appmake, zcc will always output the raw binary result.

You would also need to link to more libraries on the compile command if you use them, just like modern C compilers. Eg, if your program uses floating point math you'd need to link to the math library "-lm", etc. Many functions are automatically linked when you specify the target "+zx".

As you can tell I don't have any particular knowledge of the ti ports :) Stef did the ports and I don't know what the state of them is. However he has written a brief ti-intro in the wiki which you should check out before doing anything:

http://www.z88dk.org/wiki/doku.php/platform:ticalc
Post Reply