Make ion progs in C.

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Make ion progs in C.

Post by cjgone »

How do I compile working ion compatible progs in C?

I'm using this:
zcc +ti8xansi -startup=1 -o name.bin name.c (using with devpac8x)


and it doesn't make ion programs.

if it can't, then is their a ti-os to ion program program? -.-
Last edited by cjgone on Mon 03 Mar, 2008 12:39 am, edited 2 times in total.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Try hacking away at the crt0 file
You know your hexadecimal output routine is broken when it displays the character 'G'.
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Post by cjgone »

I think ti83p_crt0 is right...

err...

Code: Select all

;-----------------
;1 - Ion (default)
;-----------------
IF !NOT_DEFAULT_SHELL
	DEFINE Ion
	org	$9D95
	;org	$9D93
	;defb         $BB,$6D
	ret
	jr	nc,start
	DEFINE NEED_name
	INCLUDE	"zcc_opt.def"
	UNDEFINE NEED_name
 IF !DEFINED_NEED_name
	defm	"Z88DK Small C+ Program"
 ENDIF
	defb	$0
ENDIF
and ions header is:

Code: Select all

   .nolist              ;\
   #include "ion.inc"   ; \
   .list                ;  \
#ifdef TI83P            ;   \
   .org  progstart-2    ;    | Standard Ion
   .db   $BB,$6D        ;   /  Program Header
#else                   ;  /
   .org  progstart      ; /
#endif                  ;/
   ret                  ; use xor a if libraries are not used
   jr    nc,start       ; jump to the start
                        ; of the program
Now what? :[ Could you plz convert bottom ion header to something I could use? ty.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Maybe uncomment the BB 6D part
You know your hexadecimal output routine is broken when it displays the character 'G'.
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Post by cjgone »

Cool, it now works. ^_^


Yay, thanks,.. Just one thing, what is the memory restriction in a shell for code [not data] ( thats why i went for a shell cuz my prog atm is to big for the ti-os),

and can i run code after $C000?
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

There is a 0xC000 limit, because Texas Instruments is evil. Maybe you need to make an app.
You know your hexadecimal output routine is broken when it displays the character 'G'.
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Post by cjgone »

Zomg. :'(

I was reading about flipping RAM pages and making larger progs... Is their any way someone could show me how to do this? :O
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Strange, compiling like that works fine for me, at least this program shows up as Ion, changing startup to 2 makes it MOS:

Code: Select all

#pragma string name Hello World
#pragma data icon 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00;

#include <stdio.h>

main() {
	// print string
	printf("Hello World!");

	// wait for keypress
	while( getk() == 0 ) {
	}
}
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Can't you run code after $C000 if the swap an executable rampage in there? (SE/84 only of course)
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

I don't think it's possible to use any memory banking other than $4000-$7FFF without screwing up TIOS's interrupt handler or romcalls.

But on a TI83+SE or TI84+ series you can have "Ram APPS", 16k of code running from a RAM bank, mapped into $4000-$7FFF. However, you need to write your program to run from that origin, and any data passed to a romcall must be in a different page. At that point, you're better off just making an app.
You know your hexadecimal output routine is broken when it displays the character 'G'.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

It would be a decidedly odd thing to do of course, and how would you even get the ram app in place? (not in any normal way, that's for sure)

But, what I would really like to know: can you run code from $C000 - $FFFF if you swap in an executable rampage? (the odd numbers (as opposed to even)) (through "the other memory mode" or port5?)
It would kill the TIOS for sure, but is it at all possible?
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

I got no way to test, I only have a TI83
You know your hexadecimal output routine is broken when it displays the character 'G'.
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

King Harold wrote:It would be a decidedly odd thing to do of course, and how would you even get the ram app in place? (not in any normal way, that's for sure)

But, what I would really like to know: can you run code from $C000 - $FFFF if you swap in an executable rampage? (the odd numbers (as opposed to even)) (through "the other memory mode" or port5?)
It would kill the TIOS for sure, but is it at all possible?
I remember Jim e or tr1p1ea posting about this once so I think it's possible.
Image Image Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

King Harold wrote:But, what I would really like to know: can you run code from $C000 - $FFFF if you swap in an executable rampage?
Yes, as it’s the page protection that counts, not the address it is mapped to.
Post Reply