Page 1 of 1

Make ion progs in C.

Posted: Sun 02 Mar, 2008 11:39 pm
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? -.-

Posted: Sun 02 Mar, 2008 11:43 pm
by Dwedit
Try hacking away at the crt0 file

Posted: Mon 03 Mar, 2008 12:33 am
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.

Posted: Mon 03 Mar, 2008 1:00 am
by Dwedit
Maybe uncomment the BB 6D part

Posted: Mon 03 Mar, 2008 1:08 am
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?

Posted: Mon 03 Mar, 2008 2:13 am
by Dwedit
There is a 0xC000 limit, because Texas Instruments is evil. Maybe you need to make an app.

Posted: Mon 03 Mar, 2008 2:53 am
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

Posted: Mon 03 Mar, 2008 8:27 am
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 ) {
	}
}

Posted: Mon 03 Mar, 2008 12:42 pm
by King Harold
Can't you run code after $C000 if the swap an executable rampage in there? (SE/84 only of course)

Posted: Mon 03 Mar, 2008 9:07 pm
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.

Posted: Mon 03 Mar, 2008 9:46 pm
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?

Posted: Mon 03 Mar, 2008 10:33 pm
by Dwedit
I got no way to test, I only have a TI83

Posted: Mon 03 Mar, 2008 10:59 pm
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.

Posted: Tue 04 Mar, 2008 8:09 am
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.