- [Solved] For Getting crt0 Works on TI-84 CSE with SDCC
- 17 May 2015 01:24:33 am
- Last edited by biergaizi on 17 May 2015 01:59:47 am; edited 2 times in total
Hello everyone.
I'm going to do some C programming for my TI-84 CSE, and I found Write TI-83+/84+ C Programs for GlassOS and TIOS. I set up my toolchains, and tried to tweak the crt0 file for my TI-84 CSE on plain TI-OS (without Doors CSE), I ended up with
Code:
I wrote a C program which does nothing and only returns from the main() function.
Code:
Compiled by
Code:
But after I sent it to my calculator, it throw a Syntax Error message.
I'm new to TI-84 development, and although I have programmed on Linux for years, I don't have knowledge on assembly (That's why I'm setting up a C enviornment), Could you please give me some help and advice? Thanks for everyone.
I'm going to do some C programming for my TI-84 CSE, and I found Write TI-83+/84+ C Programs for GlassOS and TIOS. I set up my toolchains, and tried to tweak the crt0 file for my TI-84 CSE on plain TI-OS (without Doors CSE), I ended up with
Code:
; crt0 for TI-84 CSE
; it doesn't work
;userMem 0xA60B
;t2ByteTok 0xBB
;tasmCmp 0x6D
.module crt0
.globl _main
.area _HEADER (ABS)
.org 0xA60B - 2
.db 0xBB, 0x6D
call gsinit
jp _main
.org 0xA60B + 6 ; why plus six? I guess it is an offset value to move 6 bytes forward because previous 2 instructions have used them.
.area _HOME
.area _CODE
.area _GSINIT
.area _GSFINAL
.area _DATA
.area _BSEG
.area _BSS
.area _HEAP
.area _CODE
__clock::
ld a,#2
ret ; needed somewhere...
.area _GSINIT
gsinit::
.area _GSFINAL
ret
I wrote a C program which does nothing and only returns from the main() function.
Code:
int main(void)
{
return 0;
}
Compiled by
Code:
$ sdasz80 -p -g -o tios_crt0.rel tios_crt0.asm
$ sdcc -mz80 --code-loc 42513 --no-std-crt0 --data-loc 0 --reserve-regs-iy --max-allocs-per-node 30000 -o test.ihx tios_crt0.rel test.c
$ hex2bin test.ihx
$ binpac8x -O SDCC test.bin test.8xp
But after I sent it to my calculator, it throw a Syntax Error message.
I'm new to TI-84 development, and although I have programmed on Linux for years, I don't have knowledge on assembly (That's why I'm setting up a C enviornment), Could you please give me some help and advice? Thanks for everyone.