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:

; 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.
I believe (not entirely sure since I don't myself have or write software for the CSE) your syntax error is just caused by the wrong identifying tokens. You have .db t2ByteTok, tasmCmp, but the CSE uses a different token: .db tExtTok, tAsm84CCmp (0xEF, 0x69).

Everything else looks okay to me, so with a bit of luck that's the only thing you need to change for this particular fix.
Tari wrote:
I believe (not entirely sure since I don't myself have or write software for the CSE) your syntax error is just caused by the wrong identifying tokens. You have .db t2ByteTok, tasmCmp, but the CSE uses a different token: .db tExtTok, tAsm84CCmp (0xEF, 0x69).

Everything else looks okay to me, so with a bit of luck that's the only thing you need to change for this particular fix.


Wow, after I corrected it, the program is working now Very Happy! I Appreciate your help for solving my issue!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement